Article View: gnu.gcc.bug
Article #268bug in gcc handling of C switch cases with -O?
From: Terry Jones
Date: Wed, 05 Aug 1992 20:37
Date: Wed, 05 Aug 1992 20:37
28 lines
1527 bytes
1527 bytes
gcc 2.2.2 (at least this is the output from gcc -v) on a SPARC 1+ with sunos 4.1.1 i don't read this newsgroup and don't have access to news right now, so please forgive me if this is well-known and also please Cc a copy of your reply to terry@santafe.edu i have a piece of C code with a switch statement that switches on a variable that is an enum type. gdb shows me that the value of the variable is x but in the switch it goes to the case for y (there is a case for x). this happens when i use -O and not when i don't. the regular sun cc doesn't make the error (though i haven't tried it with -O). to be more specific, the problem happens when i add -O to the following gcc options and not without: -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Waggregate-return -ggdb i cut my program down to a mini example to try and reproduce the problem in a small example, but the problem went away. before i invest more time on this, i'd like to know if it is already a known problem. if not, i'll do something to get you a small example. regards & thanks, terry jones.
Technical Details
Message-ID:
<9208052037.AA21344@sfi.santafe.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!santafe.edu!terryShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!santafe.edu!terry From: terry@santafe.edu (Terry Jones) Subject: bug in gcc handling of C switch cases with -O? Message-ID: <9208052037.AA21344@sfi.santafe.edu> Sender: gnulists@ai.mit.edu Organization: Computer Science, Indiana University Distribution: gnu Date: Wed, 5 Aug 1992 20:37:24 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 29