This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, ARM] Don't copy uncopyable instructions in gcse.c
On Thu, 21 May 2009 16:01:32 +0200
Eric Botcazou <firstname.lastname@example.org> wrote:
> > Tsk me, I assumed it'd default to hook_bool_rtx_false or something.
> > Is it better to change it to do that in fact, or to guard the call?
> > (I guess the latter might be marginally faster.)
> Yes, guarding the call would be simpler.
Tests (cross to ARM Linux with march=armv7-a/mthumb) with this version
look reasonable (though I can't do a before/after regression check for
OK for mainline?
* gcse.c (hash_scan_set): Don't make copies of instructions the
target deems uncopyable.
--- gcc/gcse.c (revision 147741)
+++ gcc/gcse.c (working copy)
@@ -169,6 +169,7 @@ along with GCC; see the file COPYING3.
/* Propagate flow information through back edges and thus enable PRE's
moving loop invariant calculations out of loops.
@@ -1349,7 +1350,9 @@ hash_scan_set (rtx pat, rtx insn, struct
REG_EQUIV notes and if the argument slot is used somewhere
explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */
- && (note == NULL_RTX || ! MEM_P (XEXP (note, 0))))
+ && (note == NULL_RTX || ! MEM_P (XEXP (note, 0)))
+ && ! (targetm.cannot_copy_insn_p && INSN_P (insn)
+ && targetm.cannot_copy_insn_p (insn)))
/* An expression is not anticipatable if its operands are
modified before this insn or if this is not the only SET in