1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
naruse 2011-05-30 06:53:21 +00:00
parent 4e4649e13c
commit 1d5431374d
4 changed files with 13 additions and 4 deletions

View file

@ -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.

View file

@ -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);

View file

@ -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

View file

@ -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;