diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2018-03-09 18:50:56 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-03-09 11:50:56 -0700 |
commit | 998fd1413977a70cfeb7bf9180f3b462a7731237 (patch) | |
tree | 12fc5f25e3d71e6b873da993f69004f09ea99260 /gcc/lra-constraints.c | |
parent | 300e61fa150ce9fa7bc86784aaa6baeffd174c2f (diff) | |
download | gcc-998fd1413977a70cfeb7bf9180f3b462a7731237.zip gcc-998fd1413977a70cfeb7bf9180f3b462a7731237.tar.gz gcc-998fd1413977a70cfeb7bf9180f3b462a7731237.tar.bz2 |
re PR rtl-optimization/84682 (internal compiler error: Segmentation fault (process_address_1))
PR rtl-optimization/84682
* lra-constraints.c (process_address_1): Check is_address flag
for address constraints.
(process_alt_operands): Likewise.
* lra.c (lra_set_insn_recog_data): Pass asm operand locs to
preprocess_constraints.
* recog.h (preprocess_constraints): Add oploc parameter.
Adjust callers.
PR rtl-optimization/84682
* gcc.dg/torture/pr84682-1.c: New.
* gcc.dg/torture/pr84682-2.c: New.
* gcc.dg/torture/pr84682-3.c: New.
From-SVN: r258393
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 6bfd465..118b65f 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -2276,6 +2276,12 @@ process_alt_operands (int only_alternative) break; case CT_ADDRESS: + /* An asm operand with an address constraint + that doesn't satisfy address_operand has + is_address cleared, so that we don't try to + make a non-address fit. */ + if (!curr_static_id->operand[nop].is_address) + break; /* If we didn't already win, we can reload the address into a base register. */ if (satisfies_address_constraint_p (op, cn)) @@ -3236,7 +3242,14 @@ process_address_1 (int nop, bool check_only_p, && GET_CODE (XEXP (op, 0)) == SCRATCH) return false; - if (insn_extra_address_constraint (cn)) + if (insn_extra_address_constraint (cn) + /* When we find an asm operand with an address constraint that + doesn't satisfy address_operand to begin with, we clear + is_address, so that we don't try to make a non-address fit. + If the asm statement got this far, it's because other + constraints are available, and we'll use them, disregarding + the unsatisfiable address ones. */ + && curr_static_id->operand[nop].is_address) decompose_lea_address (&ad, curr_id->operand_loc[nop]); /* Do not attempt to decompose arbitrary addresses generated by combine for asm operands with loose constraints, e.g 'X'. */ |