From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31739 invoked by alias); 9 Jul 2010 11:48:14 -0000 Received: (qmail 31577 invoked by uid 48); 9 Jul 2010 11:47:58 -0000 Date: Fri, 09 Jul 2010 11:48:00 -0000 Message-ID: <20100709114758.31576.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug debug/44832] [4.6 Regression] -fcompare-debug failure for C++ i386.c In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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: 2010-07/txt/msg00987.txt.bz2 ------- Comment #51 from rguenth at gcc dot gnu dot org 2010-07-09 11:47 ------- (In reply to comment #50) > Created an attachment (id=21157) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21157&action=view) [edit] > combined ptch for 44832/44874 - WIP > > For the unreduced testcase, I see differences regarding the labels do_subreg, > done, and widen. > Any idea why the LABEL_DECLs are kept only when emitting debug information? because they are not used? @@ -477,7 +490,16 @@ remove_unused_scope_block_p (tree scope) type is used or not. */ else if (debug_info_level == DINFO_LEVEL_NORMAL - || debug_info_level == DINFO_LEVEL_VERBOSE) + || debug_info_level == DINFO_LEVEL_VERBOSE + /* For labels that are still used in the IL, the decision + to preserve them must not depend DEBUG_INFO_LEVEL, + otherwise we risk having different ordering in debug vs. + non-debug builds during inlining or versioning. + A label appearing here (we have already checked + DECL_IGNORED_P) should not be used in the IL unless it has + been explicitly used before, so we use TREE_USED as an + approximation. */ + || (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))) please instead add a similar case to that of TREE_CODE (*t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (*t) instead of amending the debuginfo level checks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44832