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

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

RE: [avr-gcc-list] Endless loop: uchar c; for (c=1; c; c++)


From: Eric Weddington
Subject: RE: [avr-gcc-list] Endless loop: uchar c; for (c=1; c; c++)
Date: Tue, 06 Mar 2007 20:18:46 -0700

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Dmitry K.
> Sent: Tuesday, March 06, 2007 7:31 PM
> To: address@hidden
> Subject: Re: [avr-gcc-list] Endless loop: uchar c; for (c=1; c; c++)
> 
> On Wednesday 07 March 2007 04:10, Eric Weddington wrote:
> [...]
> > It seems that when compiling to assembler (-S as Dmitry 
> recommends above),
> > then you'll note that the epilogue is set to noreturn, 
> which also ends up
> > taking out the final breq of the outer loop, as there is 
> nothing to branch
> > to anymore.
> >
> > However, when I compile and assemble, and I look at a 
> requested listing
> > from the assembler (basically using the WinAVR Makefile 
> Template), the code
> > looks fine. An epilog exists, and the correct end condition 
> for the loop is
> > in the code. This is also the case when I do a disassembly 
> on the object
> > code (avr-objdump -d <object>); the code looks fine, an 
> epilog exists, and
> > the branch is in the code.
> >
> > Does anyone have an idea why using avr-gcc -S ... would be 
> so different
> > then the actual code generated (as compared to the disassembly)?
> 
> I try to compile without `-S' option: result is the same.

Going back to your original code, see the resulting attached files:
bug.lst - The assembler listing after compiling and assembling
bug.dis - The disassembled output from avr-objdump -d bug.o

These files are generated with avr-gcc 4.1.1 and using -Os.

I still don't see a bug where it goes into an infinite loop. To me it looks
like that it will eventually break out of the outer loop.

Eric

Attachment: bug.lst
Description: Text document

Attachment: bug.dis
Description: Binary data


reply via email to

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