This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix DCE REG_LIBCALL note moving from noop move insns (PR rtl-optimization/33644)
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: Eric Botcazou <ebotcazou at libertysurf dot fr>, Kenneth dot Zadeck at naturalbridge dot com, gcc-patches at gcc dot gnu dot org, Daniel Berlin <dberlin at dberlin dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 18 Oct 2007 09:28:22 +0200
- Subject: Re: [PATCH] Fix DCE REG_LIBCALL note moving from noop move insns (PR rtl-optimization/33644)
- References: <571f6b510710151106y62072dcbsd0ceba0579ced640@mail.gmail.com>
1) the old RTL loop optimizer could use them to move loop invariant libcalls.
Since the old RTL loop optimizer is no more, this is no longer a
reason to keep the old-style libcall notes.
2) the old DCE in flow.c could remove entire libcall sequences if the
libcall result was dead.
The new DCE uses REG_LIBCALL_ID notes, so again the reason to have
REG_LIBCALL and REG_RETVAL is gone here.
3) The pre-regalloc scheduling pass used to move libcall blocks as a whole.
4) When -ftrapv is in effect, libcalls are "necessary" so that the
results of an operation can be propagated without making the call to the
libgcc functions dead. The attached patch causes a failure in pr30286.c.
Paolo
diff --git a/ipa-branch:gcc/optabs.c b/ise:gcc/optabs.c
index 9a7731d..dbff52b 100644
--- a/ipa-branch:gcc/optabs.c
+++ b/ise:gcc/optabs.c
@@ -3425,7 +3373,13 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv)
else
first = NEXT_INSN (prev);
+#if 0
+ /* Encapsulate the block so it gets manipulated as a unit. */
maybe_encapsulate_block (first, last, equiv);
+#else
+ (void) first;
+ (void) last;
+#endif
return last;
}
@@ -3579,7 +3533,13 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
else
first = NEXT_INSN (prev);
+#if 0
+ /* Encapsulate the block so it gets manipulated as a unit. */
maybe_encapsulate_block (first, last, equiv);
+#else
+ (void) first;
+ (void) last;
+#endif
}
/* Nonzero if we can perform a comparison of mode MODE straightforwardly.