From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14765 invoked by alias); 30 Nov 2012 10:35:24 -0000 Received: (qmail 11543 invoked by uid 48); 30 Nov 2012 10:35:07 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/55541] [4.6/4.7/4.8 Regression] unable to see local variables due extra lexical block was generated Date: Fri, 30 Nov 2012 10:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02978.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55541 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek 2012-11-30 10:35:06 UTC --- That is the result of 13701 /* Make it so that `main' always returns 0 by default. */ 13702 if (DECL_MAIN_P (current_function_decl)) 13703 finish_return_stmt (integer_zero_node); in C++ finish_function (and for C99 similarly): if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted && TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (fndecl))) == integer_type_node && flag_isoc99) { /* Hack. We don't want the middle-end to warn that this return is unreachable, so we mark its location as special. Using UNKNOWN_LOCATION has the problem that it gets clobbered in annotate_one_with_locus. A cleaner solution might be to ensure ! should_carry_locus_p (stmt), but that needs a flag. */ c_finish_return (BUILTINS_LOCATION, integer_zero_node, NULL_TREE); } Both these add the stmts after the function body, which is usually just a BIND_EXPR containing all the stuff from the source in its operand in a statement list. We'd need to arrange for this, if the whole function body so far is a single BIND_EXPR, to stick it at the end of the sequence in the BIND_EXPR.