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]

[PATCH] PR27883: Delete old REG_DEAD notes before creating new ones


The patch below from Jim Wilson fixes PR27883, an ICE that can happen
with --enable-checking builds.  Jim writes, "when we execute the
second life pass, we end up with two overlapping REG_DEAD notes plus an
overlapping REG_UNUSED note on a previous insn.  When sched runs, it
deletes both REG_DEAD notes, but only readds one, resulting in the
abort for a REG_DEAD note consistency problem.  This patch just deletes
the old REG_DEAD notes for a local life update before creating new
ones."

and "I think the problem is best fixed on mainline by merging in the
dataflow branch, but for currently supported releases, and for the
pending 4.2 release, I think the simple fix in the PR is best.  So if
we add this fix to the mainline now, then we need to remember to remove
it when the dataflow branch goes in, or else prevent it from migrating
to the dataflow branch."

Because Jim didn't have time, I bootstrapped and regtested the patch
successfully on mipsel-linux-gnu and x86_64-linux-gnu.  I'm not adding
a new testcase because gcc.c-torture/execute/ieee/mzero6.c currently
fails with this ICE and is fixed by the patch.  OK for mainline, and
4.1/4.0 after some time?


2006-07-10  James E Wilson  <wilson@specifix.com>

	PR tree-optimization/27883
	* flow.c (update_life_info): If UPDATE_LIFE_LOCAL and PROP_DEATH_NOTES
	then call count_or_remove_death_notes.

Index: flow.c
===================================================================
--- flow.c	(revision 115324)
+++ flow.c	(working copy)
@@ -647,6 +647,16 @@ update_life_info (sbitmap blocks, enum u
 	count_or_remove_death_notes (blocks,
 				     prop_flags & PROP_POST_REGSTACK ? -1 : 1);
     }
+  else
+    {
+      /* For a local update, if we are creating new REG_DEAD notes, then we
+	 must delete the old ones first to avoid conflicts if they are
+	 different.  */
+      if (prop_flags & PROP_DEATH_NOTES)
+	count_or_remove_death_notes (blocks,
+				     prop_flags & PROP_POST_REGSTACK ? -1 : 1);
+    }
+				     
 
   /* Clear log links in case we are asked to (re)compute them.  */
   if (prop_flags & PROP_LOG_LINKS)

-- 
Martin Michlmayr
http://www.cyrius.com/


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