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

--- Comment #27 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Michael Meissner from comment #23)
> If we change rs6000_legitimate_address_p to return false if we have a
> prefixed address and we are in asm, we get an insn not found error:
> 
> --- /home/meissner/tmp/gcc-tmp/TskwFJ_rs6000.c  2021-02-16
> 11:44:05.520201674 -0500
> +++ gcc/config/rs6000/rs6000.c  2021-02-16 11:41:41.444740394 -0500
> @@ -9532,7 +9532,7 @@ rs6000_legitimate_address_p (machine_mod
>  
>    /* Handle prefixed addresses (PC-relative or 34-bit offset).  */
>    if (address_is_prefixed (x, mode, NON_PREFIXED_DEFAULT))
> -    return 1;
> +    return !recog_data.is_asm;
>  
>    /* Handle restricted vector d-form offsets in ISA 3.0.  */
>    if (quad_offset_p)

I don't think this change is correct as is, since pcrel addresses could be
legitimate in asm if we had a constraint the user could use.  I think this
would also have to check that the constraint being used isn't the new pcrel
constraint.



> And we look at calls to satisfies_constraint_m, the is_asm field it not set
> for each of the references:

The above said, is this the real problem?  Ie, should we fix the is_asm field
not always being correctly set so we can make a change here rather than in
rs6000_legitimate_address_p?

Reply via email to