annotate gcc/testsuite/gcc.dg/pr16194.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O" } */
kono
parents:
diff changeset
3 /* { dg-bogus "internal compiler error" "ICE" { target *-*-* } 0 } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 #undef SKIP
kono
parents:
diff changeset
6 #define ASMDECL __asm (REG);
kono
parents:
diff changeset
7 #define CLOBBER_LIST : REG
kono
parents:
diff changeset
8 #define INP_CLOBBER_LIST : CLOBBER_LIST
kono
parents:
diff changeset
9 #if defined (__alpha__)
kono
parents:
diff changeset
10 # define REG "$1"
kono
parents:
diff changeset
11 #elif defined (__CRIS__) || defined (__sh__)
kono
parents:
diff changeset
12 # define REG "r10"
kono
parents:
diff changeset
13 #elif defined (__hppa__)
kono
parents:
diff changeset
14 # define REG "%r10"
kono
parents:
diff changeset
15 #elif defined (__i386__)
kono
parents:
diff changeset
16 # define REG "%eax"
kono
parents:
diff changeset
17 #elif defined (__MMIX__)
kono
parents:
diff changeset
18 # define REG "$8"
kono
parents:
diff changeset
19 #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
kono
parents:
diff changeset
20 || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
kono
parents:
diff changeset
21 # define REG "6"
kono
parents:
diff changeset
22 #elif defined (__x86_64__)
kono
parents:
diff changeset
23 # define REG "rax"
kono
parents:
diff changeset
24 #elif defined (__m68k__)
kono
parents:
diff changeset
25 # define REG "%d0"
kono
parents:
diff changeset
26 #else
kono
parents:
diff changeset
27 /* Make this test harmless for any target not recognized above. */
kono
parents:
diff changeset
28 # define SKIP 1
kono
parents:
diff changeset
29 #endif
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 #ifndef SKIP
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 struct A
kono
parents:
diff changeset
34 {
kono
parents:
diff changeset
35 int a;
kono
parents:
diff changeset
36 };
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 struct B
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 struct A b[3];
kono
parents:
diff changeset
41 };
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 struct C
kono
parents:
diff changeset
44 {
kono
parents:
diff changeset
45 struct B c;
kono
parents:
diff changeset
46 };
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 void bug (void)
kono
parents:
diff changeset
49 {
kono
parents:
diff changeset
50 register char* dst ASMDECL;
kono
parents:
diff changeset
51 __asm__ ("":"=g"(*dst): : REG);
kono
parents:
diff changeset
52 }
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* The tree optimizers currently prevent us from finding an overlap -
kono
parents:
diff changeset
55 we end up using a copy of dst rather than dst.
kono
parents:
diff changeset
56 But at least make sure we don't get an ICE. */
kono
parents:
diff changeset
57 void bug2 (void)
kono
parents:
diff changeset
58 {
kono
parents:
diff changeset
59 register char* dst ASMDECL;
kono
parents:
diff changeset
60 __asm__ ("": :"g"(*dst) CLOBBER_LIST);
kono
parents:
diff changeset
61 }
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 void
kono
parents:
diff changeset
64 foo (void)
kono
parents:
diff changeset
65 {
kono
parents:
diff changeset
66 register struct C *dst ASMDECL;
kono
parents:
diff changeset
67 __asm__ ("" : "=g"(dst->c.b[1].a) INP_CLOBBER_LIST);
kono
parents:
diff changeset
68 }
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 #else
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 int main ()
kono
parents:
diff changeset
73 {
kono
parents:
diff changeset
74 return 0;
kono
parents:
diff changeset
75 }
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 #endif
kono
parents:
diff changeset
78