This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30332] bit-field: optimization BUG?
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2007 05:29:10 -0000
- Subject: [Bug c++/30332] bit-field: optimization BUG?
- References: <bug-30332-10812@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from bangerth at dealii dot org 2007-01-21 05:29 -------
No, that's not the case. We can print the types:
-------------
#include <stdio.h>
#include <iostream>
#include <typeinfo>
struct S
{
unsigned int long long a:33;
};
int main ()
{
struct S x = { -1 };
typeof(+x.a) z = x.a+10;
printf("%llx\n", z);
std::cout << typeid(x.a).name() << ' ' << typeid(z).name()
<< std::endl;
return 0;
}
--------------
g/x> ./a.out
200000009
y y
g/x> c++ x.cc -O2
g/x> ./a.out
9
y y
'y' apparently encodes unsigned long long.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-01-21 05:29:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30332