[前][次][番号順一覧][スレッド一覧]

ruby-changes:40478

From: ngoto <ko1@a...>
Date: Sat, 14 Nov 2015 02:06:58 +0900 (JST)
Subject: [ruby-changes:40478] ngoto:r52559 (trunk): * pack.c (pack_unpack, AVOID_CC_BUG): Very ugly workaround for

ngoto	2015-11-14 02:06:43 +0900 (Sat, 14 Nov 2015)

  New Revision: 52559

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52559

  Log:
    * pack.c (pack_unpack, AVOID_CC_BUG): Very ugly workaround for
      optimization bug of Oracle Solaris Studio 12.4 on Solaris
      with -xO4 optimization option. [Bug #11684]

  Modified files:
    trunk/ChangeLog
    trunk/pack.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52558)
+++ ChangeLog	(revision 52559)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Nov 14 01:53:52 2015  Naohisa Goto  <ngotogenome@g...>
+
+	* pack.c (pack_unpack, AVOID_CC_BUG): Very ugly workaround for
+	  optimization bug of Oracle Solaris Studio 12.4 on Solaris
+	  with -xO4 optimization option. [Bug #11684]
+
 Fri Nov 13 23:00:23 2015  Hiroshi Shirosaki  <h.shirosaki@g...>
 
 	* configure.in: unset LD_PRELOAD on mingw. msys2 child processes
Index: pack.c
===================================================================
--- pack.c	(revision 52558)
+++ pack.c	(revision 52559)
@@ -1100,6 +1100,15 @@ hex2num(char c) https://github.com/ruby/ruby/blob/trunk/pack.c#L1100
 	rb_ary_store(ary, RARRAY_LEN(ary)+tmp_len-1, Qnil); \
 } while (0)
 
+/* Workaround for Oracle Solaris Studio 12.4 C compiler optimization bug
+ * with "-xO4" optimization option.
+ */
+#if defined(__SUNPRO_C) && __SUNPRO_C == 0x5130
+# define AVOID_CC_BUG volatile
+#else
+# define AVOID_CC_BUG
+#endif
+
 static VALUE
 infected_str_new(const char *ptr, long len, VALUE str)
 {
@@ -1231,7 +1240,8 @@ pack_unpack(VALUE str, VALUE fmt) https://github.com/ruby/ruby/blob/trunk/pack.c#L1240
     char *p, *pend;
     VALUE ary;
     char type;
-    long len, tmp_len;
+    long len;
+    AVOID_CC_BUG long tmp_len;
     int star;
 #ifdef NATINT_PACK
     int natint;			/* native integer */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]