aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-03-22 13:11:31 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-03-22 13:11:31 +0000
commitce9d4c6d80126b0d4549e80ddd92bfab017d22f4 (patch)
tree3dc71ee0033d2efbf9c8a4e8c88dd81a231e3a57 /gcc/rtl.c
parentd3c29f99efaa2162cc444dc66c8c488f31dfa88d (diff)
downloadgcc-ce9d4c6d80126b0d4549e80ddd92bfab017d22f4.zip
gcc-ce9d4c6d80126b0d4549e80ddd92bfab017d22f4.tar.gz
gcc-ce9d4c6d80126b0d4549e80ddd92bfab017d22f4.tar.bz2
rtl.h (shallow_copy_rtx): Declare.
* rtl.h (shallow_copy_rtx): Declare. * rtl.c (shallow_copy_rtx): New function. * reload.c (find_reloads_toplev): Use shallow_copy_rtx instead of copy_rtx. From-SVN: r25897
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index ae474d0..6b04bcd 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -488,6 +488,28 @@ copy_most_rtx (orig, may_share)
}
return copy;
}
+
+/* Create a new copy of an rtx. Only copy just one level. */
+rtx
+shallow_copy_rtx (orig)
+ rtx orig;
+{
+ register int i;
+ register char *format_ptr;
+ register RTX_CODE code = GET_CODE (orig);
+ register rtx copy = rtx_alloc (code);
+
+ PUT_MODE (copy, GET_MODE (orig));
+ copy->in_struct = orig->in_struct;
+ copy->volatil = orig->volatil;
+ copy->unchanging = orig->unchanging;
+ copy->integrated = orig->integrated;
+
+ for (i = 0; i < GET_RTX_LENGTH (code); i++)
+ copy->fld[i] = orig->fld[i];
+
+ return copy;
+}
/* Subroutines of read_rtx. */