Patchwork committed: Fix WORDS_BIG_ENDIAN use in lra-assign.c:find_hard_regno_for

login
register
mail settings
Submitter Joern Rennecke
Date Oct. 27, 2012, 3:34 p.m.
Message ID <20121027113426.eihyf3ig4kksw04k-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/194622/
State New
Headers show

Comments

Joern Rennecke - Oct. 27, 2012, 3:34 p.m.
Bootstrapped (c,c++) on i686-pc-linux-gnu.

Committed as obvious.
2012-10-27  Joern Rennecke  <joern.rennecke@embecosm.com>

	* lra-assigns.c (find_hard_regno_for): Fix use of WORDS_BIG_ENDIAN.
Vladimir Makarov - Oct. 28, 2012, 8:32 p.m.
On 12-10-27 11:34 AM, Joern Rennecke wrote:
> Bootstrapped (c,c++) on i686-pc-linux-gnu.
>
> Committed as obvious.
Thanks, Joern.

Patch

Index: lra-assigns.c
===================================================================
--- lra-assigns.c	(revision 192878)
+++ lra-assigns.c	(revision 192879)
@@ -571,15 +571,12 @@  find_hard_regno_for (int regno, int *cos
 	  && HARD_REGNO_MODE_OK (hard_regno, PSEUDO_REGNO_MODE (regno))
 	  && ! TEST_HARD_REG_BIT (impossible_start_hard_regs, hard_regno)
 	  && (nregs_diff == 0
-#ifdef WORDS_BIG_ENDIAN
-	      || (hard_regno - nregs_diff >= 0
-		  && TEST_HARD_REG_BIT (reg_class_contents[rclass],
-					hard_regno - nregs_diff))
-#else
-	      || TEST_HARD_REG_BIT (reg_class_contents[rclass],
-				    hard_regno + nregs_diff)
-#endif
-	      ))
+	      || (WORDS_BIG_ENDIAN
+		  ? (hard_regno - nregs_diff >= 0
+		     && TEST_HARD_REG_BIT (reg_class_contents[rclass],
+					   hard_regno - nregs_diff))
+		  : TEST_HARD_REG_BIT (reg_class_contents[rclass],
+				       hard_regno + nregs_diff))))
 	{
 	  if (hard_regno_costs_check[hard_regno]
 	      != curr_hard_regno_costs_check)