* tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / badshift.c
blob39d123b134fdeb2d6482445357b4c066f5d98554
1 /* PR rtl-optimization/20532 */
3 /* { dg-do run } */
4 /* { dg-options "" } */
5 /* { dg-options "-march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
7 /* We used to optimize the DImode shift-by-32 to zero because in combine
8 we turned:
10 (v << 31) + (v << 31)
12 into:
14 (v * (((HOST_WIDE_INT)1 << 31) + ((HOST_WIDE_INT)1 << 31)))
16 With a 32-bit HOST_WIDE_INT, the coefficient overflowed to zero. */
18 unsigned long long int badshift(unsigned long long int v)
20 return v << 31 << 1;
23 extern void abort ();
25 int main() {
26 if (badshift (1) == 0)
27 abort ();
28 return 0;