summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-13 17:06:43 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-13 17:06:43 +0000
commit238c6c5b89179d46e2e4ede21803c4cd55b9a767 (patch)
tree897a8351aae4bd3272311598ddf1361f07838596
parentf2b760e3360bcbbf942dd87daac21643c2aa81c7 (diff)
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--pack.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ee8ce90655..3b6bd48e51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Nov 14 01:53:52 2015 Naohisa Goto <ngotogenome@gmail.com>
+
+ * 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@gmail.com>
* configure.in: unset LD_PRELOAD on mingw. msys2 child processes
diff --git a/pack.c b/pack.c
index 1ca98bcee6..f47423a2b6 100644
--- a/pack.c
+++ b/pack.c
@@ -1100,6 +1100,15 @@ hex2num(char c)
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)
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 */