mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 20:01:28 +08:00
Fix PR94185: Do not reuse insn alternative after changing memory subreg.
2020-03-16 Vladimir Makarov <vmakarov@redhat.com> PR target/94185 * lra-spills.c (remove_pseudos): Do not reuse insn alternative after changing memory subreg. 2020-03-16 Vladimir Makarov <vmakarov@redhat.com> PR target/94185 * g++.target/i386/pr94185.C: New test.
This commit is contained in:
parent
f522810d2b
commit
bae7b38cf8
@ -1,3 +1,9 @@
|
||||
2020-03-16 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR target/94185
|
||||
* lra-spills.c (remove_pseudos): Do not reuse insn alternative
|
||||
after changing memory subreg.
|
||||
|
||||
2020-03-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
|
||||
Srinath Parvathaneni <srinath.parvathaneni@arm.com>
|
||||
|
||||
|
@ -427,7 +427,17 @@ remove_pseudos (rtx *loc, rtx_insn *insn)
|
||||
and avoid LRA cycling in case of subreg memory reload. */
|
||||
res = remove_pseudos (&SUBREG_REG (*loc), insn);
|
||||
if (GET_CODE (SUBREG_REG (*loc)) == MEM)
|
||||
alter_subreg (loc, false);
|
||||
{
|
||||
alter_subreg (loc, false);
|
||||
if (GET_CODE (*loc) == MEM)
|
||||
{
|
||||
lra_get_insn_recog_data (insn)->used_insn_alternative = -1;
|
||||
if (lra_dump_file != NULL)
|
||||
fprintf (lra_dump_file,
|
||||
"Memory subreg was simplified in in insn #%u\n",
|
||||
INSN_UID (insn));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
else if (code == REG && (i = REGNO (*loc)) >= FIRST_PSEUDO_REGISTER
|
||||
|
@ -1,3 +1,8 @@
|
||||
2020-03-16 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR target/94185
|
||||
* g++.target/i386/pr94185.C: New test.
|
||||
|
||||
2020-03-16 Richard Sandiford <richard.sandiford@arm.com>
|
||||
|
||||
* gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Add a test
|
||||
|
33
gcc/testsuite/g++.target/i386/pr94185.C
Normal file
33
gcc/testsuite/g++.target/i386/pr94185.C
Normal file
@ -0,0 +1,33 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fPIE -fstack-protector-strong" } */
|
||||
|
||||
struct a {
|
||||
int b;
|
||||
int c();
|
||||
a() : b(c()) {}
|
||||
~a();
|
||||
char *e();
|
||||
};
|
||||
struct f {
|
||||
void g(int);
|
||||
};
|
||||
struct ar {
|
||||
int au[256];
|
||||
f h(int);
|
||||
} bb;
|
||||
a i();
|
||||
a j(int);
|
||||
long k(int, ar);
|
||||
int d;
|
||||
void l(char *, ar m, long n) {
|
||||
switch (m.au[d])
|
||||
case 0:
|
||||
n &= 4294967295;
|
||||
bb.h(0).g(n);
|
||||
}
|
||||
void o() {
|
||||
ar bd;
|
||||
a bh, bi, attrname = j(0) = i();
|
||||
int be = k(0, bd);
|
||||
l(attrname.e(), bd, be);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user