1 /* { dg-do compile } */
2 /* { dg-options "-g -mframe-header-opt -mbranch-likely" } */
3 
4 /* GCC was generating an ICE with the above options and -Os because
5    it was putting the save of $31 in two annulled delay slots but
6    there was only one restore since only one of the two saves could be
7    executed.  This was correct code but it confused dwarf2cfi and
8    caused it to ICE when using the -g option.  */
9 
10 
11 enum demangle_component_type
12 {
13 	DEMANGLE_COMPONENT_TRINARY_ARG2,
14 };
15 struct demangle_component
16 {
17   enum demangle_component_type type;
18 };
19 struct d_info
20 {
21   int next_comp;
22   int num_comps;
23 };
d_make_empty(struct d_info * di)24 struct demangle_component * d_make_empty (struct d_info *di)
25 {
26   if (di->next_comp >= di->num_comps) return ((void *)0);
27   ++di->next_comp;
28 }
d_make_comp(struct d_info * di,enum demangle_component_type type,struct demangle_component * left)29 struct demangle_component *d_make_comp (
30 	struct d_info *di,
31 	enum demangle_component_type type,
32 	struct demangle_component *left)
33 {
34   struct demangle_component *p;
35   switch (type)
36     {
37     case DEMANGLE_COMPONENT_TRINARY_ARG2:
38       if (left == ((void *)0)) return ((void *)0);
39     }
40   p = d_make_empty (di);
41   p->type = type;
42 }
43