2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr69172.c
blob908d5a6e4757dbad9defc26d90b490b93cb22e8d
1 /* PR tree-optimization/69172 - ICE in make_ssa_name_fn,
2 at tree-ssanames.c:266 */
3 /* { dg-do compile } */
4 /* { dg-options "-O2" } */
6 int a;
8 void *
9 f1 (void)
11 int *b = &a, *c = &a;
12 return __builtin___mempcpy_chk (b, c, sizeof (int), 0);
15 void *
16 f2 (void)
18 int *b = &a;
19 return __builtin___mempcpy_chk (b, b, sizeof (int), 0);
22 void *
23 f3 (void)
25 return __builtin___mempcpy_chk (&a, &a, sizeof (int), 0);
28 void *
29 f4 (int x)
31 int *b = &a, *c = &a;
32 return __builtin___mempcpy_chk (b, c, x, 0);
35 void *
36 f5 (int x)
38 int *b = &a;
39 return __builtin___mempcpy_chk (b, b, x, 0);
42 void *
43 f6 (int x)
45 return __builtin___mempcpy_chk (&a, &a, x, 0);
48 /* The calls above violate strict aliasing. Eliminate the -Wrestrict
49 warnings they trigger.
50 { dg-prune-output "\\\[-Wrestrict]" } */