avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [Bug #3184] XCALL resolved incorrectly in avr5/libc.a


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [Bug #3184] XCALL resolved incorrectly in avr5/libc.a
Date: Fri, 11 Apr 2003 13:38:16 +0200
User-agent: Mutt/1.2.5i

As Marek Michalkiewicz wrote:

> On Fri, Apr 11, 2003 at 12:07:19PM +0200, Joerg Wunsch wrote:
> > . the library compilation cannot decide whether the device supports
> >   the ELPM instruction (not all avr5 devices do support it)
> 
> If all uses of ELPM are limited to gcrt1.S and include files, that
> should be no big problem.

I know, that's the way it is now.

> GCC itself does not use ELPM at all, and puts "progmem" data at low
> addresses, avoiding the use of inefficient 24-bit pointers, and
> still leaving the upper 64K for executable code - looks like a good
> compromise to me.

But that prevents people from using > 64 KB of constant »progmem«
data.  I think an option to allow for this would be nice (like
-mlarge-model or something like that), in case someone really needs
huge tables in flash ROM, with only little code.  Of course, it should
be off by default.

> > . the assembler disallows absolute jump/call instructions for the
> >   ATmega8 even though this device supports them (but doesn't require
> 
> Have you tested if the JMP/CALL opcodes work on a real ATmega8 chip?

At least, it's documented in the datasheet.

> >   them -- wouldn't your suggested change even cause absolute jump/call
> >   to be used on the ATmega8 then?)
> 
> No, because for GCC, ATmega8 is not really considered "mega" :-)

Ah, OK...

Are you going to commit that, and close the bug report?

> This should be solved now.  It went unnoticed for so long because
> the C preprocessor considers the "FLASHEND > 0x2000" condition to
> be false if FLASHEND is not defined, without any warning...

Sure, that's a feature.  Any undefined macro is considered to have the
value 0 when being referenced.  That's a requirement of the standard.
This way, you can write something like

#if DEBUG

...and if nobody defines DEBUG, it will evaluate to false.
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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