diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-18 18:01:42 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-18 18:01:42 +0000 |
commit | b103f756443ae262d45a00c62bd73eb1c9aeb2f1 (patch) | |
tree | 6dd03924de83f1089e51cf9bf01fc85055dcc175 | |
parent | ddb98bada7a6cd9bee0784a07f543558c2e09672 (diff) |
svn merge -r150503:150753 svn+ssh://gcc.gnu.org/svn/gcc/branches/var-tracking-assignments-4_4-branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/redhat/vta-4_4-branch@150887 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.vta | 54 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 6 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 21 | ||||
-rw-r--r-- | gcc/common.opt | 4 | ||||
-rw-r--r-- | gcc/cselib.c | 25 | ||||
-rw-r--r-- | gcc/diagnostic.c | 3 | ||||
-rw-r--r-- | gcc/dse.c | 1 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 6 | ||||
-rw-r--r-- | gcc/final.c | 4 | ||||
-rw-r--r-- | gcc/function.h | 2 | ||||
-rw-r--r-- | gcc/haifa-sched.c | 38 | ||||
-rw-r--r-- | gcc/ifcvt.c | 2 | ||||
-rw-r--r-- | gcc/regmove.c | 6 | ||||
-rw-r--r-- | gcc/regrename.c | 29 | ||||
-rw-r--r-- | gcc/sched-int.h | 11 | ||||
-rw-r--r-- | gcc/var-tracking.c | 26 |
16 files changed, 151 insertions, 87 deletions
diff --git a/gcc/ChangeLog.vta b/gcc/ChangeLog.vta index 8361264ecd5..7a1a3d104a4 100644 --- a/gcc/ChangeLog.vta +++ b/gcc/ChangeLog.vta @@ -1,3 +1,57 @@ +2009-08-14 Alexandre Oliva <aoliva@redhat.com> + + * cfgrtl.c (rtl_split_block): Emit DELETED note for compare-debug + stability. + +2009-08-14 Alexandre Oliva <aoliva@redhat.com> + + * common.opt (fmin-insn-uid=): Complete removal. + +2009-08-14 Alexandre Oliva <aoliva@redhat.com> + + * cfgcleanup.c (delete_unreachable_blocks): Walk blocks in + reverse order. + +2009-08-14 Alexandre Oliva <aoliva@redhat.com> + + * diagnostic.c (diagnostic_report_diagnostic): Skip notes during + the second compare-debug compilation. + +2009-08-14 Alexandre Oliva <aoliva@redhat.com> + + * cselib.c (cselib_expand_value_rtx, cselib_expand_value_rtx_cb): + Don't wrap constant values. + (check_wrap_constant): Moved to... + * var-tracking.c: ... this file. + (vt_expand_loc_callback, vt_expand_loc): Wrap here instead. + +2009-08-14 Alexandre Oliva <aoliva@redhat.com> + + * function.h (emit-status::x_cur_debug_insn_uid): Update flag + name in comments. + * haifa-sched.c (nondebug_dep_list_size): Rename to... + (dep_list_size): ... this. + (priority, add_jump_dependencies): Adjust. + (rank_for_schedule): Simplify with dep_list_size. + (SCHED_DEBUG_INSNS_BEFORE_REORDER): Remove. Drop all references. + * sched-int.h (BOUNDARY_DEBUG_INSN_P, SCHEDULE_DEBUG_INSN_P): + Add more detailed comments. + * dse.c (scan_insn): Remove excess line break. + * final.c (get_attr_length_1): Remove impossible test for + DEBUG_INSN_P, add case to handle it. + * ifcvt.c (check_cond_move_block): Don't expect debug insns after + jump insns. + * regrename.c (replace_oldest_value_reg): Don't special-case debug + insns. + (copyprop_hardreg_forward_1): Simplify handling of debug insns. + Apply change group. + * regmove.c (regmove_backward_pass): Adjust comment. + +2009-08-07 Jakub Jelinek <jakub@redhat.com> + + * dwarf2out.c (loc_descriptor, add_const_value_attribute): Don't + handle TLS SYMBOL_REFs. + 2009-08-05 Alexandre Oliva <aoliva@redhat.com> * cfgexpand.c (expand_debug_expr): Fail gracefully when computing diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 5c3043e330b..0741765316d 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2077,15 +2077,15 @@ bool delete_unreachable_blocks (void) { bool changed = false; - basic_block b, next_bb; + basic_block b, prev_bb; find_unreachable_blocks (); /* Delete all unreachable basic blocks. */ - for (b = ENTRY_BLOCK_PTR->next_bb; b != EXIT_BLOCK_PTR; b = next_bb) + for (b = EXIT_BLOCK_PTR->prev_bb; b != ENTRY_BLOCK_PTR; b = prev_bb) { - next_bb = b->next_bb; + prev_bb = b->prev_bb; if (!(b->flags & BB_REACHABLE)) { diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 18d1abbabb9..da440ce1344 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -552,7 +552,26 @@ rtl_split_block (basic_block bb, void *insnp) insn = first_insn_after_basic_block_note (bb); if (insn) - insn = PREV_INSN (insn); + { + rtx next = insn; + + insn = PREV_INSN (insn); + + /* If the block contains only debug insns, insn would have + been NULL in a non-debug compilation, and then we'd end + up emitting a DELETED note. For -fcompare-debug + stability, emit the note too. */ + if (insn != BB_END (bb) + && DEBUG_INSN_P (next) + && DEBUG_INSN_P (BB_END (bb))) + { + while (next != BB_END (bb) && DEBUG_INSN_P (next)) + next = NEXT_INSN (next); + + if (next == BB_END (bb)) + emit_note_after (NOTE_INSN_DELETED, next); + } + } else insn = get_last_insn (); } diff --git a/gcc/common.opt b/gcc/common.opt index 3fd7bcf7c29..39e09dd787c 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -766,10 +766,6 @@ fmessage-length= Common RejectNegative Joined UInteger -fmessage-length=<number> Limit diagnostics to <number> characters per line. 0 suppresses line-wrapping -fmin-insn-uid= -Common RejectNegative Var(flag_min_insn_uid) Init(0) Joined UInteger -Use insn uids above the given value for non-debug insns. - fmodulo-sched Common Report Var(flag_modulo_sched) Optimization Perform SMS based modulo scheduling before the first scheduling pass diff --git a/gcc/cselib.c b/gcc/cselib.c index 90e3970a8d1..2aa31394933 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -1022,23 +1022,6 @@ expand_loc (struct elt_loc_list *p, struct expand_value_data *evd, } -/* Wrap result in CONST:MODE if needed to preserve the mode. */ -static rtx -check_wrap_constant (enum machine_mode mode, rtx result) -{ - if (!result || GET_MODE (result) == mode) - return result; - - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " wrapping result in const to preserve mode %s\n", - GET_MODE_NAME (mode)); - - result = wrap_constant (mode, result); - gcc_assert (GET_MODE (result) == mode); - - return result; -} - /* Forward substitute and expand an expression out to its roots. This is the opposite of common subexpression. Because local value numbering is such a weak optimization, the expanded expression is @@ -1066,9 +1049,7 @@ cselib_expand_value_rtx (rtx orig, bitmap regs_active, int max_depth) evd.callback = NULL; evd.callback_arg = NULL; - return check_wrap_constant (GET_MODE (orig), - cselib_expand_value_rtx_1 (orig, &evd, - max_depth)); + return cselib_expand_value_rtx_1 (orig, &evd, max_depth); } /* Same as cselib_expand_value_rtx, but using a callback to try to @@ -1084,9 +1065,7 @@ cselib_expand_value_rtx_cb (rtx orig, bitmap regs_active, int max_depth, evd.callback = cb; evd.callback_arg = data; - return check_wrap_constant (GET_MODE (orig), - cselib_expand_value_rtx_1 (orig, &evd, - max_depth)); + return cselib_expand_value_rtx_1 (orig, &evd, max_depth); } static rtx diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 901cae8144a..25c5191447d 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -312,6 +312,9 @@ diagnostic_report_diagnostic (diagnostic_context *context, && !diagnostic_report_warnings_p (location)) return false; + if (diagnostic->kind == DK_NOTE && flag_compare_debug) + return false; + if (diagnostic->kind == DK_PEDWARN) diagnostic->kind = pedantic_warning_kind (); diff --git a/gcc/dse.c b/gcc/dse.c index cfbe4277d0d..1b6df47fb66 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -2387,7 +2387,6 @@ scan_insn (bb_info_t bb_info, rtx insn) insn_info->insn = insn; bb_info->last_insn = insn_info; - if (DEBUG_INSN_P (insn)) { insn_info->cannot_delete = true; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 2ce66f15a14..41ce58802ba 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11683,6 +11683,9 @@ loc_descriptor (rtx rtl, enum machine_mode mode, } /* FALLTHROUGH */ case SYMBOL_REF: + if (GET_CODE (rtl) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE) + break; case LABEL_REF: if (mode != VOIDmode && GET_MODE_SIZE (mode) == DWARF2_ADDR_SIZE) { @@ -12646,6 +12649,9 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) } /* FALLTHROUGH */ case SYMBOL_REF: + if (GET_CODE (rtl) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE) + break; case LABEL_REF: add_AT_addr (die, DW_AT_const_value, rtl); VEC_safe_push (rtx, gc, used_rtx_array, rtl); diff --git a/gcc/final.c b/gcc/final.c index c557e54318a..7b4296812a3 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -384,6 +384,7 @@ get_attr_length_1 (rtx insn ATTRIBUTE_UNUSED, case NOTE: case BARRIER: case CODE_LABEL: + case DEBUG_INSN: return 0; case CALL_INSN: @@ -403,8 +404,7 @@ get_attr_length_1 (rtx insn ATTRIBUTE_UNUSED, case INSN: body = PATTERN (insn); - if (GET_CODE (body) == USE || GET_CODE (body) == CLOBBER - || DEBUG_INSN_P (insn)) + if (GET_CODE (body) == USE || GET_CODE (body) == CLOBBER) return 0; else if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0) diff --git a/gcc/function.h b/gcc/function.h index 29579628f4b..448de2343a3 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -67,7 +67,7 @@ struct emit_status GTY(()) int x_cur_insn_uid; /* INSN_UID for next debug insn emitted. Only used if - -fmin-debug-insn-uid=<value> is given with nonzero value. */ + --param min-nondebug-insn-uid=<value> is given with nonzero value. */ int x_cur_debug_insn_uid; /* Location the last line-number NOTE emitted. diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index e127ccc4c99..762243ebf68 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -774,7 +774,7 @@ contributes_to_priority_p (dep_t dep) /* Compute the number of nondebug forward deps of an insn. */ static int -nondebug_dep_list_size (rtx insn) +dep_list_size (rtx insn) { sd_iterator_def sd_it; dep_t dep; @@ -810,7 +810,7 @@ priority (rtx insn) { int this_priority = -1; - if (nondebug_dep_list_size (insn) == 0) + if (dep_list_size (insn) == 0) /* ??? We should set INSN_PRIORITY to insn_cost when and insn has some forward deps but all of them are ignored by contributes_to_priority hook. At the moment we set priority of @@ -918,9 +918,8 @@ rank_for_schedule (const void *x, const void *y) rtx last; int tmp_class, tmp2_class; int val, priority_val, weight_val, info_val; - bool has_debug = MAY_HAVE_DEBUG_INSNS; - if (has_debug) + if (MAY_HAVE_DEBUG_INSNS) { /* Schedule debug insns as early as possible. */ if (DEBUG_INSN_P (tmp) && !DEBUG_INSN_P (tmp2)) @@ -1023,12 +1022,7 @@ rank_for_schedule (const void *x, const void *y) This gives the scheduler more freedom when scheduling later instructions at the expense of added register pressure. */ - if (has_debug) - val = (nondebug_dep_list_size (tmp2) - - nondebug_dep_list_size (tmp)); - else - val = (sd_lists_size (tmp2, SD_LIST_FORW) - - sd_lists_size (tmp, SD_LIST_FORW)); + val = (dep_list_size (tmp2) - dep_list_size (tmp)); if (val != 0) @@ -2423,10 +2417,6 @@ choose_ready (struct ready_list *ready, rtx *insn_ptr) } } -#ifndef SCHED_DEBUG_INSNS_BEFORE_REORDER -# define SCHED_DEBUG_INSNS_BEFORE_REORDER 1 -#endif - /* Use forward list scheduling to rearrange insns of block pointed to by TARGET_BB, possibly bringing insns from subsequent blocks in the same region. */ @@ -2590,8 +2580,7 @@ schedule_block (basic_block *target_bb) /* We don't want md sched reorder to even see debug isns, so put them out right away. */ - if (SCHED_DEBUG_INSNS_BEFORE_REORDER - && ready.n_ready && DEBUG_INSN_P (ready_element (&ready, 0))) + if (ready.n_ready && DEBUG_INSN_P (ready_element (&ready, 0))) { if (control_flow_insn_p (last_scheduled_insn)) { @@ -2671,9 +2660,7 @@ schedule_block (basic_block *target_bb) } if (ready.n_ready == 0 - || (!can_issue_more - && (SCHED_DEBUG_INSNS_BEFORE_REORDER - || !DEBUG_INSN_P (ready_element (&ready, 0)))) + || !can_issue_more || state_dead_lock_p (curr_state) || !(*current_sched_info->schedule_more_p) ()) break; @@ -2814,9 +2801,7 @@ schedule_block (basic_block *target_bb) /* A naked CLOBBER or USE generates no instruction, so do not count them against the issue rate. */ else if (GET_CODE (PATTERN (insn)) != USE - && GET_CODE (PATTERN (insn)) != CLOBBER - && (SCHED_DEBUG_INSNS_BEFORE_REORDER - || !DEBUG_INSN_P (insn))) + && GET_CODE (PATTERN (insn)) != CLOBBER) can_issue_more--; advance = schedule_insn (insn); @@ -2827,9 +2812,7 @@ schedule_block (basic_block *target_bb) if (advance != 0) break; - if (SCHED_DEBUG_INSNS_BEFORE_REORDER - || !DEBUG_INSN_P (insn)) - first_cycle_insn_p = 0; + first_cycle_insn_p = 0; /* Sort the ready list based on priority. This must be redone here, as schedule_insn may have readied additional @@ -2839,8 +2822,7 @@ schedule_block (basic_block *target_bb) /* Quickly go through debug insns such that md sched reorder2 doesn't have to deal with debug insns. */ - if (SCHED_DEBUG_INSNS_BEFORE_REORDER - && ready.n_ready && DEBUG_INSN_P (ready_element (&ready, 0)) + if (ready.n_ready && DEBUG_INSN_P (ready_element (&ready, 0)) && (*current_sched_info->schedule_more_p) ()) { if (control_flow_insn_p (last_scheduled_insn)) @@ -4749,7 +4731,7 @@ add_jump_dependencies (rtx insn, rtx jump) if (insn == jump) break; - if (nondebug_dep_list_size (insn) == 0) + if (dep_list_size (insn) == 0) { dep_def _new_dep, *new_dep = &_new_dep; diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 2214c711852..d4a800b5383 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -2479,8 +2479,6 @@ check_cond_move_block (basic_block bb, rtx *vals, VEC (int, heap) **regs, rtx co /* We can only handle simple jumps at the end of the basic block. It is almost impossible to update the CFG otherwise. */ insn = BB_END (bb); - while (DEBUG_INSN_P (insn)) - insn = PREV_INSN (insn); if (JUMP_P (insn) && !onlyjump_p (insn)) return FALSE; diff --git a/gcc/regmove.c b/gcc/regmove.c index b037987c45c..d68fa7cd673 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -1137,8 +1137,10 @@ regmove_optimize (void) if (pset && SET_DEST (pset) == src) { /* We use validate_replace_rtx, in case there - are multiple identical source operands. All of - them have to be changed at the same time. */ + are multiple identical source operands. All + of them have to be changed at the same time: + when validate_replace_rtx() calls + apply_change_group(). */ validate_change (p, &SET_DEST (pset), dst, 1); if (validate_replace_rtx (src, dst, insn)) success = 1; diff --git a/gcc/regrename.c b/gcc/regrename.c index 330e98efd28..200e7a6ae8a 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1412,10 +1412,7 @@ replace_oldest_value_reg (rtx *loc, enum reg_class cl, rtx insn, fprintf (dump_file, "insn %u: replaced reg %u with %u\n", INSN_UID (insn), REGNO (*loc), REGNO (new_rtx)); - if (DEBUG_INSN_P (insn)) - *loc = new_rtx; - else - validate_change (insn, loc, new_rtx, 1); + validate_change (insn, loc, new_rtx, 1); return true; } return false; @@ -1603,21 +1600,23 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) bool replaced[MAX_RECOG_OPERANDS]; bool changed = false; - if (DEBUG_INSN_P (insn)) + if (!NONDEBUG_INSN_P (insn)) { - rtx loc = INSN_VAR_LOCATION_LOC (insn); - if (!VAR_LOC_UNKNOWN_P (loc) - && replace_oldest_value_addr (&INSN_VAR_LOCATION_LOC (insn), - ALL_REGS, GET_MODE (loc), - insn, vd)) + if (DEBUG_INSN_P (insn)) { - df_insn_rescan (insn); - anything_changed = true; + rtx loc = INSN_VAR_LOCATION_LOC (insn); + if (!VAR_LOC_UNKNOWN_P (loc) + && replace_oldest_value_addr (&INSN_VAR_LOCATION_LOC (insn), + ALL_REGS, GET_MODE (loc), + insn, vd)) + { + changed = apply_change_group (); + gcc_assert (changed); + df_insn_rescan (insn); + anything_changed = true; + } } - } - if (!NONDEBUG_INSN_P (insn)) - { if (insn == BB_END (bb)) break; else diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 1e3aec23506..6a4aebad3d3 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -796,11 +796,16 @@ extern VEC(haifa_deps_insn_data_def, heap) *h_d_i_d; #define DEBUG_INSN_SCHED_P(insn) \ (RTL_FLAG_CHECK1("DEBUG_INSN_SCHED_P", (insn), DEBUG_INSN)->unchanging) -/* Convenience predicates. */ -#define SCHEDULE_DEBUG_INSN_P(insn) \ - (DEBUG_INSN_P (insn) && DEBUG_INSN_SCHED_P (insn)) +/* True if INSN is a debug insn that is next to a basic block + boundary, i.e., it is to be handled by the scheduler like a + note. */ #define BOUNDARY_DEBUG_INSN_P(insn) \ (DEBUG_INSN_P (insn) && !DEBUG_INSN_SCHED_P (insn)) +/* True if INSN is a debug insn that is not next to a basic block + boundary, i.e., it is to be handled by the scheduler like an + insn. */ +#define SCHEDULE_DEBUG_INSN_P(insn) \ + (DEBUG_INSN_P (insn) && DEBUG_INSN_SCHED_P (insn)) /* Dep status (aka ds_t) of the link encapsulates information, that is needed for speculative scheduling. Namely, it is 4 integers in the range diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index f678fb83e65..ddc890e399d 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -6282,6 +6282,24 @@ delete_variable_part (dataflow_set *set, rtx loc, decl_or_value dv, delete_slot_part (set, loc, slot, offset); } +/* Wrap result in CONST:MODE if needed to preserve the mode. */ + +static rtx +check_wrap_constant (enum machine_mode mode, rtx result) +{ + if (!result || GET_MODE (result) == mode) + return result; + + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, " wrapping result in const to preserve mode %s\n", + GET_MODE_NAME (mode)); + + result = wrap_constant (mode, result); + gcc_assert (GET_MODE (result) == mode); + + return result; +} + /* Callback for cselib_expand_value, that looks for expressions holding the value in the var-tracking hash tables. */ @@ -6317,6 +6335,7 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data) { result = cselib_expand_value_rtx_cb (loc->loc, regs, max_depth, vt_expand_loc_callback, vars); + result = check_wrap_constant (GET_MODE (loc->loc), result); if (result) break; } @@ -6331,11 +6350,14 @@ vt_expand_loc_callback (rtx x, bitmap regs, int max_depth, void *data) static rtx vt_expand_loc (rtx loc, htab_t vars) { + rtx newloc; + if (!MAY_HAVE_DEBUG_INSNS) return loc; - loc = cselib_expand_value_rtx_cb (loc, scratch_regs, 5, - vt_expand_loc_callback, vars); + newloc = cselib_expand_value_rtx_cb (loc, scratch_regs, 5, + vt_expand_loc_callback, vars); + loc = check_wrap_constant (GET_MODE (loc), newloc); if (loc && MEM_P (loc)) loc = targetm.delegitimize_address (loc); |