* combine.c (try_combine): Set subst_low_luid to i0.
2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.dg/
20100906-1.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163917
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * combine.c (try_combine): Set subst_low_luid to i0.
+
2010-09-06 Richard Guenther <rguenther@suse.de>
* tree.def (MISALIGNED_INDIRECT_REF): Remove.
}
n_occurrences = 0;
- subst_low_luid = DF_INSN_LUID (i1);
+ subst_low_luid = DF_INSN_LUID (i0);
newpat = subst (newpat, i0dest, i0src, 0,
i0_feeds_i1_n && i0dest_in_i0src);
substed_i0 = 1;
+2010-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gcc.dg/20100906-1.c: New testcase.
+
2010-09-06 Jakub Jelinek <jakub@redhat.com>
PR testsuite/45543
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* This testcase got misoptimized by combine due to a wrong setting of
+ subst_low_luid in try_combine. */
+
+enum rtx_code {
+ A, B
+};
+
+void abort (void);
+
+struct rtx_def {
+ __extension__ enum rtx_code code:16;
+};
+typedef struct rtx_def *rtx;
+
+void __attribute__((noinline))
+add_constraint (unsigned char is_a)
+{
+ if (is_a)
+ abort ();
+}
+
+void __attribute__((noinline))
+foo (rtx defn)
+{
+ switch (defn->code)
+ {
+ case A:
+ case B:
+ add_constraint (defn->code == A);
+ break;
+ default:
+ break;
+ }
+}
+
+int
+main ()
+{
+ struct rtx_def r;
+
+ r.code = B;
+
+ foo (&r);
+ return 0;
+}