* 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:
parent
4e4649e13c
commit
1d5431374d
@ -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>
|
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.
|
* 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) &&
|
if (FIXNUM_2_P(recv, obj) &&
|
||||||
BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
|
BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
|
||||||
long a, b, c;
|
long a, b;
|
||||||
|
|
||||||
a = FIX2LONG(recv);
|
a = FIX2LONG(recv);
|
||||||
if (a == 0) {
|
if (a == 0) {
|
||||||
@ -1462,7 +1462,7 @@ opt_mult
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
b = FIX2LONG(obj);
|
b = FIX2LONG(obj);
|
||||||
c = a * b;
|
volatile long c = a * b;
|
||||||
|
|
||||||
if (FIXABLE(c) && c / a == b) {
|
if (FIXABLE(c) && c / a == b) {
|
||||||
val = LONG2FIX(c);
|
val = LONG2FIX(c);
|
||||||
|
@ -2386,7 +2386,7 @@ fix_mul(VALUE x, VALUE y)
|
|||||||
#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
|
#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
|
||||||
LONG_LONG d;
|
LONG_LONG d;
|
||||||
#else
|
#else
|
||||||
long c;
|
volatile long c;
|
||||||
VALUE r;
|
VALUE r;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ inline static VALUE
|
|||||||
f_imul(long a, long b)
|
f_imul(long a, long b)
|
||||||
{
|
{
|
||||||
VALUE r;
|
VALUE r;
|
||||||
long c;
|
volatile long c;
|
||||||
|
|
||||||
if (a == 0 || b == 0)
|
if (a == 0 || b == 0)
|
||||||
return ZERO;
|
return ZERO;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user