[Patch,AVR] Housekeeping insn attributes & remove assembler dialect

Denis Chertykov chertykov@gmail.com
Mon Oct 17 17:35:00 GMT 2011


2011/10/17 Georg-Johann Lay <avr@gjlay.de>:
> This is more code clean-up for insn attributes.
>
> It removes "mcu_have_movw", "mcu_mega" and defines "enabled" and "isa"
> attributes instead.
>
> The "isa" attribute which triggers "enabled" is a replacement for AVR_HAVE_MOVW
> assembler dialect.  We don't actually support assembler dialects but different
> ISAs so that an attribute that reflects ISA capabilities seems more appropriate
> and straight forward here. Moreover, it's easier to write down different
> instruction lengths (which wouldn't occur if it was just an assembler dialect).
>
> The only notable change is to epilogue_restores:
>
>    (set (reg:HI REG_Y)
>         (plus:HI (reg:HI REG_Y)
>                  (match_operand:HI 0 "immediate_operand" "i,i")))
> -   (set (reg:HI REG_SP)
> -        (reg:HI REG_Y))
> +   (set (reg:HI REG_SP)
> +        (plus:HI (reg:HI REG_Y)
> +                 (match_dup 0)))
>
> The original code does not quite represent what the insn does:
>
> A PARALLEL's actions all happen simultaneously, not in sequence.
> Thus, an instruction sequence like
>    Y  = Y + const
>    SP = Y
> has wo be written in RTL as
>    Y  = Y + const
>    SP = Y + const
> and *not* as
>    Y  = Y + const
>    SP = Y
>
> The patch passes without regressions.
>
> The patch passes with 2 more regressions if the test suite is run with
> -mcall-prologues, but the two additional run-fails
>        ./gcc.dg/sibcall-3.c
>        ./gcc.dg/sibcall-4.c
> are because tail call optimization is turned off at -mcall-prologues,
> see avr.c:avr_function_ok_for_sibcall().
>
> Ok for trunk?
>

Approved.

Denis.



More information about the Gcc-patches mailing list