[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Compiler bug ?
From: |
Denis Chertykov |
Subject: |
Re: [avr-gcc-list] Compiler bug ? |
Date: |
19 Apr 2003 21:40:57 +0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Marek Michalkiewicz <address@hidden> writes:
> On Fri, Apr 18, 2003 at 11:10:54AM -0600, E. Weddington wrote:
> > Well it looks like the bug is still there in the 20030414 snapshot of
> > GCC 3.3. I get the same output as before.
> >
> > I'm willing to wait for next week's snapshot to see if this can be
> > resolved.
>
> Commenting out the whole "*cmpqi_sign_extend" insn in avr.md fixes
> the bug, but makes inefficient code (the 8-bit value is sign-extended
> to 16 bits and compared with -20 as a 16-bit value, when an 8-bit
> compare would be much cheaper). The following works better:
>
> --- avr.md 28 Sep 2002 14:14:12 -0000 1.38
> +++ avr.md 18 Apr 2003 22:17:02 -0000
> @@ -1636,10 +1636,10 @@
> (define_insn "*cmpqi_sign_extend"
> [(set (cc0)
> (compare (sign_extend:HI
> (match_operand:QI 0 "register_operand" "d"))
> - (match_operand:HI 1 "immediate_operand" "M")))]
> - ""
> + (match_operand:HI 1 "const_int_operand" "n")))]
------------------------------------------------------------^
Why not "M" ?
> + "INTVAL (operands[1]) >= -128 && INTVAL (operands[1]) <= 127"
> "cpi %0,lo8(%1)"
> [(set_attr "cc" "compare")
> (set_attr "length" "1")])
>
>
> I'm not committing this just yet, as Denis may suggest a better
> fix...
Why not "M" ?
Denis.
Re: [avr-gcc-list] Compiler bug ?, E. Weddington, 2003/04/16