diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-11-10 16:36:48 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-11-10 16:36:48 +0100 |
commit | 03989f55955ddb1f82ce79a7c2251039d0ba5d0e (patch) | |
tree | 3c906560b2c9e0caabf7c866135d739cfc9868d4 /gcc/testsuite | |
parent | 4da80bfb5d2e188674abdf5461876108e77ab881 (diff) | |
download | gcc-03989f55955ddb1f82ce79a7c2251039d0ba5d0e.zip gcc-03989f55955ddb1f82ce79a7c2251039d0ba5d0e.tar.gz gcc-03989f55955ddb1f82ce79a7c2251039d0ba5d0e.tar.bz2 |
re PR rtl-optimization/51023 (likely integer wrong code bug)
PR rtl-optimization/51023
* combine.c (simplify_comparison) <case SIGN_EXTEND>: Don't use
val_signbit_known_clear_p for signed comparison narrowing
optimization. Don't check for non-VOIDmode, use
HWI_COMPUTABLE_MODE_P macro.
<case ZERO_EXTEND>: Don't check for non-VOIDmode.
Optimize even when const_op is equal to GET_MODE_MASK (mode),
don't optimize if const_op is negative.
* gcc.c-torture/execute/pr51023.c: New test.
From-SVN: r181257
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr51023.c | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ecfcdbe..ffa8b57 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-10 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/51023 + * gcc.c-torture/execute/pr51023.c: New test. + 2011-11-10 Richard Guenther <rguenther@suse.de> PR tree-optimization/51042 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51023.c b/gcc/testsuite/gcc.c-torture/execute/pr51023.c new file mode 100644 index 0000000..34252ea --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr51023.c @@ -0,0 +1,18 @@ +/* PR rtl-optimization/51023 */ + +extern void abort (void); + +short int +foo (long int x) +{ + return x; +} + +int +main () +{ + long int a = 0x4272AL; + if (foo (a) == a) + abort (); + return 0; +} |