[Bug c/69669] [5/6 Regression] ICE with enum __attribute__((mode(QI)))

bernd.edlinger at hotmail dot de gcc-bugzilla@gcc.gnu.org
Thu Feb 4 20:26:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69669

--- Comment #4 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
it is pretty much completely broken also long before gcc-5:

typedef enum __attribute__((mode(QI))) e
{
  e1 = 1,
  e2 = 2
} ee;

ee x;
int y;

int test()
{
  y=sizeof(x);
  return x == e1;
}

in "C" sizeof(x) == 4, and test returns always(!) 0

in "C++" mode(QI) is simply ignored.

I think, that what I wanted can be done by

typedef enum __attribute__((packed))
{
  e1 = 1,
  e2 = 2
} ee;

which seems to work as expected in "C" and "C++".

It would be OK for me, if C and C++ would just emit an error if
the mode attribute is not supported.


More information about the Gcc-bugs mailing list