PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / pr20017.c
blob47c048fdc62e905e95b32ab9161f3860da3d9362
1 /* PR rtl-optimization/20017
3 After CSE/GCSE folds a switch statement to an unconditional jump,
4 cfg_cleanup did not remove a dead jump table, confusing the CFG
5 layout code later on. */
7 /* { dg-do compile } */
8 /* { dg-options "-O1" } */
9 /* { dg-options "-O1 -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
11 int
12 foo (int *buf, int *p)
14 int result;
15 const int *tmp;
17 if (*buf)
18 return 1;
20 result = 2;
21 *buf = 2;
22 tmp = buf;
23 switch (*tmp)
25 case 3:
26 case 4:
27 case 6:
28 case 14:
29 return 1;
31 case 0:
32 result = *p;
34 /* Fall through. */
35 default:
36 if (result)
37 return 1;
40 return 0;