diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-14 02:36:25 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-14 02:36:25 +0000 |
commit | 35aae09b1082d2c1c3ba86fc6cc149948a89c9dc (patch) | |
tree | 51a800a28d41560979b3f43722ce59dd57c542ee /gcc/rtl.c | |
parent | 9efc810d4bc0315cad5c34197f5a9b8288489289 (diff) | |
download | gcc-35aae09b1082d2c1c3ba86fc6cc149948a89c9dc.tar.gz |
* rtl.c (shallow_copy_rtx): Use memcpy for the entire node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r-- | gcc/rtl.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c index c8b36b77fb7..065c02b40c3 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; } |