+2020-01-23 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR rtl-optimization/93124
+ * auto-inc-dec.c (merge_in_block): Don't add auto inc/decs to
+ bare USE and CLOBBER insns.
+
2020-01-22 Andrew Pinski <apinski@marvell.com>
* config/arc/arc.c (output_short_suffix): Check insn for nullness.
else
{
insn_is_add_or_inc = false;
- mem_insn.insn = insn;
- if (find_mem (&PATTERN (insn)))
- success_in_block++;
+ /* We can't use auto inc/dec for bare USEs and CLOBBERs,
+ since they aren't supposed to generate any code. */
+ rtx_code code = GET_CODE (PATTERN (insn));
+ if (code != USE && code != CLOBBER)
+ {
+ mem_insn.insn = insn;
+ if (find_mem (&PATTERN (insn)))
+ success_in_block++;
+ }
}
/* If the inc insn was merged with a mem, the inc insn is gone
+2020-01-23 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.dg/torture/pr93124.c: New test.
+
2020-01-22 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93382
--- /dev/null
+/* { dg-additional-options "-fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
+
+int x;
+
+void fn2 ();
+void fn3 ();
+void fn4 ();
+void fn5 ();
+void fn6 ();
+
+void
+fn1 (void)
+{
+ int n;
+ for (n = 0;; ++n) {
+ {
+ struct { char a[n]; } s;
+ fn2 (s);
+ }
+ struct { unsigned a[x]; } s;
+ int i, b;
+ for (i = 0; i < n; ++i)
+ ;
+ fn2 (s);
+ {
+ struct { char a[n]; } s;
+ int i;
+ for (i = 0; i < n; ++i)
+ s.a[i] = i;
+ fn3 (s, s);
+ }
+ fn4 ();
+ {
+ struct { unsigned a[n]; } s;
+ fn5 (s);
+ }
+ {
+ struct { char a[b]; } s;
+ for (; i < n;)
+ s.a[i] = i;
+ fn6 (s);
+ }
+ }
+}