[Top][All Lists]

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

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re "nake

From: Georg-Johann Lay
Subject: Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re "naked."
Date: Fri, 27 Jan 2012 12:23:40 +0100
User-agent: Thunderbird (X11/20100302)

William "Chops" Westfield wrote:
> On Jan 26, 2012, at 2:10 PM, Georg-Johann Lay wrote:
>> I tested the code with avr-gcc 4.5 and command line options -Os -mmcu=atmega8
>> With the attributes, the object size is 54 bytes.
>> Without the attributes the object size is 64 bytes.
> 4.5.3 ?  Whatever this issue is, it apparently snuck in between 4.5.2 and 
> 4.5.3.

The only remarkable difference between 4.5.2 and 4.5.3 is the fix of PR42240.
Depending on what distribution you use, your distributor added more patches, so
we don't know.

> and more substantial diffs, including the following.
>   "naked" deletes the prolog, but adds instructions in the body... 
> -.LM7:
> +.LSM6:
>       ldi r24,lo8(5)
> -     rjmp .L8
> +     rcall putch
> +     rjmp .L4
>  .L3:
> -.LM8:
> +.LSM7:
>       cpi r24,lo8(-127)
>       brne .L5
> -.LM9:
> +.LSM8:
>       ldi r24,lo8(4)
> -     rjmp .L8
> +     rcall putch
> +     rjmp .L4
>  .L5:
> -.LM10:
> +.LSM9:
>       ldi r24,lo8(3)

Some of the diff noise is because of different debug symbols/labels; Hunans see
more without -g because of reduces debug info noise.

The other changes look reasonable with fix PR42240.

You may also want to have a look at OS_task and OS_main function attributes.

If an older toolchain works better for you, maybe you are fine with the older


reply via email to

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