summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-11-29 12:22:38 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-11-29 12:22:38 +0000
commitec342ed9c74ea4be2517af308dd2d341ecece10f (patch)
treef599a0f31bc60f69c8f470deaf85ecb8cc9dad29 /gnu
parenta92ccd0816e915f64899d5c6b0902c107841966b (diff)
Import gcc-3.3.2. Only the compiler. ada frontend removed for space
considerations.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gcc/gcc/flow.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/gnu/usr.bin/gcc/gcc/flow.c b/gnu/usr.bin/gcc/gcc/flow.c
index 9f5e1924e91..7882b25ae9a 100644
--- a/gnu/usr.bin/gcc/gcc/flow.c
+++ b/gnu/usr.bin/gcc/gcc/flow.c
@@ -1,6 +1,6 @@
/* Data flow analysis for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GCC.
@@ -431,8 +431,9 @@ life_analysis (f, file, flags)
SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
#endif
+
#ifdef CANNOT_CHANGE_MODE_CLASS
- init_subregs_of_mode ();
+ bitmap_initialize (&subregs_of_mode, 1);
#endif
if (! optimize)
@@ -1798,9 +1799,8 @@ propagate_one_insn (pbi, insn)
current_function_return_rtx,
(rtx *) 0)))
{
- enum rtx_code code = global_regs[i] ? SET : CLOBBER;
/* We do not want REG_UNUSED notes for these registers. */
- mark_set_1 (pbi, code, regno_reg_rtx[i], cond, insn,
+ mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
pbi->flags & ~(PROP_DEATH_NOTES | PROP_REG_INFO));
}
}
@@ -2292,22 +2292,14 @@ insn_dead_p (pbi, x, call_ok, notes)
}
/* A CLOBBER of a pseudo-register that is dead serves no purpose. That
- is not necessarily true for hard registers until after reload. */
- else if (code == CLOBBER)
- {
- if (GET_CODE (XEXP (x, 0)) == REG
- && (REGNO (XEXP (x, 0)) >= FIRST_PSEUDO_REGISTER
- || reload_completed)
- && ! REGNO_REG_SET_P (pbi->reg_live, REGNO (XEXP (x, 0))))
- return 1;
- }
-
- /* ??? A base USE is a historical relic. It ought not be needed anymore.
- Instances where it is still used are either (1) temporary and the USE
- escaped the pass, (2) cruft and the USE need not be emitted anymore,
- or (3) hiding bugs elsewhere that are not properly representing data
- flow. */
-
+ is not necessarily true for hard registers. */
+ else if (code == CLOBBER && GET_CODE (XEXP (x, 0)) == REG
+ && REGNO (XEXP (x, 0)) >= FIRST_PSEUDO_REGISTER
+ && ! REGNO_REG_SET_P (pbi->reg_live, REGNO (XEXP (x, 0))))
+ return 1;
+
+ /* We do not check other CLOBBER or USE here. An insn consisting of just
+ a CLOBBER or just a USE should not be deleted. */
return 0;
}
@@ -2821,18 +2813,10 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
in ASM_OPERANDs. If these registers get replaced,
we might wind up changing the semantics of the insn,
even if reload can make what appear to be valid
- assignments later.
-
- We don't build a LOG_LINK for global registers to
- or from a function call. We don't want to let
- combine think that it knows what is going on with
- global registers. */
+ assignments later. */
if (y && (BLOCK_NUM (y) == blocknum)
&& (regno_first >= FIRST_PSEUDO_REGISTER
- || (asm_noperands (PATTERN (y)) < 0
- && ! ((GET_CODE (insn) == CALL_INSN
- || GET_CODE (y) == CALL_INSN)
- && global_regs[regno_first]))))
+ || asm_noperands (PATTERN (y)) < 0))
LOG_LINKS (y) = alloc_INSN_LIST (insn, LOG_LINKS (y));
}
}
@@ -3850,7 +3834,11 @@ mark_used_regs (pbi, x, cond, insn)
case SUBREG:
#ifdef CANNOT_CHANGE_MODE_CLASS
- record_subregs_of_mode (x);
+ if (GET_CODE (SUBREG_REG (x)) == REG
+ && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER)
+ bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (x))
+ * MAX_MACHINE_MODE
+ + GET_MODE (x));
#endif
/* While we're here, optimize this case. */
@@ -3895,8 +3883,12 @@ mark_used_regs (pbi, x, cond, insn)
|| GET_CODE (testreg) == SUBREG)
{
#ifdef CANNOT_CHANGE_MODE_CLASS
- if (GET_CODE (testreg) == SUBREG)
- record_subregs_of_mode (testreg);
+ if (GET_CODE (testreg) == SUBREG
+ && GET_CODE (SUBREG_REG (testreg)) == REG
+ && REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER)
+ bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (testreg))
+ * MAX_MACHINE_MODE
+ + GET_MODE (testreg));
#endif
/* Modifying a single register in an alternate mode