diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2009-10-22 22:30:12 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2009-10-22 22:30:12 +0000 |
commit | bd7960b1e4ce9d64b2631d0b644eb8bf83845005 (patch) | |
tree | 4f4554809ba030c1b41d267109a8f8706fa58231 /gcc/rtl.c | |
parent | 2a31793e324e29c237dc9e46064280aa626374ad (diff) | |
download | gcc-bd7960b1e4ce9d64b2631d0b644eb8bf83845005.zip gcc-bd7960b1e4ce9d64b2631d0b644eb8bf83845005.tar.gz gcc-bd7960b1e4ce9d64b2631d0b644eb8bf83845005.tar.bz2 |
rtl.h (shallow_copy_rtvec): Declare.
gcc/
* rtl.h (shallow_copy_rtvec): Declare.
* rtl.c (shallow_copy_rtvec): New function.
* cselib.c (cselib_subst_to_values): Use it. Only modify an
rtx field if the subrtx has changed.
From-SVN: r153475
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r-- | gcc/rtl.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -164,6 +164,20 @@ rtvec_alloc (int n) return rt; } +/* Create a bitwise copy of VEC. */ + +rtvec +shallow_copy_rtvec (rtvec vec) +{ + rtvec newvec; + int n; + + n = GET_NUM_ELEM (vec); + newvec = rtvec_alloc (n); + memcpy (&newvec->elem[0], &vec->elem[0], sizeof (rtx) * n); + return newvec; +} + /* Return the number of bytes occupied by rtx value X. */ unsigned int |