re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-10.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-fab" } */
3
4 /* Check that we fold strlen of equally long strings, and that we do not
5 fail to terminate when there is a nontrivial cycle in the corresponding
6 ssa graph. */
7
8 extern __SIZE_TYPE__ strlen (const char *);
9
10 void foo(int i)
11 {
12 char *s = "abcde";
13
14 if (i)
15 {
16 s = "defgh";
17 goto middle;
18 }
19
20 start:
21
22 bla ();
23
24 middle:
25
26 if (bla ())
27 goto start;
28
29 bar (strlen (s));
30 }
31
32 /* There should be no calls to strlen. */
33 /* { dg-final { scan-tree-dump-times "strlen" 0 "fab"} } */
34 /* { dg-final { cleanup-tree-dump "fab" } } */