diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-30 06:53:21 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-30 06:53:21 +0000 |
commit | 1d5431374d286c5ce7f8bfc6033663a0fc051eec (patch) | |
tree | f7648e9b23df5d7b0a375b7eae1b687d6fc521db | |
parent | 4e4649e13cd4175aab75a0edc2fc5b082cf735d1 (diff) |
* insns.def (opt_mult): as r31805, volatile it.
Without this, clang -O fails calculation.
* numeric.c (fix_mul): ditto.
* rational.c (f_imul): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | insns.def | 4 | ||||
-rw-r--r-- | numeric.c | 2 | ||||
-rw-r--r-- | rational.c | 2 |
4 files changed, 13 insertions, 4 deletions
@@ -1,3 +1,12 @@ +Mon May 30 15:44:16 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * insns.def (opt_mult): as r31805, volatile it. + Without this, clang -O fails calculation. + + * numeric.c (fix_mul): ditto. + + * rational.c (f_imul): ditto. + Mon May 30 10:26:51 2011 NARUSE, Yui <naruse@ruby-lang.org> * numeric.c (int_pow): make sure to assign the result of x * z. @@ -1454,7 +1454,7 @@ opt_mult { if (FIXNUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED_P(BOP_MULT)) { - long a, b, c; + long a, b; a = FIX2LONG(recv); if (a == 0) { @@ -1462,7 +1462,7 @@ opt_mult } else { b = FIX2LONG(obj); - c = a * b; + volatile long c = a * b; if (FIXABLE(c) && c / a == b) { val = LONG2FIX(c); @@ -2386,7 +2386,7 @@ fix_mul(VALUE x, VALUE y) #if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG LONG_LONG d; #else - long c; + volatile long c; VALUE r; #endif diff --git a/rational.c b/rational.c index 00b4fa74c3..fa03062c06 100644 --- a/rational.c +++ b/rational.c @@ -604,7 +604,7 @@ inline static VALUE f_imul(long a, long b) { VALUE r; - long c; + volatile long c; if (a == 0 || b == 0) return ZERO; |