This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH COMMITTED: Discard emit_no_conflict_block clobber if register is decomposed
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 07 Aug 2007 09:48:55 -0700
- Subject: PATCH COMMITTED: Discard emit_no_conflict_block clobber if register is decomposed
The function emit_no_conflict_block produces a clobber before the no
conflict sequence. If lower-subreg decides that it can decompose the
target register, that clobber is unnecessary and in some cases
actually harmful. This patch removes the clobber.
Bootstrapped and tested on i686-pc-linux-gnu. Committed.
Ian
2007-08-07 Ian Lance Taylor <iant@google.com>
* lower-subreg.c (resolve_clobber): If the clobber has a LIBCALL
note, just delete the insn.
Index: lower-subreg.c
===================================================================
--- lower-subreg.c (revision 127272)
+++ lower-subreg.c (working copy)
@@ -906,6 +906,15 @@ resolve_clobber (rtx pat, rtx insn)
if (!resolve_reg_p (reg) && !resolve_subreg_p (reg))
return false;
+ /* If this clobber has a REG_LIBCALL note, then it is the initial
+ clobber added by emit_no_conflict_block. We were able to
+ decompose the register, so we no longer need the clobber. */
+ if (find_reg_note (insn, REG_LIBCALL, NULL_RTX) != NULL_RTX)
+ {
+ delete_insn (insn);
+ return true;
+ }
+
orig_mode = GET_MODE (reg);
words = GET_MODE_SIZE (orig_mode);
words = (words + UNITS_PER_WORD - 1) / UNITS_PER_WORD;