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 compiler error


Hello,
I got the following from egcs last night:

[Duncan@snowflake matrix]$ g++ -Wall main.cpp
main.cpp:5: warning: return type for `main' changed to `int'
main.cpp: In method `vector<vector<double,__default_alloc_template<true,0> >,__default_alloc_template<true,0> >::vector(unsigned int)':
main.cpp:21: Internal compiler error.
main.cpp:21: Please submit a full bug report to `egcs-bugs@cygnus.com'.
[Duncan@snowflake matrix]$ 

The version of egcs in use is:
	gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
built with --enable-shared  
and is the sole C/C++ compiler on an Intel x86 RedHat linux v5.0 (kernel 
2.1.106) system.

The program being compiled (main.cpp) is given below with obvious (and 
deliberate) error as marked.  Twice this compiled and as expected segfaulted 
on execution but on the third compile it produced the above.

I don't know if this is of any use but since I was asked nicely for a bug 
report, here it is.

Duncan
(djf95@aber.ac.uk)
----------------------------------------

#include <vector>
#include <iostream>

bool main()
{
  const long rows=10;
  const long cols=2;
  vector<vector<double> > fred(rows);

  for (int i=0;i<rows;i++)
    {
      fred[i].reserve(i);  //Obvious error i=0 and i=1 do not result in fred[0][1] etc.
      fred[i][0]=i;
      fred[i][1]=i*i;
      cout << i << " : " << fred[i][0] << " , " << fred[i][1] << "\n";
    }

return true;
}





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