------- Comment #5 from reichelt at gcc dot gnu dot org 2005-11-29 19:03
-------
Confirmed.
Here's a reduced testcase.
Compile with "g++ --param ggc-min-expand=0 --param ggc-min-heapsize=0".
================================================================
template<int, int, int> struct Dummy;
void dummy();
namespace std
{
template<typename> struct A;
template<typename> struct B;
template<typename, typename> struct E {};
template<typename, typename> struct F;
template<typename T, typename U = B<T> > struct F : virtual E<T, U>
{
template<typename V> friend F<T, V>& operator<< (F<T, V>&, const char*);
};
template<typename, typename, typename> struct G;
template <typename T, typename U = B<T>, typename = A<T> >
struct G : F<T, U> {};
typedef F<char> F1;
typedef G<char> G1;
}
namespace N
{
template<typename> struct X;
template<typename> struct Y {};
typedef X<const int*> X1;
typedef X<int> X2;
std::F1& operator<< (std::F1&, const X1&);
std::F1& operator<< (std::F1&, const X2&);
template<typename> struct X
{
static Y<int> foo();
friend std::F1& operator<< (std::F1&, const X1&);
friend std::F1& operator<< (std::F1&, const X2&);
};
template<typename T> Y<int> X<T>::foo()
{
std::G1 g;
g <<
"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
}
}
================================================================
It's a garbage collection related problem.
Took ages to cut that one down.
On i686-pc-linux-gnu and x86_64-unknown-linux-gnu the testcase crashes
the 4.1 branch and mainline (but not 4.0.x).
If I add "-m32" on x86_64-unknown-linux-gnu, the testcase crashes
4.0.x and mainline (but not the 4.1 branch).
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |GC, ice-on-valid-code,
| |monitored
Last reconfirmed|0000-00-00 00:00:00 |2005-11-29 19:03:48
date| |
Summary|ICE on returning a variable |[4.0/4.1/4.2 regression] ICE
|in a static templated member|with garbage collection
|function |
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24173