commit 6a77b1fca11e2fe9ac20aba2a241ead5a8ebd701
Author: Bernd Schmidt <bernds@codesourcery.com>
Date: Tue Oct 15 12:16:07 2013 +0200
Fix a miscompilation where a reload reg is reused after it has been clobbered.
* reload1.c (reloads_unique_chain_p): Ensure that r1 is the input for
r2.
@@ -1,3 +1,8 @@
+2013-10-15 Bernd Schmidt <bernds@codesourcery.com>
+
+ * reload1.c (reloads_unique_chain_p): Ensure that r1 is the input for
+ r2.
+
2013-10-15 Richard Biener <rguenther@suse.de>
* tree-loop-distribution.c (build_empty_rdg): Inline into
@@ -5560,6 +5560,14 @@ reloads_unique_chain_p (int r1, int r2)
|| reg_mentioned_p (rld[r2].in, rld[r1].in)))
return false;
+ /* The following loop assumes that r1 is the reload that feeds r2. */
+ if (r1 > r2)
+ {
+ int tmp = r2;
+ r2 = r1;
+ r1 = tmp;
+ }
+
for (i = 0; i < n_reloads; i ++)
/* Look for input reloads that aren't our two */
if (i != r1 && i != r2 && rld[i].in)