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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|                            |avr
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |gjl at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Senthil Kumar Selvaraj from comment #5)
> This tentative patch (pending regression tests) makes the problem go away
> [...]
> @@ -9959,7 +9959,11 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code
> ATTRIBUTE_UNUSED,
>        return true;
>  
>      case MEM:
> -      *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
> +      /* MEM rtx with non-default address space is more
> +         expensive. Not expressing that results in reg
> +         clobber during expand (PR 65657). */
> +      *total = COSTS_N_INSNS (GET_MODE_SIZE (mode)
> +               + (MEM_ADDR_SPACE(x) == ADDR_SPACE_RAM ? 0 : 5));

This might lead to better code, but costs should never be a proper fix for
wrong code or ICE.

*** This bug has been marked as a duplicate of bug 63633 ***

Reply via email to