diff mbox

Fix PR rtl-optimization/57786

Message ID 1811661.SActHBGVrK@polaris
State New
Headers show

Commit Message

Eric Botcazou July 8, 2013, 9:03 a.m. UTC
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.
diff mbox

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;