public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* patch to fix PR65648
@ 2015-04-07 15:02 Vladimir Makarov
  2015-04-07 15:04 ` Jakub Jelinek
  2015-04-07 15:52 ` Jakub Jelinek
  0 siblings, 2 replies; 17+ messages in thread
From: Vladimir Makarov @ 2015-04-07 15:02 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

   The following patch fixes

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

   The patch was bootstrapped and tested on x86-64.

   I am lost to produce a test for the PR which can work on all arm 
sub-targets and have no sub-target hardware to test it.
   Therefore the patch does not contain the test.  It would be nice if 
somebody knowing arm well add a test for the PR.

   Committed as rev. 221901.

2015-04-07  Vladimir Makarov  <vmakarov@redhat.com>

         PR target/65678
         * lra-remat.c (do_remat): Process input and non-input insn
         registers separately.



[-- Attachment #2: pr65648.patch --]
[-- Type: text/x-patch, Size: 1648 bytes --]

Index: lra-remat.c
===================================================================
--- lra-remat.c	(revision 221867)
+++ lra-remat.c	(working copy)
@@ -1234,22 +1234,25 @@ do_remat (void)
 		for (i = 0; i < nregs; i++)
 		  CLEAR_HARD_REG_BIT (live_hard_regs, hard_regno + i);
 	      }
-	    else if (reg->type != OP_IN
-		     && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
+	  /* Process also hard regs (e.g. CC register) which are part
+	     of insn definition.  */
+	  for (reg = static_id->hard_regs; reg != NULL; reg = reg->next)
+	    if (reg->type == OP_IN
+		&& find_regno_note (insn, REG_DEAD, reg->regno) != NULL)
+	      CLEAR_HARD_REG_BIT (live_hard_regs, reg->regno);
+	  /* Inputs have been processed, now process outputs.  */
+	  for (reg = id->regs; reg != NULL; reg = reg->next)
+	    if (reg->type != OP_IN
+		&& find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
 	      {
 		if ((hard_regno = get_hard_regs (reg, nregs)) < 0)
 		  continue;
 		for (i = 0; i < nregs; i++)
 		  SET_HARD_REG_BIT (live_hard_regs, hard_regno + i);
 	      }
-	  /* Process also hard regs (e.g. CC register) which are part
-	     of insn definition.  */
 	  for (reg = static_id->hard_regs; reg != NULL; reg = reg->next)
-	    if (reg->type == OP_IN
-		&& find_regno_note (insn, REG_DEAD, reg->regno) != NULL)
-	      CLEAR_HARD_REG_BIT (live_hard_regs, reg->regno);
-	    else if (reg->type != OP_IN
-		     && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
+	    if (reg->type != OP_IN
+		&& find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
 	      SET_HARD_REG_BIT (live_hard_regs, reg->regno);
 	}
     }

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-04-14  9:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07 15:02 patch to fix PR65648 Vladimir Makarov
2015-04-07 15:04 ` Jakub Jelinek
2015-04-07 15:52 ` Jakub Jelinek
2015-04-07 19:28   ` Yvan Roux
2015-04-07 19:33     ` Jakub Jelinek
2015-04-07 20:02       ` Yvan Roux
2015-04-09 11:10         ` Yvan Roux
2015-04-09 11:16           ` Jakub Jelinek
2015-04-13 13:42           ` Kyrill Tkachov
2015-04-13 14:11             ` Yvan Roux
2015-04-13 14:36               ` Kyrill Tkachov
2015-04-13 14:37                 ` Jakub Jelinek
2015-04-14  8:19           ` Ramana Radhakrishnan
2015-04-14  8:32             ` Yvan Roux
2015-04-14  8:33               ` Jakub Jelinek
2015-04-14  8:35                 ` Ramana Radhakrishnan
2015-04-14  9:14                   ` Yvan Roux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).