FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20020529-1.c
blobd1b93c76fdf4d4354aa921fdfbf88af737123c77
1 /* PR target/6838 from cato@df.lth.se.
2 cris-elf got an ICE with -O2: the insn matching
3 (insn 49 48 52 (parallel[
4 (set (mem/s:HI (plus:SI (reg/v/f:SI 0 r0 [24])
5 (const_int 8 [0x8])) [5 <variable>.c+0 S2 A8])
6 (reg:HI 2 r2 [27]))
7 (set (reg/f:SI 2 r2 [31])
8 (plus:SI (reg/v/f:SI 0 r0 [24])
9 (const_int 8 [0x8])))
10 ] ) 24 {*mov_sidehi_mem} (nil)
11 (nil))
12 forced a splitter through the output pattern "#", but there was no
13 matching splitter. */
15 struct xx
17 int a;
18 struct xx *b;
19 short c;
22 int f1 (struct xx *);
23 void f2 (void);
25 int
26 foo (struct xx *p, int b, int c, int d)
28 int a;
30 for (;;)
32 a = f1(p);
33 if (a)
34 return (0);
35 if (b)
36 continue;
37 p->c = d;
38 if (p->a)
39 f2 ();
40 if (c)
41 f2 ();
42 d = p->c;
43 switch (a)
45 case 1:
46 if (p->b)
47 f2 ();
48 if (c)
49 f2 ();
50 default:
51 break;
54 return d;
57 int main (void)
59 struct xx s = {0, &s, 23};
60 if (foo (&s, 0, 0, 0) != 0 || s.a != 0 || s.b != &s || s.c != 0)
61 abort ();
62 exit (0);
65 int
66 f1 (struct xx *p)
68 static int beenhere = 0;
69 if (beenhere++ > 1)
70 abort ();
71 return beenhere > 1;
74 void
75 f2 (void)
77 abort ();