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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Bernd Schmidt from comment #9)
> Maybe we just need to declare this address to be invalid for TImode. The
> following seems to cure the testcase; untested otherwise.
> 
> Index: i386.c
> ===================================================================
> --- i386.c    (revision 245685)
> +++ i386.c    (working copy)
> @@ -15877,7 +15877,7 @@ ix86_validate_address_register (rtx op)
>     be recognized.  */
>  
>  static bool
> -ix86_legitimate_address_p (machine_mode, rtx addr, bool strict)
> +ix86_legitimate_address_p (machine_mode mem_mode, rtx addr, bool strict)
>  {
>    struct ix86_address parts;
>    rtx base, index, disp;
> @@ -15899,7 +15899,8 @@ ix86_legitimate_address_p (machine_mode,
>      {
>        rtx reg = ix86_validate_address_register (base);
>  
> -      if (reg == NULL_RTX)
> +      if (reg == NULL_RTX
> +       || (GET_MODE (reg) != Pmode && mem_mode == TImode))
>       return false;
>  
>        if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))

Wouldn't it penalize other code?  E.g. if you have a TImode MEM and store from
something in XMM register, then it doesn't have to be offsetable and can use
even zero_extend in the address.

Reply via email to