[Bug c++/26534] [4.1/4.2 Regression] bitfield wrong optimize

mmitchel at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Apr 23 03:16:00 GMT 2006



------- Comment #6 from mmitchel at gcc dot gnu dot org  2006-04-23 03:16 -------
Generating the explicit masking operations in the front end seems to be safe,
but suboptimal.  The middle-end will not optimize code like: 

  struct A {int i : 3; };
  struct A a;
  int f() { return a.i > 3; } // Always false

unless the type of the expression "a.i" has the correct precision.  When
compiled as C code, this function is optimized appropriately, because the C
front-end uses limited-precision types to represent bitfields.


-- 


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



More information about the Gcc-bugs mailing list