Blame SOURCES/gcc48-pr70549.patch

003890
2017-03-08  Bernd Schmidt  <bschmidt@redhat.com>
003890
003890
	PR target/70549
003890
	* config/aarch64/aarch64.c (aarch64_secondary_reload): Reload
003890
	CORE_REGS rclass constants in [SD]Fmode through FP_REGS.
003890
003890
	* g++.dg/opt/pr70549.C: New test.
003890
003890
--- gcc/config/aarch64/aarch64.c.jj	2017-03-08 15:50:55.000000000 +0100
003890
+++ gcc/config/aarch64/aarch64.c	2017-03-08 16:01:15.426080172 +0100
003890
@@ -3846,8 +3846,13 @@ aarch64_secondary_reload (bool in_p ATTR
003890
       && GET_MODE_SIZE (mode) == 16 && MEM_P (x))
003890
     return FP_REGS;
003890
 
003890
+  if (rclass == CORE_REGS
003890
+      && (mode == SFmode || mode == DFmode)
003890
+      && CONSTANT_P (x))
003890
+    return FP_REGS;
003890
+
003890
   if (rclass == FP_REGS && (mode == TImode || mode == TFmode) && CONSTANT_P(x))
003890
-      return CORE_REGS;
003890
+    return CORE_REGS;
003890
 
003890
   return NO_REGS;
003890
 }
003890
--- gcc/testsuite/g++.dg/opt/pr70549.C.jj	2017-03-08 16:02:45.104918249 +0100
003890
+++ gcc/testsuite/g++.dg/opt/pr70549.C	2017-03-08 16:02:14.000000000 +0100
003890
@@ -0,0 +1,33 @@
003890
+// PR target/70549
003890
+// { dg-do compile }
003890
+// { dg-options "-O2" }
003890
+// { dg-additional-options "-fPIC" { target fpic } }
003890
+
003890
+struct A { float x; float y; };
003890
+A a, b, c;
003890
+int d, e;
003890
+A bar ();
003890
+void foo (A, A);
003890
+inline A operator/ (A, A p2) { if (p2.x) return a; }
003890
+struct B { A dval; };
003890
+int baz (A, B, A, int);
003890
+
003890
+void
003890
+test ()
003890
+{
003890
+  B q;
003890
+  A f, g, h, k;
003890
+  h.x = 1.0;
003890
+  f = h;
003890
+  struct A i, j = f;
003890
+  do {
003890
+    i = bar ();
003890
+    g = i / j;
003890
+    foo (g, c);
003890
+    int l = baz (k, q, b, e);
003890
+    if (l)
003890
+      goto cleanup;
003890
+    j = i;
003890
+  } while (d);
003890
+cleanup:;
003890
+}