avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] ldd Y+const not working, bug?


From: Erik Christiansen
Subject: Re: [avr-gcc-list] ldd Y+const not working, bug?
Date: Mon, 8 Nov 2004 14:46:26 +1100
User-agent: Mutt/1.5.6+20040722i

On Mon, Nov 08, 2004 at 12:16:18AM +0100, Klaus Rudolph wrote:
> why the following code did not compile:

...

>    std Y+10-1, r17                 ;1
>    std Y+(table2-table1)-1, r17    ;2

Klaus,

   There are a number of cases that have been found to fail. In the
avr-gcc archive there is some discussion of this:

"Date: Thu, 11 Sep 2003 12:23:06 +1000
Subject: It is more than: .byte SYMA - SYMB"

   following on from:

"On Tue, May 27, 2003 at 11:19:48AM +0200, Joerg Wunsch"
(Sorry, I don't have the subject of the OP)

   Unfortunately neither we the users, nor the maintainers, have been
sufficiently motivated to fix the problem. Finding that the relevant
code in gcc was hand-knitted parsing, rather than a nice approachable
BNF grammar, a la yacc, I beat a hasty retreat last time.

> is_constant:
>    ldi r16, (table2-table1)-1      ;3
> -----

   Discouraged by the failure of ldd, I hadn't found that this case
works. It seems to confirm two things:

   o  You're right, it is a genuine bug, not a systematic feature
      omission.

   o  It's not so easy to maintain consistency in hand-crafted parsers.

   Without the self documenting nature of a formal grammar, and no known
documentation on the status quo, there remains only the hard way, I
think. Still, if we can find where ldi handles it OK, we can patch it
into the parser branch that stuffs up.

   I'll have a look again, armed with the knowledge that the fix already
exists elsewhere in the code, but can't promise anything.

Erik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]