[Bug lto/42401] wrong-code with -flto

2009-12-19 Thread rguenth at gcc dot gnu dot org
--- Comment #8 from rguenth at gcc dot gnu dot org 2009-12-19 11:41 --- Fixed. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|NEW

[Bug lto/42401] wrong-code with -flto

2009-12-19 Thread rguenth at gcc dot gnu dot org
--- Comment #7 from rguenth at gcc dot gnu dot org 2009-12-19 11:41 --- Subject: Bug 42401 Author: rguenth Date: Sat Dec 19 11:41:14 2009 New Revision: 155361 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155361 Log: 2009-12-19 Richard Guenther PR lto/42401

[Bug lto/42401] wrong-code with -flto

2009-12-18 Thread matz at gcc dot gnu dot org
--- Comment #6 from matz at gcc dot gnu dot org 2009-12-19 02:33 --- Ah, because the references to trees are not handled via the write_cache hashtable, but via the per-kind stream (in output_block.decl_state), which is not realloced on create_output_block, but only on lto_push/pop_out_de

[Bug lto/42401] wrong-code with -flto

2009-12-18 Thread matz at gcc dot gnu dot org
--- Comment #5 from matz at gcc dot gnu dot org 2009-12-19 01:19 --- To explain: the miscompilation is a result of the cloner (when cloning for the find() call) creating a new tree for a local static variable (the 'm' in main). After inlining we have: if ( &mD.2293._M_tD.2062._M_implD

[Bug lto/42401] wrong-code with -flto

2009-12-18 Thread rguenth at gcc dot gnu dot org
--- Comment #4 from rguenth at gcc dot gnu dot org 2009-12-19 00:41 --- The following seems to fix it for some reason. Index: lto-streamer-out.c === --- lto-streamer-out.c (revision 155347) +++ lto-streamer-out.c (working

[Bug lto/42401] wrong-code with -flto

2009-12-17 Thread rguenth at gcc dot gnu dot org
--- Comment #3 from rguenth at gcc dot gnu dot org 2009-12-17 15:17 --- Btw, the single-file testcase #include #include int main () { typedef std::map Map; static Map m; Map::const_iterator it = m.find(0); if (it != m.end()) { std::string s = it->second; } } fails t

[Bug lto/42401] wrong-code with -flto

2009-12-17 Thread rguenth at gcc dot gnu dot org
--- Comment #2 from rguenth at gcc dot gnu dot org 2009-12-17 14:26 --- It is DOM which threads over the check in bb 12: : __y_90 = __y_108; D.2866_92 = __y_108->_M_value_field.first; if (D.2866_92 > 0) goto ; else goto ; : # SR.42_94 = PHI if (SR.42_94 != &m._M_t.