This is the mail archive of the
mailing list for the GCC project.
[trunk<-vta] Re: [vta,vta4.3,trunk?] avoid accidental moving of death notes in combine
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 01 Jun 2009 04:59:31 -0300
- Subject: [trunk<-vta] Re: [vta,vta4.3,trunk?] avoid accidental moving of death notes in combine
- References: <email@example.com>
On Sep 10, 2008, Alexandre Oliva <firstname.lastname@example.org> wrote:
> move_deaths(), in combine, will happily take outdated last_death from
> different BBs and try to move death notes, if the LUID of a REG's
> last_death, within its own BB happens, to be between the LUIDs of two
> combined insns, even though it doesn't make sense to compare LUIDs of
> insns in different BBs.
> I noticed this with -fcompare-debug, because a REG_DEAD note moved
> about, because debug insns caused the LUIDs to accidentally pass the
> This patch avoids the accident. I don't have any testcase that
> doesn't involve debug insns, and even that doesn't cause executable
> code changes.
Ok for trunk?
from Alexandre Oliva <email@example.com>
* combine.c (move_deaths): Compare LUIDs within the same BB only.
--- gcc/combine.c.orig 2009-05-28 04:16:44.000000000 -0300
+++ gcc/combine.c 2009-05-28 04:33:57.000000000 -0300
@@ -12143,7 +12143,7 @@ move_deaths (rtx x, rtx maybe_kill_insn,
&& ! reg_referenced_p (x, maybe_kill_insn))
- if (where_dead
+ if (where_dead && BLOCK_FOR_INSN (where_dead) == BLOCK_FOR_INSN (to_insn)
&& DF_INSN_LUID (where_dead) >= from_luid
&& DF_INSN_LUID (where_dead) < DF_INSN_LUID (to_insn))
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer