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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|AVR ATmega128               |avr
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-04
                 CC|                            |gjl at gcc dot gnu.org
          Component|c                           |other
     Ever confirmed|0                           |1
              Build|4.7.3                       |

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
I can confirm this with 4.7.2 and the following source file

== foo.c ==

typedef enum { A, B } ab_t;

int a[sizeof (ab_t) == 2 ? 1 : -1];

== compile ==

$ avr-gcc foo.c

$ avr-gcc foo.c -Q --help=optimizers | grep short.enum
  -fshort-enums                   [enabled]

== issues ==

1) foo.c compiles fine, thus enums are 2 byte per default.
   This shows the output of --help=optimizers is not correct.

2) -f[no-]short-enums is not an optimization option;
   it's an option affecting the ABI.  Better / worse code
   is just a side effect of respective ABI change.

3) The backend does not implement TARGET_DEFAULT_SHORT_ENUMS
   thus the default shall be like with  -fno-short-enums, cf.
   target.def defines the hook default to hook_bool_void_false.

Reply via email to