Index: ChangeLog
===================================================================
--- ChangeLog	(revision 162549)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2010-07-27  Bernd Schmidt  <bernds@codesourcery.com>
+
+	* postreload.c (reload_combine_recognize_const_pattern): Move test
+	for limiting the insn movement to the right scope.
+
 2010-07-26  Richard Henderson  <rth@redhat.com>
 
 	PR target/44132
Index: postreload.c
===================================================================
--- postreload.c	(revision 162421)
+++ postreload.c	(working copy)
@@ -955,8 +955,8 @@ reload_combine_recognize_const_pattern (
 	      && reg_state[clobbered_regno].real_store_ruid >= use_ruid)
 	    break;
 
-	  /* Avoid moving a use of ADDREG past a point where it
-	     is stored.  */
+	  gcc_assert (reg_state[regno].store_ruid <= use_ruid);
+	  /* Avoid moving a use of ADDREG past a point where it is stored.  */
 	  if (reg_state[REGNO (addreg)].store_ruid >= use_ruid)
 	    break;
 
@@ -1033,10 +1033,10 @@ reload_combine_recognize_const_pattern (
 		    }
 		}
 	    }
-	  /* If we get here, we couldn't handle this use.  */
-	  if (must_move_add)
-	    break;
 	}
+      /* If we get here, we couldn't handle this use.  */
+      if (must_move_add)
+	break;
     }
   while (use);
 
