1 /* { dg-do compile } */
2 /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */
3 /* { dg-options "-mthumb -O2 -mfloat-abi=soft -w" } */
4 /* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
5 
6 struct ST {
7   char *buffer;
8   int used;
9 };
10 
11 struct ST *h;
12 
13 enum { no_op, duplicate, pop_failure_jump, dummy_failure_jump };
14 
15 typedef struct {
16   unsigned pointer;
17 } byte_fail_stack_elt_t;
18 
19 typedef struct { unsigned avail; } byte_fail_stack_type;
20 
21 typedef union {
22   byte_fail_stack_elt_t word;
23   struct {
24     unsigned match_null_string_p : 2;
25     unsigned is_active : 1;
26     unsigned ever_matched_something : 1;
27   } bits;
28 } byte_register_info_type;
29 
30 static int a;
31 int b = 0;
32 int c, e, f;
33 int *d, *g;
34 
35 int
byte_re_match_2_internal_size2(const int p2,int p3,const int p4)36 byte_re_match_2_internal_size2(const int p2, int p3, const int p4) {
37   int i, p;
38   char *j;
39   char k, l, m, n = h;
40   byte_fail_stack_type o;
41   byte_fail_stack_elt_t *q;
42   unsigned int s = (unsigned int)h;
43   long t, u;
44   char **v, *w, **x, **y, **t1;
45   byte_register_info_type *z, *t2 = __builtin_alloca(s);
46   x = __builtin_alloca(s);
47   y = __builtin_alloca(s);
48   z = __builtin_alloca(sizeof(byte_register_info_type));
49   k = p4 + byte_re_match_2_internal_size2;
50   if (p3)
51     f = p4;
52   for (;;) {
53     if (h == h->used) {
54       g = f;
55       if (o.avail) {
56         b = 1;
57         for (; i < s; i++)
58           t1[i] = w;
59         goto fail;
60       }
61       e = 30 > s;
62       d = p4;
63       d[s] = 1;
64       return;
65     }
66     switch (*h->buffer++) {
67     case no_op:
68       while (m && n ?: *g)
69         ;
70       y[*h->buffer] = z[*h->buffer].bits.match_null_string_p ? w == &a ?: w : w;
71       w = g;
72       if (t) {
73         char r = h;
74         while (r && z[r].bits.is_active)
75           r--;
76         if (r == 0)
77           ;
78         else
79           u = r;
80       }
81       switch (*j++)
82       case dummy_failure_jump:
83       i = j;
84       if (i)
85         if (z[*h->buffer].bits.ever_matched_something) {
86           unsigned r;
87           z[*h->buffer].bits.ever_matched_something = r = *h->buffer;
88           for (; r + *(h->buffer + 1); r++) {
89             v = x[r];
90             w[r] = y[r];
91           }
92         }
93       break;
94     case duplicate: {
95       char *t3 = p2 + p3;
96       if (t3)
97         break;
98     }
99       if ((p3 ?: p4) == k)
100         goto fail;
101     case pop_failure_jump:
102       for (; c; c--)
103         t2[c].word = q[o.avail];
104       char t4;
105       q = t4 = __builtin_allocamemcpy(t4 ?: (p <<= 1));
106     }
107     continue;
108   fail : {
109     unsigned t5;
110     t = q;
111     t5 = u;
112     for (; t5 >= t; t5--)
113       v[t5] = q[--o.avail].pointer;
114     switch (*h->buffer)
115     case pop_failure_jump:
116     goto fail;
117   }
118     m = &l;
119   }
120 }
121