aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/recog.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/pr98439.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 1f43237..abbc49f 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -4532,8 +4532,13 @@ pass_split_before_regstack::gate (function *)
/* If flow2 creates new instructions which need splitting
and scheduling after reload is not done, they might not be
split until final which doesn't allow splitting
- if HAVE_ATTR_length. */
+ if HAVE_ATTR_length. Selective scheduling can result in
+ further instructions that need splitting. */
+#ifdef INSN_SCHEDULING
+ return !enable_split_before_sched2 () || flag_selective_scheduling2;
+#else
return !enable_split_before_sched2 ();
+#endif
#else
return false;
#endif
diff --git a/gcc/testsuite/gcc.target/i386/pr98439.c b/gcc/testsuite/gcc.target/i386/pr98439.c
new file mode 100644
index 0000000..02fc40a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr98439.c
@@ -0,0 +1,12 @@
+/* PR rtl-optimization/98439 */
+/* { dg-do compile } */
+/* { dg-options "-march=nehalem -O2 -fselective-scheduling2 -fno-cprop-registers" } */
+
+int v;
+int bar (int, int, int, int, int, int, int);
+
+int
+foo (void)
+{
+ return bar (0, 0, 0, 0, 0, 0, v > 0 ? v : 0);
+}