This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Allow DCE of const or pure calls


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]