aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2015-07-14 20:54:00 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2015-07-14 20:54:00 +0000
commit6e5ad0f92c3e5b4f8c3fcf5a67265874beda1040 (patch)
tree62ccd56b35e933003653d5a5b1bcc8d7d34eb5d0 /gcc/lra-constraints.c
parent5fd6ec3e4b29ed0e4ba1ca81d642ee718004db7d (diff)
downloadgcc-6e5ad0f92c3e5b4f8c3fcf5a67265874beda1040.zip
gcc-6e5ad0f92c3e5b4f8c3fcf5a67265874beda1040.tar.gz
gcc-6e5ad0f92c3e5b4f8c3fcf5a67265874beda1040.tar.bz2
re PR rtl-optimization/66626 (gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 or -miamcu)
2015-07-14 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/66626 * lra-constraints.c (lra_constraints): Prevent equivalence substitution for static chain pseudo in functions with nonlocal goto. 2015-07-14 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/66626 * gcc.target/i386/pr66626.c: New. From-SVN: r225789
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index ddb91dd..58a388f 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -4306,7 +4306,13 @@ lra_constraints (bool first_p)
&& ((CONST_POOL_OK_P (PSEUDO_REGNO_MODE (i), x)
&& (targetm.preferred_reload_class
(x, lra_get_allocno_class (i)) == NO_REGS))
- || contains_symbol_ref_p (x))))
+ || contains_symbol_ref_p (x)))
+ /* Static chain equivalence may contain eliminable
+ regs and the result of elimination might be wrong
+ after restoring frame pointer for a nonlocal
+ goto. */
+ || (cfun->static_chain_decl && crtl->has_nonlocal_goto
+ && REG_EXPR (reg) == cfun->static_chain_decl))
ira_reg_equiv[i].defined_p = false;
if (contains_reg_p (x, false, true))
ira_reg_equiv[i].profitable_p = false;