[trans-mem] more PR46567 fixes

Submitted by Aldy Hernandez on Feb. 3, 2011, 5:50 p.m.

Details

Message ID 4D4AEAD3.6030507@redhat.com
State New
Headers show

Commit Message

Aldy Hernandez Feb. 3, 2011, 5:50 p.m.
This is a patch I'm submitting on behalf of Andrew Macleod, whose on 
vacation.  There seem to be various, separate, problems that all trigger 
the same ICE.  This fixes the ICE for attachment 23153 in the PR.

I will be working on (hopefully) the last ICE in PR next, which is 
attachment 23234, and seems to be a case where we try to split the 
EXIT_BLOCK incorrectly.

Richard, is this OK for the branch?  I believe Andrew had already 
discussed this with you.

Aldy
PR/46567
        * trans-mem.c (ipa_tm_propagate_irr): Don't reprocess blocks
	already in the old irrevocable list.

Comments

Richard Henderson Feb. 3, 2011, 6:24 p.m.
On 02/03/2011 09:50 AM, Aldy Hernandez wrote:
> 	PR/46567
>         * trans-mem.c (ipa_tm_propagate_irr): Don't reprocess blocks
> 	already in the old irrevocable list.

Ok.


r~

Patch hide | download patch | download mbox

Index: testsuite/gcc.dg/tm/pr46567.c
===================================================================
--- testsuite/gcc.dg/tm/pr46567.c	(revision 0)
+++ testsuite/gcc.dg/tm/pr46567.c	(revision 0)
@@ -0,0 +1,18 @@ 
+__attribute__((transaction_callable)) 
+static void SeqfileGetLine ()
+{
+  SSIGetFilePosition ();
+}
+
+__attribute__((transaction_callable))
+static void readLoop (int addfirst)
+{
+  if (!addfirst)
+    {
+      if (!addfirst)
+        {
+          SSIGetFilePosition ();
+        }
+      SeqfileGetLine ();
+    }
+}
Index: trans-mem.c
===================================================================
--- trans-mem.c	(revision 169800)
+++ trans-mem.c	(working copy)
@@ -3718,8 +3718,12 @@  ipa_tm_propagate_irr (basic_block entry_
 	    }
 	  if (all_son_irr)
 	    {
-	      bitmap_set_bit (new_irr, bb->index);
-	      this_irr = true;
+	      /* Add block to new_irr if it hasn't already been processed. */
+	      if (!old_irr || !bitmap_bit_p (old_irr, bb->index))
+	        {
+		  bitmap_set_bit (new_irr, bb->index);
+		  this_irr = true;
+		}
 	    }
 	}
 
@@ -3730,7 +3734,11 @@  ipa_tm_propagate_irr (basic_block entry_
 	  for (son = first_dom_son (CDI_DOMINATORS, bb);
 	       son;
 	       son = next_dom_son (CDI_DOMINATORS, son))
-	    bitmap_set_bit (new_irr, son->index);
+	    {
+	      /* Make sure a block isn't already in old_irr.  */
+	      gcc_assert (!old_irr || !bitmap_bit_p (old_irr, son->index));
+	      bitmap_set_bit (new_irr, son->index);
+	    }
 	}
     }
   while (!VEC_empty (basic_block, bbs));