This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[trunk<-vta] Re: [vta,vta4.3,trunk?] avoid accidental moving of death notes in combine


On Sep 10, 2008, Alexandre Oliva <aoliva@redhat.com> 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
> tests.

> 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?

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* combine.c (move_deaths): Compare LUIDs within the same BB only.

Index: gcc/combine.c
===================================================================
--- 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))
 	return;
 
-      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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]