diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2013-10-25 21:34:26 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2013-10-25 21:34:26 +0000 |
commit | f6937e32d041eedb13f605a014eb4506a158ba62 (patch) | |
tree | 3ea933d09d48793f3d02906e2059a2fde73bc441 /gcc | |
parent | 01b1efaa1439e6cbf44566354dcce9a96d5c6f5e (diff) | |
download | gcc-f6937e32d041eedb13f605a014eb4506a158ba62.zip gcc-f6937e32d041eedb13f605a014eb4506a158ba62.tar.gz gcc-f6937e32d041eedb13f605a014eb4506a158ba62.tar.bz2 |
re PR rtl-optimization/58759 (wrong code (segfaults) at -O2 on x86_64-linux-gnu in 32-bit mode)
2013-10-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/58759
* lra-constraints.c (lra_constraints): Remove wrong condition to
remove insn setting up an equivalent pseudo.
2013-10-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/58759
* gcc.target/i386/pr58759.c: New.
From-SVN: r204080
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lra-constraints.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr58759.c | 38 |
4 files changed, 52 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d120771..29035aa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2013-10-25 Vladimir Makarov <vmakarov@redhat.com> + PR rtl-optimization/58759 + * lra-constraints.c (lra_constraints): Remove wrong condition to + remove insn setting up an equivalent pseudo. + +2013-10-25 Vladimir Makarov <vmakarov@redhat.com> + * config/rs6000/rs6000-protos.h (rs6000_secondary_memory_needed_mode): New prototype. * config/rs6000/rs6000.c: Include ira.h. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index e741dd6..a2d348d 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3975,18 +3975,6 @@ lra_constraints (bool first_p) dest_reg = SUBREG_REG (dest_reg); if ((REG_P (dest_reg) && (x = get_equiv_substitution (dest_reg)) != dest_reg - /* Check that this is actually an insn setting up - the equivalence. */ - && (in_list_p (curr_insn, - ira_reg_equiv - [REGNO (dest_reg)].init_insns) - /* Init insns may contain not all insns setting - up equivalence as we have live range - splitting. So here we use another condition - to check insn setting up the equivalence - which should be removed, e.g. in case when - the equivalence is a constant. */ - || ! MEM_P (x)) /* Remove insns which set up a pseudo whose value can not be changed. Such insns might be not in init_insns because we don't update equiv data @@ -3999,8 +3987,10 @@ lra_constraints (bool first_p) secondary memory movement. Then the pseudo is spilled and we use the equiv constant. In this case we should remove the additional insn and - this insn is not init_insns list. */ + this insn is not init_insns list. */ && (! MEM_P (x) || MEM_READONLY_P (x) + /* Check that this is actually an insn setting + up the equivalence. */ || in_list_p (curr_insn, ira_reg_equiv [REGNO (dest_reg)].init_insns))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c8fb3cd..6b98112 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-25 Vladimir Makarov <vmakarov@redhat.com> + + PR rtl-optimization/58759 + * gcc.target/i386/pr58759.c: New. + 2013-10-25 Tobias Burnus <burnus@net-b.de> * g++.dg/vect/pr33426-ivdep.cc: Use dg-options. diff --git a/gcc/testsuite/gcc.target/i386/pr58759.c b/gcc/testsuite/gcc.target/i386/pr58759.c new file mode 100644 index 0000000..8257dde --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr58759.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + + +int a, b, c, d, e, f, h, l, m, n, k, o; +long long g; + +struct S +{ + int f1; + int f2; + int f3; + int f4; +}; + +static struct S i = {0,0,0,0}, j; + +void +foo () +{ + m = 1 & d; + n = b + c; + o = k >> 1; + f = 0 == e; +} + +int +main () +{ + for (; h < 1; h++) + { + g = 1 | (0 > 1 - a ? 0 : a); + foo (); + for (l = 0; l < 3; l++) + j = i; + } + return 0; +} |