Blame SOURCES/gcc48-pr70549.patch

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