This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15330] inconsistent slicing on cast of int to enum
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2004 21:54:06 -0000
- Subject: [Bug c++/15330] inconsistent slicing on cast of int to enum
- References: <20040506183922.15330.sebor@roguewave.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-05-06 21:54 -------
No, the change was fully intentional.
Possible optimizations involve applying bitmasks. For example,
enum E { a=0x100 };
E foo ();
int bar () {
return foo() & 0x200;
}
can clearly be optimized away. If gcc isn't already doing such things,
then it will very likely do in the future.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15330