libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr100834.c
blob4bd2691aca7788e1bea067ece135a0d7f65197b0
1 /* PR tree-optimization/100834 */
2 /* { dg-do compile { target size32plus } } */
3 /* { dg-options "-O2 -Wall" } */
5 #define PAGE_SIZE 4096
6 #define STACK_SIZE PAGE_SIZE
8 union registers
10 struct
12 unsigned long r15, r14, r13, r12, r11, r10, r9, r8;
13 unsigned long rdi, rsi, rbp, unused, rbx, rdx, rcx, rax;
15 unsigned long by_index[16];
18 struct per_cpu
20 union
22 unsigned char stack[STACK_SIZE];
23 struct
25 unsigned char __fill[STACK_SIZE - sizeof (union registers)];
26 union registers guest_regs;
29 } __attribute__((aligned (PAGE_SIZE)));
31 static inline struct per_cpu *
32 this_cpu_data (void)
34 return (struct per_cpu *) 0xdeadbeef;
37 void
38 foo (void)
40 struct per_cpu *cpu_data = this_cpu_data ();
41 __builtin_memset (&cpu_data->guest_regs, 0, sizeof (cpu_data->guest_regs)); /* { dg-bogus "is out of the bounds" } */