egcs internal error on inline function static data

Luke Diamand lgd@virata.com
Mon Jun 28 09:36:00 GMT 1999


Summary:

egcs 1.12 (C++) on arm/aout gives a warning about inline function static
data (which is fair enough I suppose, I haven't actually checked the
standard yet) but it then crashes with an internal compiler error.

Source file causing the error:
foo.cc
======
extern void baz();
extern void bar();

inline void myfunc()
{
    static int entered = 0;
    if ( !entered )
    {
        entered = 1;
        baz();
    }
    bar();
}

void bazbar()
{
    myfunc();
}

It works fine with 'C' rather than 'C++', or with C++ on linux glibc
x86.

Reading specs from /usr/local/lib/gcc-lib/arm-aout/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
 /usr/local/lib/gcc-lib/arm-aout/egcs-2.91.66/cpp -lang-c++ -v -undef
-D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Darm
-D__arm__ -D__arm -Acpu(arm) -Amachine(arm) -D__EXCEPTIONS
-D__CHAR_UNSIGNED__ -D__ARM_ARCH_3__ -D__APCS_26__ /home/lgd/foo.cc
/tmp/ccYPpvKj.ii
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (ARM/generic)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/lib/gcc-lib/arm-aout/egcs-2.91.66/include
 /usr/local/arm-aout/include
End of search list.
 /usr/local/lib/gcc-lib/arm-aout/egcs-2.91.66/cc1plus /tmp/ccYPpvKj.ii
-quiet -dumpbase foo.cc -version -o /tmp/ccOi6B6z.s
GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release) (arm-aout)
compiled by GNU C version egcs-2.90.29 980515 (egcs-1.0.3 release).
/home/lgd/foo.cc: In function `void myfunc()':
/home/lgd/foo.cc:7: warning: sorry: semantics of inline function static
data `bool entered' are wrong (you'll wind up with multiple copies)
/home/lgd/foo.cc:7: Internal compiler error.
/home/lgd/foo.cc:7: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
/home/lgd/foo.cc:7: See <URL: http://egcs.cygnus.com/faq.html#bugreport >
for details.

Best regards!
Luke Diamand

-- 
Virata http://www.virata.com
Cambridge
Tel: +44 1223 566919      Fax: +44 1223 566915


More information about the Gcc-bugs mailing list