The following patch solves

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99454

The patch was successfully bootstrapped and tested on x86-64, ppc64le, and arm64.  Unfortunately, I did not manage to reduce the test (whose size is 5MB).


commit 9725df0233b6fb6e761875968b3b8e9fd9f522ac (HEAD -> master)
Author: Vladimir N. Makarov <vmaka...@redhat.com>
Date:   Tue Mar 9 09:05:05 2021 -0500

    [PR99454] LRA: Process 0..9 constraints in process_address_1
    
    We need to process 0..9 constraints to fetch the right op constraint in
    the function.  Also 0..9 constraints gives unknown class constraint
    class which can result in skipping address normalization for memory in asm.
    
    gcc/ChangeLog:
    
            PR target/99454
            * lra-constraints.c (process_address_1): Process 0..9 constraints
            in process_address_1.

diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 76e3ff7efe6..feff766c590 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -3452,6 +3452,10 @@ 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);
   cn = lookup_constraint (constraint);
   if (insn_extra_address_constraint (cn)
       /* When we find an asm operand with an address constraint that

Reply via email to