[Top][All Lists]

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

Re: [avr-gcc-list] Optimiser bloats code

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Optimiser bloats code
Date: Wed, 1 Aug 2007 22:19:35 +0200 (MET DST)

"Dave Hylands" <address@hidden> wrote:

(integer promotion on function return values)

>> Why? Is this a bug or a feature? Am I doing something wrong or is
>> an u08 return always promoted to an int?

> This is what the C Language specification says it must do, so that's
> what gcc does.

Well, the C language specification is an `as if' rule: the compiler
must behave as if it were promoting it to `int'.  This leaves it the
freedom to not really promote it if it can recognize it's not

However, early in the game of AVR-GCC, those who implemented it
thought it would be useful to have the callee already perform the
integer promotion, so the caller can use word instructions.  In
retrospect, this was probably not the most lucky decision, but the ABI
is set into stone right now, at least until the day we have to break
it for other reasons.  That day will be a major version bump for

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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