diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-10-14 10:34:11 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-10-14 10:34:11 +0200 |
commit | 5c20e429775e6b72b42a3c7b3c3be77f535d4bb6 (patch) | |
tree | 637e59c2b47a60b2a46615698414db955b33a82d /gcc | |
parent | a0bf6cf784e56448d81d144f83eaaf90a9fe83b7 (diff) | |
download | gcc-5c20e429775e6b72b42a3c7b3c3be77f535d4bb6.zip gcc-5c20e429775e6b72b42a3c7b3c3be77f535d4bb6.tar.gz gcc-5c20e429775e6b72b42a3c7b3c3be77f535d4bb6.tar.bz2 |
re PR rtl-optimization/81423 (Wrong code at -O2)
PR rtl-optimization/81423
* gcc.c-torture/execute/pr81423.c (foo): Add missing cast. Change L
suffixes to LL.
(main): Punt if either long long isn't 64-bit or int isn't 32-bit.
From-SVN: r253749
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr81423.c | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6419c7..c48f8a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-10-14 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/81423 + * gcc.c-torture/execute/pr81423.c (foo): Add missing cast. Change L + suffixes to LL. + (main): Punt if either long long isn't 64-bit or int isn't 32-bit. + 2017-10-13 Jakub Jelinek <jakub@redhat.com> PR sanitizer/82353 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr81423.c b/gcc/testsuite/gcc.c-torture/execute/pr81423.c index 731aa8f..be7413b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr81423.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr81423.c @@ -1,3 +1,5 @@ +/* PR rtl-optimization/81423 */ + extern void abort (void); unsigned long long int ll = 0; @@ -10,11 +12,11 @@ foo (void) { ll = -5597998501375493990LL; - ll = (5677365550390624949L - ll) - (ull1 > 0); + ll = (unsigned int) (5677365550390624949LL - ll) - (ull1 > 0); unsigned long long int ull3; ull3 = (unsigned int) - (2067854353L << - (((ll + -2129105131L) ^ 10280750144413668236ULL) - + (2067854353LL << + (((ll + -2129105131LL) ^ 10280750144413668236ULL) - 10280750143997242009ULL)) >> ((2873442921854271231ULL | ull2) - 12098357307243495419ULL); @@ -24,9 +26,10 @@ foo (void) int main (void) { - /* We need a long long of exactly 64 bits for this test. */ - ll--; - if (ll != 0xffffffffffffffffULL) + /* We need a long long of exactly 64 bits and int of exactly 32 bits + for this test. */ + if (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ != 64 + || __SIZEOF_INT__ * __CHAR_BIT__ != 32) return 0; ull3 = foo (); |