aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-10-13 19:36:25 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-10-13 19:36:25 -0700
commit11e5489b1ecfb256cc64970a87b32f0cd856ec15 (patch)
tree51a800a28d41560979b3f43722ce59dd57c542ee /gcc/rtl.c
parent8fa7c5af3fcde02ab4aad8cba0e01091f362ba6c (diff)
downloadgcc-11e5489b1ecfb256cc64970a87b32f0cd856ec15.zip
gcc-11e5489b1ecfb256cc64970a87b32f0cd856ec15.tar.gz
gcc-11e5489b1ecfb256cc64970a87b32f0cd856ec15.tar.bz2
* rtl.c (shallow_copy_rtx): Use memcpy for the entire node.
From-SVN: r58102
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index c8b36b7..065c02b 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -387,19 +387,12 @@ rtx
shallow_copy_rtx (orig)
rtx orig;
{
- int i;
RTX_CODE code = GET_CODE (orig);
- rtx copy = rtx_alloc (code);
-
- PUT_MODE (copy, GET_MODE (orig));
- RTX_FLAG (copy, in_struct) = RTX_FLAG (orig, in_struct);
- RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
- RTX_FLAG (copy, unchanging) = RTX_FLAG (orig, unchanging);
- RTX_FLAG (copy, integrated) = RTX_FLAG (orig, integrated);
- RTX_FLAG (copy, frame_related) = RTX_FLAG (orig, frame_related);
+ size_t n = GET_RTX_LENGTH (code);
+ rtx copy = ggc_alloc_rtx (n);
- for (i = 0; i < GET_RTX_LENGTH (code); i++)
- copy->fld[i] = orig->fld[i];
+ memcpy (copy, orig,
+ sizeof (struct rtx_def) + sizeof (rtunion) * (n - 1));
return copy;
}