An ubuntu bug is keeping me from [easily] working with the gcc source,
having that information when i finally do get started will save some
time.  I will experiment with finding out why it is picking subi
instead of inc, but I think inc should come ahead of subi in general,
so that's at least one thing I can put in a patch.

PS: is gccint.info a typo?

On Wed, Nov 12, 2008 at 4:51 PM, Marek Michalkiewicz
<[EMAIL PROTECTED]> wrote:
> The addqi3 pattern already has alternatives that use inc/dec - listed
> after the one using subi.  You could try to change the order so that
> "subi" is the last one and inc/dec is preferred, all else being equal.
> Not sure why this doesn't already work as expected in your case though,
> despite this paragraph from gccint.info:
>
>   If all the operands fit any one alternative, the instruction is valid.
>  Otherwise, for each alternative, the compiler counts how many
>  instructions must be added to copy the operands so that that
>  alternative applies.  The alternative requiring the least copying is
>  chosen.  If two alternatives need the same amount of copying, the one
>  that comes first is chosen.  These choices can be altered with the `?'
>  and `!' characters:
>
> Based on the above, it seems GCC thinks the two alternatives require the
> same amount of copying, even though subi may need more as it only works
> with r16-r31.  You could also experiment with putting `?' in the second
> alternative, to disparage "subi" slightly.
>
> Hope this helps,
> Marek
>


_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to