aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-02-09 18:45:34 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-02-09 18:45:34 -0500
commit7988fd364ac120730ec4fdaf48e2bbc5c1df1443 (patch)
tree3062f440fa6682c2afb7fafb785f3ead7d042d92 /gcc/combine.c
parent626043cfc3b0b25d10c80c33e3a76f7a4b9480e3 (diff)
downloadgcc-7988fd364ac120730ec4fdaf48e2bbc5c1df1443.zip
gcc-7988fd364ac120730ec4fdaf48e2bbc5c1df1443.tar.gz
gcc-7988fd364ac120730ec4fdaf48e2bbc5c1df1443.tar.bz2
(setup_incoming_promotions): New function.
(combine_instructions): Add calls to setup_incoming_promotions. From-SVN: r3451
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 5f45cd6..ee542d0 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -354,6 +354,7 @@ static struct undobuf undobuf;
static int n_occurrences;
static void set_nonzero_bits_and_sign_copies ();
+static void setup_incoming_promotions ();
static void move_deaths ();
rtx remove_death ();
static void record_value_for_reg ();
@@ -458,6 +459,8 @@ combine_instructions (f, nregs)
label_tick = 1;
+ setup_incoming_promotions ();
+
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
INSN_CUID (insn) = ++i;
@@ -488,6 +491,8 @@ combine_instructions (f, nregs)
bzero (reg_last_set_label, nregs * sizeof (short));
bzero (reg_last_set_invalid, nregs * sizeof (char));
+ setup_incoming_promotions ();
+
for (insn = f; insn; insn = next ? next : NEXT_INSN (insn))
{
next = 0;
@@ -594,6 +599,28 @@ combine_instructions (f, nregs)
nonzero_sign_valid = 0;
}
+/* Set up any promoted values for incoming argument registers. */
+
+void
+setup_incoming_promotions ()
+{
+#ifdef PROMOTE_FUNCTION_ARGS
+ int regno;
+ rtx reg;
+ enum machine_mode mode;
+ int unsignedp;
+ rtx first = get_insns ();
+
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (FUNCTION_ARG_REGNO_P (regno)
+ && (reg = promoted_input_arg (regno, &mode, &unsignedp)) != 0)
+ record_value_for_reg (reg, first,
+ gen_rtx (unsignedp ? ZERO_EXTEND : SIGN_EXTEND,
+ mode,
+ gen_rtx (CLOBBER, VOIDmode, const0_rtx)));
+#endif
+}
+
/* Called via note_stores. If X is a pseudo that is used in more than
one basic block, is narrower that HOST_BITS_PER_WIDE_INT, and is being
set, record what bits are known zero. If we are clobbering X,
@@ -8637,8 +8664,8 @@ update_table_tick (x)
/* Record that REG is set to VALUE in insn INSN. If VALUE is zero, we
are saying that the register is clobbered and we no longer know its
- value. If INSN is zero, don't update reg_last_set; this call is normally
- done with VALUE also zero to invalidate the register. */
+ value. If INSN is zero, don't update reg_last_set; this is only permitted
+ with VALUE also zero and is used to invalidate the register. */
static void
record_value_for_reg (reg, insn, value)