This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/28116] [4.1 Regression] ICE when building konverter with gcc-4.1 with -O3 [RSO]
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2006 16:58:25 -0000
- Subject: [Bug middle-end/28116] [4.1 Regression] ICE when building konverter with gcc-4.1 with -O3 [RSO]
- References: <bug-28116-10160@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jakub at gcc dot gnu dot org 2006-06-22 16:58 -------
In GCC trunk bootstrap + regression testing the tree-nrv optimization hits 584
types, out of this 38 cases have TREE_ADDRESSABLE set on the RESULT_DECL
(because C++ FE already NRV optimized it, address of <retval> was taken usually
when it was constructed, then some optimizations later on set <retval> to
a temporary variable and the code that takes &<result> was optimized out), e.g.
when compiling fstream-inst.cc in libstdc++-v3.
So, bailing out in tree_nrv whenever TREE_ADDRESSABLE (result) would pessimize
those. On the other side, in tree_nrv we know that TREE_ADDRESSABLE (found) ==
0 (we check for that), so we can either stop copying the addressable flag, or
bail if TREE_ADDRESSABLE (result).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28116