This is the mail archive of the gcc@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]

patch to fix PR92905


The following patch fixes

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

The patch was successfully bootstrapped on x86-64 and ppc64 and benchmarked on SPEC2000 on x86-64.

Committed as r279596

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 279595)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2019-12-19  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR target/92905
+	* lra-constraints.c (process_alt_operands): Check offmemok when
+	processing preferred_reload_class.
+
 2019-12-19  Andrew Stubbs  <ams@codesourcery.com>
 
 	* config/gcn/gcn-valu.md
Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 279523)
+++ lra-constraints.c	(working copy)
@@ -2722,11 +2722,24 @@ process_alt_operands (int only_alternati
 			  && (targetm.preferred_output_reload_class
 			      (op, this_alternative) == NO_REGS))))
 		{
-		  if (lra_dump_file != NULL)
-		    fprintf (lra_dump_file,
-			     "            %d Non-prefered reload: reject+=%d\n",
-			     nop, LRA_MAX_REJECT);
-		  reject += LRA_MAX_REJECT;
+		  if (offmemok && REG_P (op))
+		    {
+		      if (lra_dump_file != NULL)
+			fprintf
+			  (lra_dump_file,
+			   "            %d Spill pseudo into memory: reject+=3\n",
+			   nop);
+		      reject += 3;
+		    }
+		  else
+		    {
+		      if (lra_dump_file != NULL)
+			fprintf
+			  (lra_dump_file,
+			   "            %d Non-prefered reload: reject+=%d\n",
+			   nop, LRA_MAX_REJECT);
+		      reject += LRA_MAX_REJECT;
+		    }
 		}
 
 	      if (! (MEM_P (op) && offmemok)
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 279595)
+++ testsuite/ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2019-12-19  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR target/92905
+	* gcc.target/i386/pr92905.c: New test.
+
 2019-12-19  Richard Sandiford  <richard.sandiford@arm.com>
 
 	* g++.dg/ext/sve-sizeless-2.C: Don't expect an error for
Index: testsuite/gcc.target/i386/pr92905.c
===================================================================
--- testsuite/gcc.target/i386/pr92905.c	(nonexistent)
+++ testsuite/gcc.target/i386/pr92905.c	(working copy)
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { lp64 } } } */
+/* { dg-options "-O2 -mtune=intel" } */
+float f(float x)
+{
+    union {float f; unsigned i;} u = {x};
+    u.i |= 0x80000000;
+    return u.f;
+}
+/* { dg-final { scan-assembler-not "rsp"} } */

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