This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28045] Bitfield, &&, and optimization => bad code generation
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jun 2006 22:06:49 -0000
- Subject: [Bug c/28045] Bitfield, &&, and optimization => bad code generation
- References: <bug-28045-12835@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-06-17 22:06 -------
Reduced testcase:
struct a
{
unsigned int bits : 1;
signed long val : ((sizeof(long) * 8) - 1);
};
int Fnegate (struct a b)
{
if ((-((long)b.val)) <= ((long) ((1UL << (((sizeof(long) * 8) - 1) - 1))
-1UL)) && (-((long)b.val)) >= (-(((long) ((1UL << (((sizeof(long) * 8) - 1) -
1)) -1UL))) - 1))
return 0 ;
abort ();
}
int main ()
{
struct a b = {1, 1};
Fnegate (b);
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045