expmed.c (emit_store_flag_1): Fix choice of zero vs.
2009-07-11 Paolo Bonzini <bonzini@gnu.org> * expmed.c (emit_store_flag_1): Fix choice of zero vs. sign extension. 2009-07-11 Paolo Bonzini <bonzini@gnu.org> * gcc.c-torture/execute/20090711-1.c: New test. From-SVN: r149509
This commit is contained in:
parent
33cde5161f
commit
e9edda2372
@ -1,3 +1,7 @@
|
||||
2009-07-11 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* expmed.c (emit_store_flag_1): Fix choice of zero vs. sign extension.
|
||||
|
||||
2009-07-10 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* config/mep/mep.c (mep_can_inline_p): Correct logic, and simplify.
|
||||
|
@ -5343,7 +5343,7 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
||||
target = gen_reg_rtx (target_mode);
|
||||
|
||||
convert_move (target, tem,
|
||||
0 == (STORE_FLAG_VALUE
|
||||
0 == ((normalizep ? normalizep : STORE_FLAG_VALUE)
|
||||
& ((HOST_WIDE_INT) 1
|
||||
<< (GET_MODE_BITSIZE (word_mode) -1))));
|
||||
return target;
|
||||
|
@ -1,3 +1,7 @@
|
||||
2009-07-11 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* gcc.c-torture/execute/20090711-1.c: New test.
|
||||
|
||||
2009-07-11 Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
PR testsuite/40699
|
||||
|
21
gcc/testsuite/gcc.c-torture/execute/20090711-1.c
Normal file
21
gcc/testsuite/gcc.c-torture/execute/20090711-1.c
Normal file
@ -0,0 +1,21 @@
|
||||
/* Used to be miscompiled at -O0 due to incorrect choice of sign extension
|
||||
vs. zero extension. __attribute__ ((noinline)) added to try to make it
|
||||
fail at higher optimization levels too. */
|
||||
|
||||
extern void abort (void);
|
||||
|
||||
long long __attribute__ ((noinline))
|
||||
div (long long val)
|
||||
{
|
||||
return val / 32768;
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
long long d1 = -990000000;
|
||||
long long d2 = div(d1);
|
||||
if (d2 != -30212)
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user