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 ropeimpl.h, 2.96



$ gcc -v
Reading specs from /usr/local/bin/../lib/gcc-lib/i386-pc-linux-gnu/2.96/specs
gcc version 2.96 20000605 (experimental)

I have previously reported in GNATS (assigned bug ID c++/210) that the
following program:

#include <rope>

class foo
{
  public:
  foo() {};
  const rope<char> bar;
};

causes an internal compiler error:

$ g++ -c ropeorig.C 
/usr/local/include/g++-3/ropeimpl.h: In method `void
_Rope_RopeRep<_CharT, _Alloc>::_M_free_tree () [with _CharT = char,
_Alloc = allocator<char>]':
/usr/local/include/g++-3/stl_rope.h:504:   instantiated from here
/usr/local/include/g++-3/ropeimpl.h:334: Internal compiler error.
/usr/local/include/g++-3/ropeimpl.h:334: Please submit a full bug report.
/usr/local/include/g++-3/ropeimpl.h:334: See <URL:http://www.gnu.org/software/gcc/bugs.html> for
instructions.


Since #include <rope> brings in quite a bit of code, I spent some
time reducing the test case to a more manageable size. Unfortunately,
I have not been able to add it to the GNATS entry, so for what it's worth,
here is this reduced test case:

// gcc version 2.96 20000605 (experimental) gets an internal compiler error

template<class _Char>
struct _Rope_RopeRep 
{
public:
  void _M_free_tree();
  static void _S_unref(_Rope_RopeRep* __t)
  {
    __t->_M_free_tree();
  }
};

template<class _CharT>
struct _Rope_RopeConcatenation : public _Rope_RopeRep
<_CharT>
{
};

template <class _CharT>
class rope
{
public:
  static void _S_unref(_Rope_RopeRep<_CharT>* __t)
  {
    _Rope_RopeRep<_CharT>::_S_unref(__t);
  }
  ~rope()
  {
    _S_unref(_M_tree_ptr);
  }
  _Rope_RopeRep<_CharT>* _M_tree_ptr;
};

template <class _CharT>
void _Rope_RopeRep<_CharT>::_M_free_tree()
{
  _Rope_RopeConcatenation<_CharT>* __c
    = (_Rope_RopeConcatenation<_CharT>*)this;

  __c->_Rope_RopeConcatenation<_CharT>::~_Rope_RopeConcatenation();
}

void foo()
{
  rope<char> bar;
}


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