Patchwork Fix PR rtl-optimization/57786

login
register
mail settings
Submitter Eric Botcazou
Date July 8, 2013, 9:03 a.m.
Message ID <1811661.SActHBGVrK@polaris>
Download mbox | patch
Permalink /patch/257505/
State New
Headers show

Comments

Eric Botcazou - July 8, 2013, 9:03 a.m.
As spotted by Po-Chun Chang, we can add a break in the loop dealing with the 
multi-hard registers case in the REG_DEAD case of distribute_notes.

Bootstrapped/regtested on x86_64-suse-linux, applied on the mainline.


2013-07-08  Po-Chun Chang  <pchang9@cs.wisc.edu>

	PR rtl-optimization/57786
	* combine.c (distribute_notes) <case REG_DEAD>: Change all_used to bool
	and break out of the loop when it is set to false.

Patch

Index: combine.c
===================================================================
--- combine.c	(revision 200635)
+++ combine.c	(working copy)
@@ -13578,14 +13578,17 @@  distribute_notes (rtx notes, rtx from_in
 		  && hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] > 1)
 		{
 		  unsigned int endregno = END_HARD_REGNO (XEXP (note, 0));
-		  int all_used = 1;
+		  bool all_used = true;
 		  unsigned int i;
 
 		  for (i = regno; i < endregno; i++)
 		    if ((! refers_to_regno_p (i, i + 1, PATTERN (place), 0)
 			 && ! find_regno_fusage (place, USE, i))
 			|| dead_or_set_regno_p (place, i))
-		      all_used = 0;
+		      {
+			all_used = false;
+			break;
+		      }
 
 		  if (! all_used)
 		    {
@@ -13629,7 +13632,6 @@  distribute_notes (rtx notes, rtx from_in
 				    break;
 				  }
 			      }
-
 			}
 
 		      place = 0;