1 /* { dg-do compile } */
2 /* Disable FRE1 because that for the sake of __builtin_object_size
3 will not consider the equality but still valueize 'i', defeating
4 the purpose of the check. */
5 /* { dg-options "-O -fdump-tree-fre3 -fdisable-tree-fre1" } */
7 struct S
{ int a
[4]; };
12 char *q
= (char *)p
+ 4;
14 int *r
= &((struct S
*)p
)->a
[i
];
15 return q
== (char *)r
;
20 int *r
= &((struct S
*)p
)->a
[i
];
21 char *q
= (char *)p
+ 4;
22 return q
== (char *)r
;
25 /* Verify FRE can handle valueizing &p->a[i] and value-numbering it
26 equal to a POINTER_PLUS_EXPR. */
27 /* { dg-final { scan-tree-dump-times "return 1;" 2 "fre3" } } */