[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problems with avr-gcc vers 3.0
From: |
johan.olin |
Subject: |
Re: [avr-gcc-list] Problems with avr-gcc vers 3.0 |
Date: |
Mon, 6 Aug 2001 13:55:07 -0000 |
Hi,
I got the same result when compiling with
-O3 opt. level. (which I think is used in the gcctest makefiles)
But, when I inserted some dummy code into the loop
it seems to work as exptected ....
OR,
If I declared the counter variable as 'volatile' it also
seemed OK ....
Empty loops seem to be quite a popular target
for the optimizer .......
BR : Jussi
Maurizio Ferraris <address@hidden> wrote:
> Hi,
> I just switched to avr-gcc version 3.0 and successfully recompiled all my
> old code.
> I even had a small reduction in code size.
> The problem is that the code is not working anymore.
> Looking around and trying to figure what happened, I came across this
piece
> of code.
> The delay routine is simply an empty loop from 0 to 4999. The
> implementation is something that I don't understand and I feel that it
is
> wrong.
> The counter seems to be initialized at 4999 and not at zero (ok, since it
> is not used inside the loop, it doesn't really matters), and it is
> decremented toward zero, but not by one, but by 625.
> I used the packed installation found on avrfreaks for win32, and using
the
> makefiles found in the gcctest.zip (I didn't dare change any switches ...
I
> only added my files and include directories).
> Is there something I must know?
>
> 102:../Common/Util.c **** void delay(void)
> 103:../Common/Util.c **** {
> 104:../Common/Util.c **** int counter;
> 105:../Common/Util.c ****
> 106:../Common/Util.c **** for(counter = 0; counter < 5000;
counter++)
> 347 0104 87E8 ldi r24,lo8(4999)
> 348 0106 93E1 ldi r25,hi8(4999)
> 349 .L35:
> 350 0108 8157 subi r24,lo8(-(-625))
> 351 010a 9240 sbci r25,hi8(-(-625))
> 352 010c EAF7 brpl .L35
> 355 010e 0895 ret
> 107:../Common/Util.c **** ;
> 108:../Common/Util.c **** }
>
> Thanks in advance.
> Mau.
>
>
_____________________________________________________________
> Maurizio Ferraris mailto:address@hidden
> Via Borgonuovo 27 mailto:address@hidden
> 10040 GIVOLETTO TO ITALY http://www.studioferraris.it
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
>
--
________________________________________________________________
Ilmainen Internet @ http://www.nic.fi/