Merge from trunk @ 138209
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr21658.c
blobd7b72f9f75416b68e705cdf197cde96aab6a9c18
1 /* PR tree-optimization/21658
2 CCP did not propagate an ADDR_EXPR far enough, preventing the "if"
3 statement below from being folded. */
5 /* { dg-do compile } */
6 /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-ccp-details" } */
8 void link_error (void);
10 void
11 f (void)
13 int a[10];
14 int *p = &a[5];
15 int *q = p - 1;
16 if (q != &a[4])
17 link_error ();
20 /* { dg-final { scan-tree-dump-times "Folded into: if " 1 "ccp1"} } */
21 /* { dg-final { cleanup-tree-dump "ccp\[1-2\]" } } */