aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Zlomek <zlomekj@suse.cz>2004-02-10 19:38:19 +0100
committerJosef Zlomek <zlomek@gcc.gnu.org>2004-02-10 18:38:19 +0000
commitfbe6ec8150896cfa14b8500c932d9b890c18c297 (patch)
tree8c381fb07eefd127e201f05bbc881c960cd8ca97
parent8a4baa83a1ed5cc8fb7089263c768398a4b92f64 (diff)
downloadgcc-fbe6ec8150896cfa14b8500c932d9b890c18c297.zip
gcc-fbe6ec8150896cfa14b8500c932d9b890c18c297.tar.gz
gcc-fbe6ec8150896cfa14b8500c932d9b890c18c297.tar.bz2
emit-rtl.c (set_decl_incoming_rtl): New.
PR/14058 * emit-rtl.c (set_decl_incoming_rtl): New. * tree.h (set_decl_incoming_rtl): New. * function.c (assign_parms): Use set_decl_incoming_rtl for setting DECL_INCOMING_RTL. * ada/misc.c (adjust_decl_rtl): Likewise. From-SVN: r77611
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/ada/misc.c2
-rw-r--r--gcc/emit-rtl.c34
-rw-r--r--gcc/function.c16
-rw-r--r--gcc/tree.h1
5 files changed, 54 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ba6a785..a3e050d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-02-10 Josef Zlomek <zlomekj@suse.cz>
+
+ PR/14058
+ * emit-rtl.c (set_decl_incoming_rtl): New.
+ * tree.h (set_decl_incoming_rtl): New.
+ * function.c (assign_parms): Use set_decl_incoming_rtl for setting
+ DECL_INCOMING_RTL.
+ * ada/misc.c (adjust_decl_rtl): Likewise.
+
2004-02-10 Per Bothner <per@bothner.com>
* c-opts.c (c_common_post_options): Don't emit working directory
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 7e544fb..6a40590 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -774,7 +774,7 @@ adjust_decl_rtl (tree decl)
DECL_SIZE (decl) = TYPE_SIZE (new_type);
if (TREE_CODE (decl) == PARM_DECL)
- DECL_INCOMING_RTL (decl) = XEXP (DECL_INCOMING_RTL (decl), 0);
+ set_decl_incoming_rtl (decl, XEXP (DECL_INCOMING_RTL (decl), 0));
/* If DECL_INITIAL was set, it should be updated to show that
the decl is initialized to the address of that thing.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 6402f43..814e2bb 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -828,6 +828,40 @@ set_decl_rtl (tree t, rtx x)
}
}
+/* Assign the RTX X to parameter declaration T. */
+void
+set_decl_incoming_rtl (tree t, rtx x)
+{
+ DECL_INCOMING_RTL (t) = x;
+
+ if (!x)
+ return;
+ /* For register, we maintain the reverse information too. */
+ if (GET_CODE (x) == REG)
+ REG_ATTRS (x) = get_reg_attrs (t, 0);
+ else if (GET_CODE (x) == SUBREG)
+ REG_ATTRS (SUBREG_REG (x))
+ = get_reg_attrs (t, -SUBREG_BYTE (x));
+ if (GET_CODE (x) == CONCAT)
+ {
+ if (REG_P (XEXP (x, 0)))
+ REG_ATTRS (XEXP (x, 0)) = get_reg_attrs (t, 0);
+ if (REG_P (XEXP (x, 1)))
+ REG_ATTRS (XEXP (x, 1))
+ = get_reg_attrs (t, GET_MODE_UNIT_SIZE (GET_MODE (XEXP (x, 0))));
+ }
+ if (GET_CODE (x) == PARALLEL)
+ {
+ int i;
+ for (i = 0; i < XVECLEN (x, 0); i++)
+ {
+ rtx y = XVECEXP (x, 0, i);
+ if (REG_P (XEXP (y, 0)))
+ REG_ATTRS (XEXP (y, 0)) = get_reg_attrs (t, INTVAL (XEXP (y, 1)));
+ }
+ }
+}
+
/* Identify REG (which may be a CONCAT) as a user register. */
void
diff --git a/gcc/function.c b/gcc/function.c
index 6596e0e..e2024f2 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4645,7 +4645,7 @@ assign_parms (tree fndecl)
entry_parm = stack_parm;
/* Record permanently how this parm was passed. */
- DECL_INCOMING_RTL (parm) = entry_parm;
+ set_decl_incoming_rtl (parm, entry_parm);
/* If there is actually space on the stack for this parm,
count it in stack_args_size; otherwise set stack_parm to 0
@@ -4714,7 +4714,7 @@ assign_parms (tree fndecl)
&& INTVAL (XEXP (XVECEXP (entry_parm, 0, i), 1)) == 0)
{
entry_parm = XEXP (XVECEXP (entry_parm, 0, i), 0);
- DECL_INCOMING_RTL (parm) = entry_parm;
+ set_decl_incoming_rtl (parm, entry_parm);
break;
}
}
@@ -5225,20 +5225,22 @@ assign_parms (tree fndecl)
{
if (TREE_CODE (TREE_TYPE (parm)) == COMPLEX_TYPE)
{
+ rtx tmp;
+
SET_DECL_RTL (parm,
gen_rtx_CONCAT (DECL_MODE (parm),
DECL_RTL (fnargs),
DECL_RTL (TREE_CHAIN (fnargs))));
- DECL_INCOMING_RTL (parm)
- = gen_rtx_CONCAT (DECL_MODE (parm),
- DECL_INCOMING_RTL (fnargs),
- DECL_INCOMING_RTL (TREE_CHAIN (fnargs)));
+ tmp = gen_rtx_CONCAT (DECL_MODE (parm),
+ DECL_INCOMING_RTL (fnargs),
+ DECL_INCOMING_RTL (TREE_CHAIN (fnargs)));
+ set_decl_incoming_rtl (parm, tmp);
fnargs = TREE_CHAIN (fnargs);
}
else
{
SET_DECL_RTL (parm, DECL_RTL (fnargs));
- DECL_INCOMING_RTL (parm) = DECL_INCOMING_RTL (fnargs);
+ set_decl_incoming_rtl (parm, DECL_INCOMING_RTL (fnargs));
}
fnargs = TREE_CHAIN (fnargs);
}
diff --git a/gcc/tree.h b/gcc/tree.h
index 5b075d9..6f19cab 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3080,6 +3080,7 @@ extern const char *dump_flag_name (enum tree_dump_index);
/* Assign the RTX to declaration. */
extern void set_decl_rtl (tree, rtx);
+extern void set_decl_incoming_rtl (tree, rtx);
/* Redefine abort to report an internal error w/o coredump, and
reporting the location of the error in the source file. This logic