1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-early-inlining -fdump-ipa-cp -fdump-tree-optimized" } */
3 /* { dg-skip-if "No alignment restrictions" { { ! natural_alignment_32 } && { ! natural_alignment_64 } } } */
4
5 #include <stdint.h>
6
7 extern int fail_the_test(void *);
8 extern int pass_the_test(void *);
9 extern int diversion (void *);
10
11 static int __attribute__((noinline))
12 foo (void *p)
13 {
14 uintptr_t a = (uintptr_t) p;
15
16 if (a % 4)
17 return fail_the_test (p);
18 else
19 return pass_the_test (p);
20 }
21
22 int
23 bar (void)
24 {
25 double buf[8] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
26 return foo (&buf);
27 }
28
29
30 /* { dg-final { scan-ipa-dump "Adjusting align" "cp" } } */
31 /* { dg-final { scan-tree-dump-not "fail_the_test" "optimized" } } */