one more patch for PR87305

Message ID 96054f6b-3e52-4869-44a9-c7245e124496@redhat.com
State New
Headers show
Series
  • one more patch for PR87305
Related show

Commit Message

Vladimir Makarov Jan. 11, 2019, 7:29 p.m.
This patch adds code for little endian case of

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87305

   The patch was successfully bootstrapped and tested on x86-64.

   Committed as rev. 267854.

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 267853)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@ 
+2019-01-11  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/87305
+	* lra-assigns.c
+	(setup_live_pseudos_and_spill_after_risky_transforms): Add code
+	for little endian pseudos used as paradoxical subreg.
+
 2019-01-11  Jakub Jelinek  <jakub@redhat.com>
 
 	PR tree-optimization/88693
Index: lra-assigns.c
===================================================================
--- lra-assigns.c	(revision 267849)
+++ lra-assigns.c	(working copy)
@@ -1174,10 +1174,14 @@  setup_live_pseudos_and_spill_after_risky
 		      - hard_regno_nregs (hard_regno, PSEUDO_REGNO_MODE (i)));
 	enum reg_class rclass = lra_get_allocno_class (i);
 
-	if (WORDS_BIG_ENDIAN
-	    && (hard_regno - nregs_diff < 0
-		|| !TEST_HARD_REG_BIT (reg_class_contents[rclass],
-				       hard_regno - nregs_diff)))
+	if ((WORDS_BIG_ENDIAN
+	     && (hard_regno - nregs_diff < 0
+		 || !TEST_HARD_REG_BIT (reg_class_contents[rclass],
+					hard_regno - nregs_diff)))
+	    || (!WORDS_BIG_ENDIAN
+		&& (hard_regno + nregs_diff >= FIRST_PSEUDO_REGISTER
+		    || !TEST_HARD_REG_BIT (reg_class_contents[rclass],
+					   hard_regno + nregs_diff))))
 	  {
 	    /* Hard registers of paradoxical sub-registers are out of
 	       range of pseudo register class.  Spill the pseudo.  */