This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Remove REG_EQUAL from insn where REG_RETVAL is added
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Subject: Re: PATCH: Remove REG_EQUAL from insn where REG_RETVAL is added
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 05 Apr 2000 12:38:43 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <200004041235.OAA28933@ignucius.axis.se>you write:
> The reviewer should know that it is documented (and assumed) in several
> places in GCC that a REG_EQUAL note on the same insn as a REG_RETVAL
> indicates "the expression being computed by the sequence". Those places
> includes delete_trivially_dead_insns, which as you might guess does bad
> things when the wrong REG_EQUAL note is on the same insn as a REG_RETVAL
> note.
Yup.
> I present the "safe" approach here, but it seems preferable to have the
> set_unique_reg_note call in both the true and false branches below; there
> seems to be missing optimization opportunities when it's absent.
Yes. A few of the optimizers look for the REG_EQUAL notes for libcall
sequences and use them to improve optimization.
> For usage of the note, does it really matter that the movdi is
> synthesized?
Yes. Or more correctly, kind-of.
When the movdi is not synthesized we end the sequence with an insn that
copies a value to itself. That is the definition of a libcall sequence
that can be optimized by cse, loop, etc.
It just happens to be the case that I was looking at a bug today which I
believe your patch will fix (I won't know for a while). In the mean time
I bootstrapped the x86 linux port with your patch and ran the testsuite
without regressions and installed your patch.
Thanks,
jeff