------- 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