diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2009-07-11 08:28:34 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2009-07-11 08:28:34 +0000 |
commit | e9edda2372898f4d180d084fdd27438c832cb893 (patch) | |
tree | c2c59b221188a05f86f030b5329eaabab71f14dd /gcc | |
parent | 33cde5161f2bc0738d24bcafe8ea9a858a63f9f4 (diff) | |
download | gcc-e9edda2372898f4d180d084fdd27438c832cb893.zip gcc-e9edda2372898f4d180d084fdd27438c832cb893.tar.gz gcc-e9edda2372898f4d180d084fdd27438c832cb893.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/expmed.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20090711-1.c | 21 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8cf7745..3e62635 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/expmed.c b/gcc/expmed.c index aa8d02d..c73bf21 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a29bd83..7a477b3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.c-torture/execute/20090711-1.c b/gcc/testsuite/gcc.c-torture/execute/20090711-1.c new file mode 100644 index 0000000..5c3d93a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20090711-1.c @@ -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; +} + |