[PR99422] LRA: Use lookup_constraint only for a single constraint in process_address_1.
authorVladimir N. Makarov <vmakarov@redhat.com>
Thu, 18 Mar 2021 19:58:26 +0000 (15:58 -0400)
committerVladimir N. Makarov <vmakarov@redhat.com>
Thu, 18 Mar 2021 19:59:15 +0000 (15:59 -0400)
This is an additional patch for PR99422.  In process_address_1 we
look only at the first constraint in the 1st alternative
and ignore all other possibilities.  As we don't know what
alternative and constraint will be used at this stage, we can be sure
only for a single constraint with one alternative and should use unknown
constraint for all other cases.

gcc/ChangeLog:

PR target/99422
* lra-constraints.c (process_address_1): Use lookup_constraint
only for a single constraint.

gcc/lra-constraints.c

index 9205826..64801b6 100644 (file)
@@ -3459,7 +3459,12 @@ process_address_1 (int nop, bool check_only_p,
       constraint
        = skip_contraint_modifiers (curr_static_id->operand[dup].constraint);
     }
-  cn = lookup_constraint (*constraint == '\0' ? "X" : constraint);
+  if (*skip_contraint_modifiers (constraint
+                                + CONSTRAINT_LEN (constraint[0],
+                                                  constraint)) != '\0')
+    cn = CONSTRAINT__UNKNOWN;
+  else
+    cn = lookup_constraint (*constraint == '\0' ? "X" : constraint);
   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