@@ -2417,7 +2417,11 @@ lra (FILE *f)
/* Assignment of stack slots changes elimination offsets for
some eliminations. So update the offsets here. */
lra_eliminate (false, false);
- lra_constraint_new_regno_start = max_reg_num ();
+ /* After switching off inheritance passe, don't forget reload pseudos
+ after spilling sub-pass to avoid LRA cycling in some complicated
+ cases. */
+ if (lra_inheritance_iter <= LRA_MAX_INHERITANCE_PASSES)
+ lra_constraint_new_regno_start = max_reg_num ();
lra_constraint_new_insn_uid_start = get_max_uid ();
lra_assignment_iter_after_spill = 0;
}
new file mode 100644
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -marm -march=armv6 -std=c99" } */
+
+typedef struct {
+ int i;
+} x264_union32_t;
+typedef struct {
+ int level_idx;
+} trellis_node_t;
+int a, c, d, f, h, i = (int)&c;
+trellis_node_t b[1][1];
+short *e = 0;
+short g;
+void fn1() {
+ int k[64 * 8 * 2];
+ trellis_node_t *l = b[0];
+ for (; i >= d; i--) {
+ if (e[i]) {
+ for (int j = 1; j < 8; j++) {
+ ((x264_union32_t *)&k[a])->i = l[j].level_idx;
+ l[j].level_idx = a;
+ a++;
+ }
+ continue;
+ }
+ for (int j;; j++)
+ ;
+ }
+ int m[6] __attribute__((aligned(16)));
+ for (; h; h++, f++)
+ g = m[h];
+}
new file mode 100644
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv6-m -mthumb -O3 -w" } */
+
+a, b, c, e, g = &e, h, i = 7, l = 1, m, n, o, q = &m, r, s = &r, u, w = 9, x,
+ y = 6, z, t6 = 7, t8, t9 = 1, t11 = 5, t12 = &t8, t13 = 3, t15,
+ t16 = &t15;
+struct {
+ long long f3;
+ char f4
+} p = {3}
+
+ ,
+ t = {4};
+
+struct S1 {
+ long long f0;
+ short f1;
+ long long f2
+} d;
+long long f = 4073709551613, t7 = 8, t14 = 4073709551610;
+j[];
+k = j;
+v = &d;
+*t10 = j;
+struct S1 fn1();
+struct S1 fn2() {
+ signed char t1;
+ struct S1 t2;
+ long t3 = x;
+ short t4 = h;
+ short *t5 = &l;
+ fn1(t2, w, 1, o);
+ if (u) {
+ l = q;
+ t1 = a < b ?: b;
+ z = c >= 2 || t1 << c;
+ }
+ *t5 = t4 &= t3;
+ fn3(y);
+}
+
+fn4() {
+ t6 = t.f3;
+ fn5(k, t7);
+}
+
+struct S1 fn1() {
+ f = 0;
+ for (; i;)
+ ;
+ t11 = 0;
+ t13 = *t10 = t14 || n;
+ t9 = t12;
+ for (; p.f4;)
+ s = t16 <= fn6();
+ if (g)
+ v = 0;
+}