From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26153 invoked by alias); 20 Jun 2004 11:47:18 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26130 invoked by uid 48); 20 Jun 2004 11:47:16 -0000 Date: Sun, 20 Jun 2004 11:47:00 -0000 Message-ID: <20040620114716.26129.qmail@sourceware.org> From: "ebotcazou at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040515131617.15461.smelkov@mph1.phys.spbu.ru> References: <20040515131617.15461.smelkov@mph1.phys.spbu.ru> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15461] [3.4 regression] ICE on valid code X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg02511.txt.bz2 List-Id: ------- Additional Comments From ebotcazou at gcc dot gnu dot org 2004-06-20 11:47 ------- I think the problem lies in the C++ front-end. The ICE happens because the tree-inliner inserts a DECL_STMT corresponding to the RESULT_DECL 'tv' when inlining the operator: arg 0 abstract_origin > chain --> chain chain chain > Now the VAR_DECL of 'tv' has a constructor as its DECL_INITIAL, and the constructor references the VAR_DECL of 'sec'. But the declaration of 'sec' has not yet been seen so the compiler invokes make_decl_rtl on a automatic variable and aborts on the entry sanity check. I'm not sure how this should work. In the 3.3.x series, the DECL_STMT is not inserted by tree-inline.c:declare_return_variable /* Build the declaration statement if FN does not return an aggregate. */ if (need_return_decl) return build_stmt (DECL_STMT, var); because FN (the operator) is recognized as returning an aggregate. In the 3.4.x series, this is not true because CALL_EXPR_HAS_RETURN_SLOT_ADDR is not set by simplify_aggr_init_exprs_r/simplify_aggr_init_expr (there is no AGGR_INIT_EXPR in the tree). So it would appear that the front-end has optimized away the aggregate-ness of struct A. Maybe the fix is to remove the DECL_INITIAL when the RESULT_DECL is copied to the VAR_DECL in cp_copy_res_decl_for_inlining. Or maybe it is to treat the operator as returning an aggregate like in the 3.3.x series. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu dot | |org AssignedTo|ebotcazou at gcc dot gnu dot|unassigned at gcc dot gnu |org |dot org Status|ASSIGNED |NEW Component|middle-end |c++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15461