[PATCH] Allow DCE of const or pure calls

Jakub Jelinek jakub@redhat.com
Fri Nov 2 20:06:00 GMT 2007


Hi!

This has been discussed recently, but I've posted it together with other
hacks which weren't intended for 4.3.  So here is the patch again alone,
bootstrapped/regtested on x86_64-linux (and will regtest it on ia64-linux
tonight as well).

Ok for trunk?

2007-11-02  Jakub Jelinek  <jakub@redhat.com>

	* dce.c (deletable_insn_p): Make const or pure calls deletable.

--- gcc/dce.c.jj	2007-10-28 19:34:17.000000000 +0100
+++ gcc/dce.c	2007-11-02 18:36:14.000000000 +0100
@@ -99,7 +99,8 @@ deletable_insn_p (rtx insn, bool fast)
   rtx body, x;
   int i;
 
-  if (!NONJUMP_INSN_P (insn))
+  if (!NONJUMP_INSN_P (insn)
+      && (!CALL_P (insn) || !CONST_OR_PURE_CALL_P (insn)))
     return false;
 
   body = PATTERN (insn);

	Jakub



More information about the Gcc-patches mailing list