1 // PR optimization/12965
2 // Origin: <qboosh@pld-linux.org>
3 // Reduced testcase: Falk Hueffner <falk@debian.org>
5 // This ICEd on Alpha because the reload pass emitted save/restore
6 // insns around a no-return call.
9 // { dg-options "-O2" }
11 template <typename _Alloc> class allocator;
12 template <class _CharT> struct char_traits;
13 template <typename _CharT,
14 typename _Traits = char_traits<_CharT>,
15 typename _Alloc = allocator<_CharT> >
17 typedef basic_string<char> string;
19 static inline int __exchange_and_add(volatile int * __mem, int __val) {
21 asm("" : "=&r"(__result));
25 template<typename _Tp> struct allocator {
26 allocator() throw() { }
27 allocator(const allocator &) throw() {}
30 template<typename _CharT, typename _Traits, typename _Alloc>
32 typedef _Alloc allocator_type;
35 void _M_dispose(const _Alloc & __a) {
36 if (__exchange_and_add(&_M_references, -1) <= 0)
38 } void _M_destroy(const _Alloc &) throw();
40 struct _Alloc_hider : _Alloc {
43 mutable _Alloc_hider _M_dataplus;
44 _CharT *_M_data() const { return _M_dataplus._M_p; }
45 _Rep *_M_rep() const {
46 return &((reinterpret_cast<_Rep *>(_M_data()))[-1]);
49 basic_string(const _CharT * __s, const _Alloc & __a = _Alloc());
51 _M_rep()->_M_dispose(this->get_allocator());
53 allocator_type get_allocator() const { return _M_dataplus; }
57 void stack(const string & passage, const string & message = "") { }
61 void detruit() throw(Egeneric);
62 template<class T> void infinint_from(T a) throw(Egeneric);
63 infinint(long a = 0) throw(Egeneric) {
66 } catch(Egeneric& e) {
67 e.stack("infinint::infinint", "long");
70 ~infinint() throw(Egeneric) {
73 } catch(Egeneric& e) { }