aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@redhat.com>2021-03-09 10:57:21 -0500
committerVladimir N. Makarov <vmakarov@redhat.com>2021-03-09 11:10:29 -0500
commitfb5d9e8361892a627f5ef9dda7f356f34000ed5b (patch)
treef018fea60088833fc31510ebce546f487ac1285f /gcc/lra-constraints.c
parent9f8be03500b85bf8f8598e9ebd508654eab14528 (diff)
downloadgcc-fb5d9e8361892a627f5ef9dda7f356f34000ed5b.zip
gcc-fb5d9e8361892a627f5ef9dda7f356f34000ed5b.tar.gz
gcc-fb5d9e8361892a627f5ef9dda7f356f34000ed5b.tar.bz2
[PR99454] LRA: Process separately 'g' and digital constraints > 9 in process_address_1
gcc/ChangeLog: PR target/99454 * lra-constraints.c (process_address_1): Process constraint 'g' separately and digital constraints containing more one digit. gcc/testsuite/ChangeLog: PR target/99454 * gcc.target/i386/pr99454.c: New.
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index feff766..05cb493 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -3452,10 +3452,13 @@ process_address_1 (int nop, bool check_only_p,
constraint
= skip_contraint_modifiers (curr_static_id->operand[nop].constraint);
- if ('0' <= constraint[0] && constraint[0] <= '9')
- constraint
- = skip_contraint_modifiers (curr_static_id->operand
- [constraint[0] - '0'].constraint);
+ if (IN_RANGE (constraint[0], '0', '9'))
+ {
+ char *end;
+ unsigned long dup = strtoul (constraint, &end, 10);
+ constraint
+ = skip_contraint_modifiers (curr_static_id->operand[dup].constraint);
+ }
cn = lookup_constraint (constraint);
if (insn_extra_address_constraint (cn)
/* When we find an asm operand with an address constraint that
@@ -3472,7 +3475,7 @@ process_address_1 (int nop, bool check_only_p,
i.e. bcst_mem_operand in i386 backend. */
else if (MEM_P (mem)
&& !(INSN_CODE (curr_insn) < 0
- && (cn == CONSTRAINT__UNKNOWN
+ && ((cn == CONSTRAINT__UNKNOWN && *constraint != 'g')
|| (get_constraint_type (cn) == CT_FIXED_FORM
&& constraint_satisfied_p (op, cn)))))
decompose_mem_address (&ad, mem);