+2012-09-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2012-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/54455
+ * sel-sched-ir.c (maybe_tidy_empty_bb): Give up if previous fallthru
+ bb ends up with asm goto referencing bb's label.
+
2012-09-07 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Backport from mainline.
/* Instruction scheduling pass. Selective scheduler and pipeliner.
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
FOR_EACH_EDGE (e, ei, bb->preds)
if (e->flags & EDGE_COMPLEX)
return false;
+ else if (e->flags & EDGE_FALLTHRU)
+ {
+ rtx note;
+ /* If prev bb ends with asm goto, see if any of the
+ ASM_OPERANDS_LABELs don't point to the fallthru
+ label. Do not attempt to redirect it in that case. */
+ if (JUMP_P (BB_END (e->src))
+ && (note = extract_asm_operands (PATTERN (BB_END (e->src)))))
+ {
+ int i, n = ASM_OPERANDS_LABEL_LENGTH (note);
+
+ for (i = 0; i < n; ++i)
+ if (XEXP (ASM_OPERANDS_LABEL (note, i), 0) == BB_HEAD (bb))
+ return false;
+ }
+ }
free_data_sets (bb);
+2012-09-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2012-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/54455
+ * gcc.dg/54455.c: New test.
+
2012-09-06 Andrew Pinski <apinski@cavium.com>
PR tree-opt/54494
--- /dev/null
+/* PR rtl-optimization/54455 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fschedule-insns -fselective-scheduling --param max-sched-extend-regions-iters=2" } */
+
+extern void fn1 (void), fn2 (void);
+
+static inline __attribute__((always_inline)) int
+foo (int *x, long y)
+{
+ asm goto ("" : : "r" (x), "r" (y) : "memory" : lab);
+ return 0;
+lab:
+ return 1;
+}
+
+void
+bar (int *x)
+{
+ if (foo (x, 23))
+ fn1 ();
+ else
+ fn2 ();
+
+ foo (x, 2);
+}