]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* rtl.c (shallow_copy_rtx): Use memcpy for the entire node.
authorRichard Henderson <rth@redhat.com>
Mon, 14 Oct 2002 02:36:25 +0000 (19:36 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 14 Oct 2002 02:36:25 +0000 (19:36 -0700)
From-SVN: r58102

gcc/ChangeLog
gcc/rtl.c

index feb9a9db83b9adedcf982c687a3c41d37fc1ea6a..7bde8dd690e8e63cff505641c53a50b2d6c16660 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-13  Richard Henderson  <rth@redhat.com>
+
+       * rtl.c (shallow_copy_rtx): Use memcpy for the entire node.
+
 2002-10-12  Neil Booth  <neil@daikokuya.co.uk>
 
        PR preprocessor/7862
index c8b36b77fb70e911455ad3bf7cd7f1fce28f3705..065c02b40c3dcef8cf1990bccf7efaa603eb0e36 100644 (file)
--- 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;
 }