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]

Internal error in egcs-2.90.29 980515 (egcs-1.0.3 release)



I hereby have the dubious pleasure of reporting an "internal error" in
the above compiler, at least under Red Hat Linux 5.1 (x86) when ecgs
is installed from pre-compiled binaries.  The error is encountered
when compiling the following C++ source file using g++:

   double f1( double a=0.3 )  {  return 0; }
    
   template<class T> struct C1 {
     virtual operator++();  
   };
    
   template<class T> struct C2 : public C1<T> {
     C2() {}                
     operator++() { f1(); } 
   };
    
   void f2( void )
   {
     double b=0.3;   
     C2<int> c;      
     ++c;            
   }

Just about everything in this example is required in order to
reproduce the bug; if the values of the two constants differ or any of
the various hierarchy levels are omitted, the code compiles normally.
As it stands above, when I attempt to compile a file crash.c which
contains only those lines, I get:

  fussy:~> g++ --version
  egcs-2.90.29 980515 (egcs-1.0.3 release)
   
  fussy:~> g++ -c crash.c
  crash.c: In method `int C2<int>::operator ++()':
  crash.c:20: internal error--unrecognizable insn:
  (insn 13 11 15 (parallel[ 
  	      (set (mem:DF (pre_dec:SI (reg:SI 7 %esp)))
  		  (UnKnown Unknown))
  	      (clobber (scratch:SI))
  	      (clobber (scratch:SI))
  	  ] ) -1 (nil)
      (nil))
  crash.c:20: confused by earlier errors, bailing out

If I delete the "C2() {}" line, I get a different message, equally bad:

  fussy:~> g++ -c crash.c
  crash.c: In method `int C2<int>::operator ++()':
  crash.c:20: Internal compiler error.
  crash.c:20: Please submit a full bug report to `egcs-bugs@cygnus.com'.

I get the same messages from g++ in egcs-2.90.27 980315 (egcs-1.0.2
release) but the g++ included with GCC 2.7.2.1 works fine:

  stout:~> g++ --version
  egcs-2.90.27 980315 (egcs-1.0.2 release)

  stout:~> g++ -c crash.c
  crash.c: In method `int C2<int>::operator ++()':
  crash.c:20: internal error--unrecognizable insn:
  (insn 13 11 15 (parallel[ 
  	      (set (mem:DF (pre_dec:SI (reg:SI 7 %esp)))
  		  (UnKnown Unknown))
  	      (clobber (scratch:SI))
  	      (clobber (scratch:SI))
  	  ] ) -1 (nil)
      (nil))
  crash.c:20: confused by earlier errors, bailing out


  bitter:~> g++ --version	 
  2.7.2.1			 

  bitter:~> g++ -c crash.c 
  bitter:~> 

Please let me know if you need any more specifics.  

Thanks,

Jim Bednar
jbednar@cs.utexas.edu




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