From: Bernd Schmidt Date: Sat, 25 Mar 2017 01:12:04 +0000 (+0000) Subject: re PR target/80160 (operand has impossible constraints) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5da906ca43feb6e83cd3cdb11d59d76548005cad;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index adf3791dfd9..ef8e27fa8d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-03-25 Bernd Schmidt + + 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 PR target/80148 diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 75bb630dca7..e4cc43ac820 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 d98eb375beb..36a082a305c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-03-25 Bernd Schmidt + + PR rtl-optimization/80160 + PR rtl-optimization/80159 + + * gcc.target/i386/pr80160.c: New test. + 2017-03-24 Jakub Jelinek 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 00000000000..3bb110e700d --- /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); +}