On Thu, Mar 31, 2011 at 06:55:37AM -0600, Jeff Law wrote: > * cfgexpand.c (expand_gimple_basic_block): Avoid useless assignment.
> *** cfgexpand.c (revision 171659) > --- cfgexpand.c (working copy) > *************** expand_gimple_basic_block (basic_block b > *** 3576,3582 **** > val = gen_rtx_VAR_LOCATION > (mode, var, (rtx)value, VAR_INIT_STATUS_INITIALIZED); > > ! val = emit_debug_insn (val); > > if (dump_file && (dump_flags & TDF_DETAILS)) > { > --- 3576,3582 ---- > val = gen_rtx_VAR_LOCATION > (mode, var, (rtx)value, VAR_INIT_STATUS_INITIALIZED); > > ! emit_debug_insn (val); > > if (dump_file && (dump_flags & TDF_DETAILS)) > { There were two occurrences of val = emit_debug_insn in expand_gimple_basic_block, one wasn't using the return value, the other was and you've apparently patched the wrong one. The following patch patches the correct one and adjusts the use of the other one instead of reverting it, we don't need to get back the VAR_LOCATION from the DEBUG_INSN when we already have it anyway. Bootstrapped/regtested on x86_64-linux and i686-linux (on trunk before Bernd's recent changes), committed as obvious. 2011-04-04 Jakub Jelinek <ja...@redhat.com> PR debug/48404 * cfgexpand.c (expand_gimple_basic_block): Avoid useless assignment. Use PAT_VAR_LOCATION_LOC instead of INSN_VAR_LOCATION_LOC. --- gcc/cfgexpand.c.jj 2011-04-01 11:04:36.971389605 +0200 +++ gcc/cfgexpand.c 2011-04-01 20:59:26.304451437 +0200 @@ -3517,7 +3517,7 @@ expand_gimple_basic_block (basic_block b val = gen_rtx_VAR_LOCATION (mode, vexpr, (rtx)value, VAR_INIT_STATUS_INITIALIZED); - val = emit_debug_insn (val); + emit_debug_insn (val); FOR_EACH_IMM_USE_STMT (debugstmt, imm_iter, op) { @@ -3582,9 +3582,9 @@ expand_gimple_basic_block (basic_block b { /* We can't dump the insn with a TREE where an RTX is expected. */ - INSN_VAR_LOCATION_LOC (val) = const0_rtx; + PAT_VAR_LOCATION_LOC (val) = const0_rtx; maybe_dump_rtl_for_gimple_stmt (stmt, last); - INSN_VAR_LOCATION_LOC (val) = (rtx)value; + PAT_VAR_LOCATION_LOC (val) = (rtx)value; } /* In order not to generate too many debug temporaries, Jakub