I get the following ICE with -gstabs with gcc 4.1.2 20060901 (Debian 4.1.1-13) but not with 4.0 and 4.2. (sid)1186:tbm@em64t: ~] g++-4.1 -O -fPIC -gstabs libapt-front-state.cpp libapt-front-state.cpp: In member function ‘std::string aptFront::cache::component::State::sizeString(double)’: libapt-front-state.cpp:336: internal compiler error: output_operand: invalid expression as operand Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. Preprocessed source stored into /tmp/ccgRM3uh.out file, please attach this to your bugreport. (sid)1187:tbm@em64t: ~]
Created attachment 12421 [details] testcase
This works on 4.1.2 20061007 on i686-linux-gnu.
(In reply to comment #2) > This works on 4.1.2 20061007 on i686-linux-gnu. Fails for me with gcc 4.1.2 20061011 on x86_64-unknown-linux-gnu. From the Debian build logs it seems the ICE only appeared on x86_64.
This is TLS that is being ICEd on so I doubt this is a regression, except for libstdc++ using TLS now.
Sorry, not TLS but instead some PIC code. This is a target specific issue.
(gdb) p debug_rtx(x) (unspec:DI [ (symbol_ref:DI ("_ZN6string20_S_empty_rep_storageE") [flags 0x40] <var_decl 0xb7d9c060 _S_empty_rep_storage>) ] 2)
Reduced testcase: struct string { struct _Rep{}; static _Rep _S_empty_rep_storage[]; void *_M_rep () const{} void _M_destroy () throw (); ~string () { _Rep *a = (_Rep *)((void *)(&_S_empty_rep_storage)); if (__builtin_expect (_M_rep ()!= a, false)) _M_destroy (); } }; struct ios_base { virtual ~ ios_base (); }; struct ostream : virtual ios_base{}; struct stringbuf { int t()const; string _M_string; string str () const { string __ret; if (t()) return __ret; } }; struct ostringstream : ostream { ostream __ostream_type; stringbuf _M_stringbuf; }; void sizeString () { ostringstream s; s._M_stringbuf.str (); }
Note this looks like a latent bug.
*** Bug 30472 has been marked as a duplicate of this bug. ***
Closing 4.1 branch.