c/7289: wrong code generated for switch statement

blair.kelly@att.net blair.kelly@att.net
Mon Jul 29 01:49:00 GMT 2002


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;
    }
}



More information about the Gcc-bugs mailing list