diff options
author | Richard Guenther <rguenther@suse.de> | 2009-05-04 11:01:59 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-05-04 11:01:59 +0000 |
commit | ea5cd5f17f80c6f6d6cf8b2a0868675e7c8ea391 (patch) | |
tree | 3a84137139d5fdc5a1aede4370b9facfe6b5a883 /gcc/builtins.c | |
parent | a967a1b62f0cb075423957684f8ab38606a192fd (diff) | |
download | gcc-ea5cd5f17f80c6f6d6cf8b2a0868675e7c8ea391.zip gcc-ea5cd5f17f80c6f6d6cf8b2a0868675e7c8ea391.tar.gz gcc-ea5cd5f17f80c6f6d6cf8b2a0868675e7c8ea391.tar.bz2 |
re PR middle-end/40015 (Revision 147083 failed gfortran.dg/array_memcpy_4.f90)
2009-05-04 Richard Guenther <rguenther@suse.de>
PR middle-end/40015
* builtins.c (fold_builtin_memory_op): Do not decay to element
type if the size matches the whole array.
From-SVN: r147094
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index e3c91dc..0436229 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -8970,7 +8970,8 @@ fold_builtin_memory_op (tree dest, tree src, tree len, tree type, bool ignore, i } srctype = TREE_TYPE (TREE_TYPE (src)); if (srctype - && TREE_CODE (srctype) == ARRAY_TYPE) + && TREE_CODE (srctype) == ARRAY_TYPE + && !tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len)) { srctype = TREE_TYPE (srctype); STRIP_NOPS (src); @@ -8978,7 +8979,8 @@ fold_builtin_memory_op (tree dest, tree src, tree len, tree type, bool ignore, i } desttype = TREE_TYPE (TREE_TYPE (dest)); if (desttype - && TREE_CODE (desttype) == ARRAY_TYPE) + && TREE_CODE (desttype) == ARRAY_TYPE + && !tree_int_cst_equal (TYPE_SIZE_UNIT (desttype), len)) { desttype = TREE_TYPE (desttype); STRIP_NOPS (dest); |