This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

One more patch for PR89676


  Jeff Law recently found that my latest patch break some existing code compilation (the code is big to make test out of it).

Here is the patch to fix it.  The patch was successfully bootstrapped on x86-64.  The patch actually results in less new transformations the previous patch introduced.  So it should be safe.

Committed as rev. 269924.



Index: ChangeLog
===================================================================
--- ChangeLog	(revision 269923)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2019-03-25  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/89676
+	* lra-constraints.c (curr_insn_transform): Do match reload for
+	early clobbers when the match was successful only for different
+	registers.
+
 2019-03-25  Martin Sebor  <msebor@redhat.com>
 
 	* doc/extend.texi (Common Type Attributes): Document vector_size.
Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 269878)
+++ lra-constraints.c	(working copy)
@@ -4259,15 +4259,27 @@ curr_insn_transform (bool check_only_p)
 	  else if (goal_alt_matched[i][0] != -1
 		   && curr_static_id->operand[i].type == OP_OUT
 		   && (curr_static_id->operand_alternative
-		       [goal_alt_number * n_operands + i].earlyclobber))
+		       [goal_alt_number * n_operands + i].earlyclobber)
+		   && REG_P (op))
 	    {
-	      /* Generate reloads for output and matched inputs.  This
-		 is the easiest way to avoid creation of non-existing
-		 conflicts in lra-lives.c.  */
-	      match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before,
-			    &after, TRUE);
-	      outputs[n_outputs++] = i;
-	      outputs[n_outputs] = -1;
+	      for (j = 0; goal_alt_matched[i][j] != -1; j++)
+		{
+		  rtx op2 = *curr_id->operand_loc[goal_alt_matched[i][j]];
+		  
+		  if (REG_P (op2) && REGNO (op) != REGNO (op2))
+		    break;
+		}
+	      if (goal_alt_matched[i][j] != -1)
+		{
+		  /* Generate reloads for different output and matched
+		     input registers.  This is the easiest way to avoid
+		     creation of non-existing register conflicts in
+		     lra-lives.c.  */
+		  match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before,
+				&after, TRUE);
+		  outputs[n_outputs++] = i;
+		  outputs[n_outputs] = -1;
+		}
 	      continue;
 	    }
 	  else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]