[Bug optimization/11121] New: function prototypes, function pointers and -O3

gwaidzai@yahoo.com.hk gcc-bugzilla@gcc.gnu.org
Sat Jun 7 08:15:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11121

           Summary: function prototypes, function pointers and -O3
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gwaidzai@yahoo.com.hk
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The program below will cause an internal compiler error when compiled with gcc 
3.4:

Reading specs from /home/root/tools/usr/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc-work/configure --prefix=/home/root/tools/usr 
--with-sysroot=/home/root/tools 
--with-ld=/home/root/tools/usr/i686-pc-linux-gnu/bin/ld 
--with-as=/home/root/tools/usr/i686-pc-linux-gnu-as --disable-nls 
--enable-shared --with-clocale=gnu --enable-languages=c,c++ 
--enable-threads=posix --enable-__thread --enable-__cxa_atexit
Thread model: posix
gcc version 3.4 20030531 (experimental)

with the -O3 flag.
(this gcc is compiled against glibc cvs as of 20030531)

This is the program:
---------------
int fn2 (void);

int fn1 (int (* const fn) (void)) {return fn ();}

int main (void) {return fn1 (fn2);}

int fn2 (void) {return 0;}
---------------

Thanks



More information about the Gcc-bugs mailing list