aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-02-11 10:17:54 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-02-11 10:17:54 +0100
commit8f6aedbafe717b329098a6846167a1bee2821507 (patch)
treee072b9fb483bdab98368db1fa8c73f104ce369a6 /gcc
parentd2d36740c2c8901e566dbbcc02ca5bbe51480fd7 (diff)
downloadgcc-8f6aedbafe717b329098a6846167a1bee2821507.zip
gcc-8f6aedbafe717b329098a6846167a1bee2821507.tar.gz
gcc-8f6aedbafe717b329098a6846167a1bee2821507.tar.bz2
reload1.c (eliminate_regs_1): If insn is DEBUG_INSN, avoid any modifications outside of the DEBUG_INSN.
* reload1.c (eliminate_regs_1): If insn is DEBUG_INSN, avoid any modifications outside of the DEBUG_INSN. Accept CLOBBERs inside of DEBUG_INSNs. (eliminate_regs_in_insn): Eliminate regs even in DEBUG_INSNs. From-SVN: r156693
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/reload1.c16
2 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e489d90..77b1337 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-02-11 Jakub Jelinek <jakub@redhat.com>
+ * reload1.c (eliminate_regs_1): If insn is DEBUG_INSN, avoid any
+ modifications outside of the DEBUG_INSN. Accept CLOBBERs inside
+ of DEBUG_INSNs.
+ (eliminate_regs_in_insn): Eliminate regs even in DEBUG_INSNs.
+
* dwarf2out.c (mem_loc_descriptor) <case MEM>: Use DW_OP_deref_size
if MEM's mode size isn't DWARF2_ADDR_SIZE.
(mem_loc_descriptor) <do_scompare>: Allow also VOIDmode arguments.
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 2555dc8..ee90f35 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1,6 +1,6 @@
/* Reload pseudo regs into hard regs for insns that require hard regs.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2570,7 +2570,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
else if (reg_renumber && reg_renumber[regno] < 0
&& reg_equiv_invariant && reg_equiv_invariant[regno])
{
- if (may_use_invariant)
+ if (may_use_invariant || (insn && DEBUG_INSN_P (insn)))
return eliminate_regs_1 (copy_rtx (reg_equiv_invariant[regno]),
mem_mode, insn, true);
/* There exists at least one use of REGNO that cannot be
@@ -2685,9 +2685,11 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
if (ep->from_rtx == XEXP (x, 0) && ep->can_eliminate)
{
if (! mem_mode
- /* Refs inside notes don't count for this purpose. */
+ /* Refs inside notes or in DEBUG_INSNs don't count for
+ this purpose. */
&& ! (insn != 0 && (GET_CODE (insn) == EXPR_LIST
- || GET_CODE (insn) == INSN_LIST)))
+ || GET_CODE (insn) == INSN_LIST
+ || DEBUG_INSN_P (insn))))
ep->ref_outside_mem = 1;
return
@@ -2863,6 +2865,9 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
return x;
case CLOBBER:
+ gcc_assert (insn && DEBUG_INSN_P (insn));
+ break;
+
case ASM_OPERANDS:
case SET:
gcc_unreachable ();
@@ -3199,6 +3204,9 @@ eliminate_regs_in_insn (rtx insn, int replace)
|| GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (insn)) == ASM_INPUT
|| DEBUG_INSN_P (insn));
+ if (DEBUG_INSN_P (insn))
+ INSN_VAR_LOCATION_LOC (insn)
+ = eliminate_regs (INSN_VAR_LOCATION_LOC (insn), VOIDmode, insn);
return 0;
}