diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-24 16:50:11 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-24 16:50:11 +0000 |
commit | 586b67ff8d8d77d079ac25b46afed07aa2eaf0f4 (patch) | |
tree | f6c43bec236d3651d319f9bfbf4ace3a1a1e4c59 /gcc | |
parent | 3c5a5d99f20cbe03c43f7a04e4dc4d1983fca558 (diff) | |
download | gcc-586b67ff8d8d77d079ac25b46afed07aa2eaf0f4.tar.gz |
PR debug/43479
* ira.c (adjust_cleared_regs): New function.
(update_equiv_regs): Adjust cleared_regs in DEBUG_INSNs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ira.c | 48 |
2 files changed, 44 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a89e0699bdc..d11614ad574 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2010-03-24 Jakub Jelinek <jakub@redhat.com> + PR debug/43479 + * ira.c (adjust_cleared_regs): New function. + (update_equiv_regs): Adjust cleared_regs in DEBUG_INSNs. + PR debug/19192 PR debug/43479 * cfgexpand.c (gimple_assign_rhs_to_tree): Also set TREE_BLOCK diff --git a/gcc/ira.c b/gcc/ira.c index e5a6171f067..b4397c884f3 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1,5 +1,5 @@ /* Integrated Register Allocator (IRA) entry point. - Copyright (C) 2006, 2007, 2008, 2009 + Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Vladimir Makarov <vmakarov@redhat.com>. @@ -2282,6 +2282,22 @@ no_equiv (rtx reg, const_rtx store ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED } } +/* In DEBUG_INSN location adjust REGs from CLEARED_REGS bitmap to the + equivalent replacement. */ + +static rtx +adjust_cleared_regs (rtx loc, const_rtx old_rtx ATTRIBUTE_UNUSED, void *data) +{ + if (REG_P (loc)) + { + bitmap cleared_regs = (bitmap) data; + if (bitmap_bit_p (cleared_regs, REGNO (loc))) + return simplify_replace_fn_rtx (*reg_equiv[REGNO (loc)].src_p, + NULL_RTX, adjust_cleared_regs, data); + } + return NULL_RTX; +} + /* Nonzero if we recorded an equivalence for a LABEL_REF. */ static int recorded_label_ref; @@ -2717,13 +2733,29 @@ update_equiv_regs (void) } if (!bitmap_empty_p (cleared_regs)) - FOR_EACH_BB (bb) - { - bitmap_and_compl_into (DF_LIVE_IN (bb), cleared_regs); - bitmap_and_compl_into (DF_LIVE_OUT (bb), cleared_regs); - bitmap_and_compl_into (DF_LR_IN (bb), cleared_regs); - bitmap_and_compl_into (DF_LR_OUT (bb), cleared_regs); - } + { + FOR_EACH_BB (bb) + { + bitmap_and_compl_into (DF_LIVE_IN (bb), cleared_regs); + bitmap_and_compl_into (DF_LIVE_OUT (bb), cleared_regs); + bitmap_and_compl_into (DF_LR_IN (bb), cleared_regs); + bitmap_and_compl_into (DF_LR_OUT (bb), cleared_regs); + } + + /* Last pass - adjust debug insns referencing cleared regs. */ + if (MAY_HAVE_DEBUG_INSNS) + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if (DEBUG_INSN_P (insn)) + { + rtx old_loc = INSN_VAR_LOCATION_LOC (insn); + INSN_VAR_LOCATION_LOC (insn) + = simplify_replace_fn_rtx (old_loc, NULL_RTX, + adjust_cleared_regs, + (void *) cleared_regs); + if (old_loc != INSN_VAR_LOCATION_LOC (insn)) + df_insn_rescan (insn); + } + } BITMAP_FREE (cleared_regs); |