* LRA fix for 80160
@ 2017-03-25 6:46 Bernd Schmidt
0 siblings, 0 replies; only message in thread
From: Bernd Schmidt @ 2017-03-25 6:46 UTC (permalink / raw)
To: GCC Patches; +Cc: Vladimir Makarov
[-- Attachment #1: Type: text/plain, Size: 182 bytes --]
This fixes two PRs; we shouldn't try to avoid spilling a reg if it has
an alternate class it can use.
Bootstrapped and tested on x86_64-linux, approved by Vlad, committed.
Bernd
[-- Attachment #2: 80160.diff --]
[-- Type: text/x-patch, Size: 2613 bytes --]
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 246472)
+++ gcc/ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2017-03-25 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/80160
+ PR rtl-optimization/80159
+ * lra-assigns.c (must_not_spill_p): Tighten new test to also take
+ reg_alternate_class into account.
+
2017-03-24 Vladimir Makarov <vmakarov@redhat.com>
PR target/80148
Index: gcc/lra-assigns.c
===================================================================
--- gcc/lra-assigns.c (revision 246472)
+++ gcc/lra-assigns.c (working copy)
@@ -908,7 +908,8 @@ must_not_spill_p (unsigned spill_regno)
does not solve the general case where existing reloads fully
cover a limited register class. */
if (!bitmap_bit_p (&non_reload_pseudos, spill_regno)
- && reg_class_size [reg_preferred_class (spill_regno)] == 1)
+ && reg_class_size [reg_preferred_class (spill_regno)] == 1
+ && reg_alternate_class (spill_regno) == NO_REGS)
return true;
return false;
}
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (revision 246472)
+++ gcc/testsuite/ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2017-03-25 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/80160
+ PR rtl-optimization/80159
+
+ * gcc.target/i386/pr80160.c: New test.
+
2017-03-24 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/79904
Index: gcc/testsuite/gcc.target/i386/pr80160.c
===================================================================
--- gcc/testsuite/gcc.target/i386/pr80160.c (nonexistent)
+++ gcc/testsuite/gcc.target/i386/pr80160.c (working copy)
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-omit-frame-pointer -w" } */
+/* { dg-additional-options "-march=pentium-mmx" { target ia32 } } */
+
+typedef struct { long long a; } a_t;
+int *a, b;
+a_t *e, c;
+long long f;
+void fn (int);
+void fn2 (void);
+int fn3 (a_t);
+void fn4 (a_t);
+a_t foo (long long val) { return (a_t){val}; }
+static void
+bar (int ka)
+{
+ unsigned i;
+ for (i = 0; i < 512; i++) {
+ long d;
+ c = (a_t){d};
+ fn2 ();
+ }
+ fn (ka);
+}
+void
+test (void)
+{
+ a_t g;
+ a_t *h, j;
+ h = e;
+ j = *h;
+ if (e == (a_t *) 1) {
+ a_t k = {fn3 (j)};
+ fn4 (j);
+ long l;
+ g = foo((long long)b << 2 | l);
+ k = g;
+ if (j.a != k.a) {
+ a_t m = g;
+ int n = m.a, o = m.a >> 32;
+ asm ("# %0 %1 %2 %3" : "=m"(*a), "+A"(f) : "b"(n), "c"(o));
+ }
+ }
+ bar ((int) h);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-25 1:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-25 6:46 LRA fix for 80160 Bernd Schmidt
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).