aboutsummaryrefslogtreecommitdiff
path: root/gcc/dce.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2010-06-09 21:49:44 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-06-09 21:49:44 +0000
commit642d55de0e40c7bf59ab0043aeae756f004488dc (patch)
tree94bae21be77c1e10d071c24ca7c48b99738ab87d /gcc/dce.c
parent70987f6299983c5a764c37827a95f71f831087f0 (diff)
downloadgcc-642d55de0e40c7bf59ab0043aeae756f004488dc.zip
gcc-642d55de0e40c7bf59ab0043aeae756f004488dc.tar.gz
gcc-642d55de0e40c7bf59ab0043aeae756f004488dc.tar.bz2
re PR rtl-optimization/42461 (missed optimization for pure functions)
PR rtl-optimization/42461 * dce.c (deletable_insn_p): Return true for const or pure calls again. * except.c (insn_could_throw_p): Return false if !flag_exceptions. From-SVN: r160507
Diffstat (limited to 'gcc/dce.c')
-rw-r--r--gcc/dce.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/dce.c b/gcc/dce.c
index 38a5b30..ee18b58 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -94,14 +94,6 @@ deletable_insn_p (rtx insn, bool fast, bitmap arg_stores)
rtx body, x;
int i;
- /* Don't delete jumps, notes and the like. */
- if (!NONJUMP_INSN_P (insn))
- return false;
-
- /* Don't delete insns that can throw. */
- if (!insn_nothrow_p (insn))
- return false;
-
if (CALL_P (insn)
/* We cannot delete calls inside of the recursive dce because
this may cause basic blocks to be deleted and this messes up
@@ -116,6 +108,14 @@ deletable_insn_p (rtx insn, bool fast, bitmap arg_stores)
&& !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn)))
return find_call_stack_args (insn, false, fast, arg_stores);
+ /* Don't delete jumps, notes and the like. */
+ if (!NONJUMP_INSN_P (insn))
+ return false;
+
+ /* Don't delete insns that can throw. */
+ if (!insn_nothrow_p (insn))
+ return false;
+
body = PATTERN (insn);
switch (GET_CODE (body))
{