[Top][All Lists]

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

Re: [avr-gcc-list] compiler function prologue/epilogue incorrect?

From: craig
Subject: Re: [avr-gcc-list] compiler function prologue/epilogue incorrect?
Date: Thu, 28 Sep 2006 09:42:20 +0200
User-agent: Mutt/1.4.1i

Hi Michal

> can you describe what problem are you having? I had some stability problems
> recently when I used 16MHz crystal instead of 8MHz and I also suspected the
> function prolog/epilog. The program started to crash randomly after crystal
> change.

I use a 7.x MHz crystal. The problem I was seeing (before I told the compiler
not to inline a bunch of stuff) was that on exit from a given routine the
application seemed to revert to a startup state which seemed to suggest
stack corruption to me i.e. the return address or something had been corrupted
but I haven't added debug code yet to try to ascertain what state the stack
was/is in just before it exited the routine so it's pure speculation at this

Compiling with winavr 20040404 (gcc 3.3.2) made the application work. It
didn't work when compiled with avr-gcc 4.1.0, 3.4.1 or 3.4.3 or 3.4.6.
Telling 3.4.3 not to inline stuff fixed it and I suspect the other compiler
versions would be happy with that too but I haven't retested with them yet.

I'm hoping to get some time next week to dig into the assembly in more
detail as I'm uncomfortable with the current "fix" and I'd like to know
what the real problem is ...



reply via email to

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