// PR optimization/12965
|
// PR optimization/12965
|
// Origin:
|
// Origin:
|
// Reduced testcase: Falk Hueffner
|
// Reduced testcase: Falk Hueffner
|
|
|
// This ICEd on Alpha because the reload pass emitted save/restore
|
// This ICEd on Alpha because the reload pass emitted save/restore
|
// insns around a no-return call.
|
// insns around a no-return call.
|
|
|
// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-O2" }
|
// { dg-options "-O2" }
|
|
|
template class allocator;
|
template class allocator;
|
template struct char_traits;
|
template struct char_traits;
|
template
|
template
|
typename _Traits = char_traits<_CharT>,
|
typename _Traits = char_traits<_CharT>,
|
typename _Alloc = allocator<_CharT> >
|
typename _Alloc = allocator<_CharT> >
|
class basic_string;
|
class basic_string;
|
typedef basic_string string;
|
typedef basic_string string;
|
|
|
static inline int __exchange_and_add(volatile int * __mem, int __val) {
|
static inline int __exchange_and_add(volatile int * __mem, int __val) {
|
int __result;
|
int __result;
|
asm("" : "=&r"(__result));
|
asm("" : "=&r"(__result));
|
return __result;
|
return __result;
|
}
|
}
|
|
|
template struct allocator {
|
template struct allocator {
|
allocator() throw() { }
|
allocator() throw() { }
|
allocator(const allocator &) throw() {}
|
allocator(const allocator &) throw() {}
|
};
|
};
|
|
|
template
|
template
|
struct basic_string {
|
struct basic_string {
|
typedef _Alloc allocator_type;
|
typedef _Alloc allocator_type;
|
struct _Rep {
|
struct _Rep {
|
int _M_references;
|
int _M_references;
|
void _M_dispose(const _Alloc & __a) {
|
void _M_dispose(const _Alloc & __a) {
|
if (__exchange_and_add(&_M_references, -1) <= 0)
|
if (__exchange_and_add(&_M_references, -1) <= 0)
|
_M_destroy(__a);
|
_M_destroy(__a);
|
} void _M_destroy(const _Alloc &) throw();
|
} void _M_destroy(const _Alloc &) throw();
|
};
|
};
|
struct _Alloc_hider : _Alloc {
|
struct _Alloc_hider : _Alloc {
|
_CharT *_M_p;
|
_CharT *_M_p;
|
};
|
};
|
mutable _Alloc_hider _M_dataplus;
|
mutable _Alloc_hider _M_dataplus;
|
_CharT *_M_data() const { return _M_dataplus._M_p; }
|
_CharT *_M_data() const { return _M_dataplus._M_p; }
|
_Rep *_M_rep() const {
|
_Rep *_M_rep() const {
|
return &((reinterpret_cast<_Rep *>(_M_data()))[-1]);
|
return &((reinterpret_cast<_Rep *>(_M_data()))[-1]);
|
}
|
}
|
basic_string();
|
basic_string();
|
basic_string(const _CharT * __s, const _Alloc & __a = _Alloc());
|
basic_string(const _CharT * __s, const _Alloc & __a = _Alloc());
|
~basic_string() {
|
~basic_string() {
|
_M_rep()->_M_dispose(this->get_allocator());
|
_M_rep()->_M_dispose(this->get_allocator());
|
}
|
}
|
allocator_type get_allocator() const { return _M_dataplus; }
|
allocator_type get_allocator() const { return _M_dataplus; }
|
};
|
};
|
|
|
struct Egeneric {
|
struct Egeneric {
|
void stack(const string & passage, const string & message = "") { }
|
void stack(const string & passage, const string & message = "") { }
|
};
|
};
|
|
|
struct infinint {
|
struct infinint {
|
void detruit() throw(Egeneric);
|
void detruit() throw(Egeneric);
|
template void infinint_from(T a) throw(Egeneric);
|
template void infinint_from(T a) throw(Egeneric);
|
infinint(long a = 0) throw(Egeneric) {
|
infinint(long a = 0) throw(Egeneric) {
|
try {
|
try {
|
infinint_from(a);
|
infinint_from(a);
|
} catch(Egeneric& e) {
|
} catch(Egeneric& e) {
|
e.stack("infinint::infinint", "long");
|
e.stack("infinint::infinint", "long");
|
}
|
}
|
}
|
}
|
~infinint() throw(Egeneric) {
|
~infinint() throw(Egeneric) {
|
try {
|
try {
|
detruit();
|
detruit();
|
} catch(Egeneric& e) { }
|
} catch(Egeneric& e) { }
|
}
|
}
|
};
|
};
|
|
|
struct inode {
|
struct inode {
|
string x;
|
string x;
|
infinint a, c;
|
infinint a, c;
|
infinint ea_offset;
|
infinint ea_offset;
|
inode();
|
inode();
|
};
|
};
|
|
|
inode::inode()
|
inode::inode()
|
{
|
{
|
ea_offset = 0;
|
ea_offset = 0;
|
}
|
}
|
|
|