This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16372] New: Wrong code for enums


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]