From: aoliva Date: Tue, 16 Apr 2019 12:44:46 +0000 (+0000) Subject: [PR86438] avoid too-long shift in test X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgcc.git;a=commitdiff_plain;h=2659c6e18e9df657aeb4ce255709c25761c70c5e [PR86438] avoid too-long shift in test The test fell back to long long and long when __int128 is not available, but it assumed sizeof(long) < sizeof(long long) because of a shift count that would be out of range for a long long if their widths are the same. Fixed by splitting it up into two shifts. for gcc/testsuite/ChangeLog PR rtl-optimization/86438 * gcc.dg/torture/pr86438.c: Split up too-wide shift. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270388 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index decbf085c4c1..7dc4f7411b6b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-04-16 Alexandre Oliva + + PR rtl-optimization/86438 + * gcc.dg/torture/pr86438.c: Split up too-wide shift. + 2019-04-16 Jakub Jelinek PR target/90096 diff --git a/gcc/testsuite/gcc.dg/torture/pr86438.c b/gcc/testsuite/gcc.dg/torture/pr86438.c index 3e95515ae6a6..5f8b463f7572 100644 --- a/gcc/testsuite/gcc.dg/torture/pr86438.c +++ b/gcc/testsuite/gcc.dg/torture/pr86438.c @@ -24,6 +24,6 @@ main (void) u64 d = (g ? 5 : 4); u32 f = __builtin_sub_overflow_p (d, (u128) d, (u64) 0); u128 x = g + f + d; - check (x >> (sizeof (u64) * __CHAR_BIT__), x); + check ((x >> 1) >> (sizeof (u64) * __CHAR_BIT__ - 1), x); return 0; }