This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16372] New: Wrong code for enums
- From: "schuele at informatik dot uni-kl dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2004 18:56:04 -0000
- Subject: [Bug c++/16372] New: Wrong code for enums
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
there still seems to be a problem with enums in GCC 3.4.1 (see bug #15069).
When you compile the follwing snippet with -O0, everthing works well. However,
with -O1, the output is "234" which is wrong. Sorry, if this is a duplicate
bug report, but I assumed it would be fixed in GCC 3.4.1. Thanks for your
help.
Regards,
Tobias
#include <iostream>
enum number {ZERO, ONE, TWO, THREE, FOUR, FIVE};
int main() {
number n = FIVE;
if((n == ONE) || (n == TWO) || (n == THREE)) {
std::cout << "234" << std::endl;
}
}
--
Summary: Wrong code for enums
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schuele at informatik dot uni-kl dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16372