aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-02-13 16:08:29 +0100
committerJakub Jelinek <jakub@redhat.com>2021-02-13 16:08:29 +0100
commit05402ca65a6696a8f20a3dbcb18f47ba3bdfa268 (patch)
tree21e3c50b311a119d118cbc9032b206707afb9b1e /gcc/recog.c
parenta3b38b7781622babb5ca68c621367770a65012fa (diff)
downloadgcc-05402ca65a6696a8f20a3dbcb18f47ba3bdfa268.zip
gcc-05402ca65a6696a8f20a3dbcb18f47ba3bdfa268.tar.gz
gcc-05402ca65a6696a8f20a3dbcb18f47ba3bdfa268.tar.bz2
passes: Enable split4 with selective scheduling 2 [PR98439]
As mentioned in the PR, we have 5 split passes (+ splitting during final). split1 is before RA and is unconditional, split2 is after RA and is gated on optimize > 0, split3 is before sched2 and is gated on defined(INSN_SCHEDULING) && optimize > 0 && flag_schedule_insns_after_reload split4 is before regstack and is gated on HAVE_ATTR_length && defined (STACK_REGS) && !gate (split3) split5 is before shorten_branches and is gated on HAVE_ATTR_length && !defined (STACK_REGS) and the splitting during final works only when !HAVE_ATTR_length. STACK_REGS is a macro enabled only on i386/x86_64. The problem with the following testcase is that split3 before sched2 is the last splitting pass for the target/command line options set, but selective scheduling unlike normal scheduling can create new instructions that need to be split, which means we ICE during final as there are insns that require splitting but nothing split them. This patch fixes it by doing split4 also when -fselective-scheduling2 is enabled on x86 and split3 has been run. As that option isn't on by default, it should slow down compilation only for those that enable that option. 2021-02-13 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/98439 * recog.c (pass_split_before_regstack::gate): Enable even when pass_split_before_sched2 is enabled if -fselective-scheduling2 is on. * gcc.target/i386/pr98439.c: New test.
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c7
1 files changed, 6 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