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

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

[avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.


From: Vesa Jääskeläinen
Subject: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.
Date: Mon, 09 May 2005 00:58:58 +0300
User-agent: Mozilla Thunderbird (Windows/20050412)

Joerg Wunsch wrote:
As Vesa Jääskeläinen wrote:

I have been debugging why Ethernut brakes in certain situations with
gcc. And found an optimizer bug.

I can't seem to find one.

Hmm... I still can :)

We can see that one compare is missing and this causes functional
change to code.


Which one is missing do you think?  The full assembler code shows all
of them:

In this clause:
        if (ppv && (*ppv != 0)) {

We are missing code for (ppv != 0), but code for *ppv != 0 is found. And
 if I pass NULL to this function it makes compare to incorrect memory
location.

If I compile it with -O0 or -O1 comparison is not omitted and it
generates working code.

--- snip ---

Don't rely on annotated disassembled code.  In your case, it seems the
optimizer moved parts of the conditionals into the function
initialization, so it was not assigned to some line number in the
debugging information.  For that reason, the annotator didn't tell you
about it.

At least from an eyeball review, the above assembler code (produced by
GCC 3.4.3 for an ATmega128 target, in case it matters) looks identical
to your C code to me.

Unfortunely I am unable to see your side of the story here. If you still
think that I am wrong here, please show where code of ppv != 0
comparison went.

Thanks,
Vesa Jääskeläinen




reply via email to

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