diff options
-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; |