Patchwork New optimization for reload_combine

login
register
mail settings
Submitter Bernd Schmidt
Date July 27, 2010, 12:15 a.m.
Message ID <4C4E253A.8070800@codesourcery.com>
Download mbox | patch
Permalink /patch/59962/
State New
Headers show

Comments

Bernd Schmidt - July 27, 2010, 12:15 a.m.
On 07/26/2010 12:12 PM, IainS wrote:
> Apparently, one more problem remains...

Thanks again for providing a testcase.  I've committed the following fix
after bootstrap and regression test on i686-linux.  A use with a wrong
mode could cause us to move the addition past another set of the
register, as the necessary test was at the wrong nesting level.


Bernd

Patch

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);