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 in `size_binop' at fold-const.c:1873




To whom it may concern,

Running the following version of g++ on linux-x86:

$ g++ -v
Reading specs from /usr/local/panisset/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000228 (experimental)

The following program:

class A {
public:
   A();
   ~A();
};

class B {
public:
  unsigned int entries() const; // change this to "int" and error goes away
};

class C
{
public:
  A * getMembers();
  B *b;
};

A * C::getMembers()
{
  return new A[b->entries()];
}

generates an internal compiler error:

$ g++ -c foo.C
foo.C: In method `A *C::getMembers ()':
foo.C:21: Internal compiler error in `size_binop', at
foo.C:21: fold-const.c:1873
foo.C:21: Please submit a full bug report.
foo.C:21: See <URL:http://www.gnu.org/software/gcc/bugs.html>
foo.C:21: for instructions.

If you change the return type of B::entries() to "int", then the
error goes away.

Hopefully this is the right place to report bugs against the CVS
code tree...


Jean-Francois Panisset                                panisset@discreet.com
Software Engineer
Discreet Logic 

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