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

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

RE: [avr-gcc-list] Avr-gcc Removing Port Register Access


From: Nigel Winterbottom
Subject: RE: [avr-gcc-list] Avr-gcc Removing Port Register Access
Date: Sat, 26 Aug 2006 22:55:19 +0100

> -----Original Message-----
> From: User Tomdean
> Sent: Saturday, August 26, 2006 5:36 PM
> To: address@hidden
> Cc: address@hidden
> Subject: Re: [avr-gcc-list] Avr-gcc Removing Port Register Access
>
>

Hello, Tomdean,

> Here is a reduced application that reproduces the problem.  It may not
> be minimal.

You are correct it isn't minimal.


At first I thought "Oh No what a horrendous bug" but then reduced your code
to approx 6 lines and found that there isn't a bug at all.

This is just another case of gcc code optimisation confusing those who are
perhaps unfamiliar with the output of an optimising compiler.

gcc has spotted that the instruction immediately before the loop
[LED_OFF(7)] is exactly the same as the instruction at the end of the loop
[LED_OFF(7)], so has deleted the final LED_OFF(7); and altered the loop
branch so as to include the first LED_OFF(7).

Look closely and follow the loop's branch instruction and you'll find there
is no bug at all.

Regards

Nigel





reply via email to

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