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

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

Re: [avr-gcc-list] Problems with avr-gcc vers 3.0


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Problems with avr-gcc vers 3.0
Date: Mon, 13 Aug 2001 11:35:24 +0200 (MET DST)

Jason Kyle <address@hidden> wrote:

> See the earlier posts regarding redundant loop optimisations, as I 
> understand it this is gcc related and not specific to the avr port.

It is specific to the AVR target.  If you generate code with the same
gcc (same source tree) for another target (like the i386), the same C
program doesn't compile into this gratituous ``subtract 625 per each
loop iteration'' assembler code, but just subtracts one per loop
iteration as one would expect from it (and as previous gcc versions
did).

Technically, the compiler is free to substract 625 or anything else,
or to not execute the loop at all, or to execute it completely (since
optimization is beyond the scope of the C standard).  However, i think
it completely violates POLA to subtract /arbitrary/ values like 625.
POLA would be to either execute the loop step by step (as gcc used to
do all the time), or to at least optimize the loop completely away.

I have yet to find /where/ in the compiler source code this funny 625
originates from...

-- 
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]