From 1098d3a5510e41a94ce96feaa087f608112ea01b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 8 Sep 2009 11:25:47 +0200 Subject: 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 --- gcc/sched-int.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/sched-int.h') diff --git a/gcc/sched-int.h b/gcc/sched-int.h index de780e5..4d60ece 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -502,6 +502,12 @@ struct deps Used to prevent register lifetimes from expanding unnecessarily. */ rtx last_function_call; + /* A list of the last function calls that may not return normally + we have seen. We use a list to represent last function calls from + multiple predecessor blocks. Used to prevent moving trapping insns + across such calls. */ + rtx last_function_call_may_noreturn; + /* A list of insns which use a pseudo register that does not already cross a call. We create dependencies between each of those insn and the next call insn, to ensure that they won't cross a call after -- cgit v1.1