Internal compiler error: static data in inline member

Peter Verthez verthezp@nmasd.bel.alcatel.be
Wed Jun 30 00:05:00 GMT 1999


Hello,

I encountered the following error (originally found while compiling
mico, but reproduced here in a small source file):

> g++ -v
Reading specs from
/usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

> cat egcsbug.cc
class myclass {
 public:
  static myclass* instance() {
    static myclass* p = 0;
    if (!p)
      p = new myclass;
    return p;
  };
};

int main()
{
  myclass* inst = myclass::instance();
  return 0;
}

> g++ -c egcsbug.cc -o egcsbug
egcsbug.cc: In function `static class myclass * myclass::instance()':
egcsbug.cc:4: warning: sorry: semantics of inline function static data
`class myclass * p' are wrong (you'll wind up with multiple copies)
egcsbug.cc:4: Internal compiler error.
egcsbug.cc:4: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
egcsbug.cc:4: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for
details.

> g++ -dumpspecs
*asm:


*asm_final:


*cpp:
%{!mpa-risc-1-0:%{!mnosnake:%{!msoft-float:-D__hp9000s700
-D_PA_RISC1_1}}}  %{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE}
%{threads:-D_REENTRANT -D_DCE_THREADS}

*cc1:
%{pg:} %{p:}

*cc1plus:


*endfile:


*link:
%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z
%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}

*lib:
%{!shared:     %{!p:       %{!pg:         %{!threads:-lc}        
%{threads:-lcma -lc_r}}       %{p: -L/lib/libp/ -lc}       %{pg:
-L/lib/libp/ -lc}}}

*libgcc:
-lgcc

*startfile:
%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}

*switches_need_spaces:


*signed_char:
%{funsigned-char:-D__CHAR_UNSIGNED__}

*predefines:
-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix
-Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa)

*cross_compile:
0

*version:
egcs-2.91.66

*multilib:
. ;

*multilib_defaults:


*multilib_extra:


*multilib_matches:


*linker:
collect2



Best regards,
Peter.
-- 
____________________________________________________________________
Peter Verthez                        mailto:Peter.Verthez@alcatel.be
Software Engineer Network Mgt.     Tel: (+32 3) 451 28 14 | Alcanet:
Alcatel Telecom, dept. XE61        Fax: (+32 3) 451 28 03 | (6)2681
____________________________________________________________________
I don't know with what weapons World War III will be fought, but
World War IV will be fought with sticks and stones.
                                                         Einstein


More information about the Gcc-bugs mailing list