diff options
author | Bernd Schmidt <bernds@redhat.com> | 2017-03-25 01:12:04 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2017-03-25 01:12:04 +0000 |
commit | 5da906ca43feb6e83cd3cdb11d59d76548005cad (patch) | |
tree | e9f003ff186d9814acb1738ac09b863f2d1584da | |
parent | 199855f60367c12d831416ecd4b367b5d0222f67 (diff) | |
download | gcc-5da906ca43feb6e83cd3cdb11d59d76548005cad.zip gcc-5da906ca43feb6e83cd3cdb11d59d76548005cad.tar.gz gcc-5da906ca43feb6e83cd3cdb11d59d76548005cad.tar.bz2 |
re PR target/80160 (operand has impossible constraints)
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.
* gcc.target/i386/pr80160.c: New test.
From-SVN: r246473
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lra-assigns.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr80160.c | 45 |
4 files changed, 61 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index adf3791..ef8e27f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 75bb630..e4cc43a 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d98eb37..36a082a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.target/i386/pr80160.c b/gcc/testsuite/gcc.target/i386/pr80160.c new file mode 100644 index 0000000..3bb110e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr80160.c @@ -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); +} |