diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-09-08 11:25:47 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-09-08 11:25:47 +0200 |
commit | 1098d3a5510e41a94ce96feaa087f608112ea01b (patch) | |
tree | 46fd118f8f43c998742ad489596528e4cc25da80 /gcc/sched-rgn.c | |
parent | c673a2c7b495c12e5d332838494523f5c62c85da (diff) | |
download | gcc-1098d3a5510e41a94ce96feaa087f608112ea01b.zip gcc-1098d3a5510e41a94ce96feaa087f608112ea01b.tar.gz gcc-1098d3a5510e41a94ce96feaa087f608112ea01b.tar.bz2 |
re PR rtl-optimization/41239 (Scheduler reorders division by zero before a call that might not return)
PR rtl-optimization/41239
* sched-int.h (struct deps): Add last_function_call_may_noreturn field.
* sched-rgn.c (deps_join): Join also last_function_call_may_noreturn
lists.
* sched-deps.c (sched_analyze_insn): Prevent moving trapping insns
across calls, as the calls might not always return normally.
(call_may_noreturn_p): New function.
(deps_analyze_insn): Update last_function_call_may_noreturn list.
(init_deps): Initialize it.
(remove_from_deps): Also remove calls from
last_function_call_may_noreturn list.
* gcc.c-torture/execute/pr41239.c: New test.
From-SVN: r151500
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r-- | gcc/sched-rgn.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index ff559ad..de2dd0a 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -2645,6 +2645,11 @@ deps_join (struct deps *succ_deps, struct deps *pred_deps) = concat_INSN_LIST (pred_deps->last_function_call, succ_deps->last_function_call); + /* last_function_call_may_noreturn is inherited by successor. */ + succ_deps->last_function_call_may_noreturn + = concat_INSN_LIST (pred_deps->last_function_call_may_noreturn, + succ_deps->last_function_call_may_noreturn); + /* sched_before_next_call is inherited by successor. */ succ_deps->sched_before_next_call = concat_INSN_LIST (pred_deps->sched_before_next_call, |