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]

Re: c/7289: wrong code generated for switch statement


I believe the following code demonstrates the
problem discussed in c/7289.

Reading specs from
/home/bfkelly/public/gcc-3.1.1/SunOS/lib/gcc-lib/sparc-sun-solaris2.8/3.1.1/specs
Configured with: ../gcc-3.1.1/configure
--enable-languages=c
--prefix=/home/bfkelly/public/gcc-3.1.1/SunOS
Thread model: posix
gcc version 3.1.1

/* 
Produces undefined symbol .LL10 in object file
when compiled with NO optimization.

 gcc-3.1.1 -O2 -c foo.c
 nm foo.o

 gcc-3.1.1 -c foo.c
 nm foo.o 

*/
  
void foo(a, b)
int     a;
int     b;
{
    switch (a)
    {
    case 0:
    case 1:
    case 2:
    case 4:
    case 5:
        break;
    case 3:
        if (b == 0) {
            ;
        }
        break;
    }
}


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