summaryrefslogtreecommitdiff
path: root/gcc/sched-deps.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2007-04-19 13:19:16 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-04-19 11:19:16 +0000
commitd47a8b8331c719df4f7c44af84eec7a63092a440 (patch)
tree7a67687eb802bd0acdf8b565692414e4370ea6b1 /gcc/sched-deps.c
parenta777d6e96715af95b710dc3fbd2f7ef3b5d7a767 (diff)
downloadgcc-d47a8b8331c719df4f7c44af84eec7a63092a440.tar.gz
re PR rtl-optimization/29841 (ICE with scheduling and __builtin_trap)
PR rtl-optimization/29841 * cfgbuild.c (control_flow_insn_p): Return TRUE for unconditional trap instructions. * sched-deps.c (sched_analyze_insn): Prevent all non-jump instructions that may cause control flow transfer from being moved. From-SVN: r123970
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r--gcc/sched-deps.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index c3dc5793d23..5a6a30a63c7 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -1598,8 +1598,12 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn)
/* If this instruction can throw an exception, then moving it changes
where block boundaries fall. This is mighty confusing elsewhere.
- Therefore, prevent such an instruction from being moved. */
- if (can_throw_internal (insn))
+ Therefore, prevent such an instruction from being moved. Same for
+ non-jump instructions that define block boundaries.
+ ??? Unclear whether this is still necessary in EBB mode. If not,
+ add_branch_dependences should be adjusted for RGN mode instead. */
+ if (((CALL_P (insn) || JUMP_P (insn)) && can_throw_internal (insn))
+ || (NONJUMP_INSN_P (insn) && control_flow_insn_p (insn)))
reg_pending_barrier = MOVE_BARRIER;
/* Add dependencies if a scheduling barrier was found. */