[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.

From-SVN: r270388
This commit is contained in:
Alexandre Oliva 2019-04-16 12:44:46 +00:00 committed by Alexandre Oliva
parent b9bc3b128c
commit 1ce6a0f5b0
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-04-16 Alexandre Oliva <aoliva@redhat.com>
PR rtl-optimization/86438
* gcc.dg/torture/pr86438.c: Split up too-wide shift.
2019-04-16 Jakub Jelinek <jakub@redhat.com>
PR target/90096

View File

@ -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;
}