On Wed, Oct 03, 2007 at 12:23:46AM +0530, Royce Pereira wrote:
> 
> Why then was the empty 'ret' function retained?
> I would think such a case would be the prime candidate for
> optimisation.  The compiler should eliminate such a funtion, as well
> as all calls to that function.  That would really make a difference in
> size/speed of the code.
> 
> (Instead, the compiler destroys a perfectly good delay loop I've used
> for the last 2 years -yes, I'm still sore)

So? Why did *you* change compilers if the old one did what you wanted?
If it doesn't do what you want then its your choice whether to change
your code to conform or to revert to the compiler that did what you
want.

So says one who still maintains a project using the same C compiler from
1994.

*Always* archive the tools with your source code.

> Of course, there's no disputing that. But the delay loop is just an
> example, of how simple ,intuitive code can throw the compiler into a
> tizzy. I've used SDCC(for mcs51) where the compiler 'recognises' code
> patterns, and says "Oh, I know what this is - it's a delay loop! - Let
> it pass."(for example).
> 
> I've always maintained -  good software is one that does what you
> *want* it to do, *not* what you tell it to do. ;)

I'm always frightened when someone thinks they know better what I want
than what I said. Even more frightened when someone claims *software*
knows better.

Avr-gcc *has* a delay loop that the compiler recognizes and leaves
alone. You've been told about <util/delay_basic.h> yet you have written
more email than the amount of code you would have to change to use it.

-- 
David Kelly N4HHE, [EMAIL PROTECTED]
========================================================================
Whom computers would destroy, they must first drive mad.


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to