http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57482

            Bug ID: 57482
           Summary: --help=optimizers reports a wrong list
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christophe.beausoleil at sogeti dot com

Hello,

I am using GCC 4.7.3 built for AVR targets on a Linux machine. The command :
avr-gcc -mmcu=atmega128 -O1 -Q --help=optimizers
returns a list of enabled options for the -O1 optimization level.

Among these enabled options is :
 -fshort-enums                         [enabled]

However, I can see that this option is not enabled by -O1. I simply did :
typedef enum {val1, val2} Tenum;
Tenum Venum;

I compile with :
avr-gcc -mmcu=atmega128 -O1 test.c -o test.elf

and check Venum size with :
avr-nm -S test.elf | grep Venum

which gives :
00800109 00000002 B Venum

I have to explicitly use -fshort-enums in my command line in order that GCC
takes it into account :
00800109 00000001 B Venum

I must also add that the problem is the same for -00 and -02.

The question is : how can I know which options are effectively enabled or not ?
Can I easily find the answer in source code ?

Thanks a lot for reading till here and for any support !

Best regards

Christophe

Reply via email to