This patch is for the ICE of PR56915 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56915), specific to gcc 4.9. Because this patch only touches the C++ frontend, I only ran the g++ and libstdc++ testsuits with the newly added testcase. And the test results on Ubuntu x86_64 indicate no regression regarding the testsuits.
The problem causing the ICE is that GCC sets DECL_INTERFACE_KNOWN too early before 'start_preparsed_function', which generates the body of the thunk and depends on the value of DECL_INTERFACE_KNOWN. Moving the setting after the point of 'start_preparsed_function' or 'symtab_add_to_same_comdat_group' fixes the problem. Shixiong
commit 1bc89baae77d7a6d4f98b70e6e603454e2837919 Author: Shixiong Xu <shixi...@kugelworks.com> Date: Sun Apr 28 22:11:05 2013 +1200 PR c++/56915 * gcc/cp/semantics.c: Move down the setting to DECL_INTERFACE_KNOWN(...) after symtab_add_to_same_comdat_group(...). * gcc/testsuite/g++.dg/torture/pr56915.C: New.
pr56915.patch
Description: Binary data