summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--insns.def4
-rw-r--r--numeric.c2
-rw-r--r--rational.c2
4 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 73d38ac676..cf9e8a9a46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/insns.def b/insns.def
index 72b0f27cc6..5cde2a632b 100644
--- a/insns.def
+++ b/insns.def
@@ -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);
diff --git a/numeric.c b/numeric.c
index 1b80a2b6e0..0c419e1be7 100644
--- a/numeric.c
+++ b/numeric.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;