summaryrefslogtreecommitdiffstats
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-04 11:01:59 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-04 11:01:59 +0000
commit97d4c6a6f9fc5abb5e0751c9aec6e939b849bdbe (patch)
tree3a84137139d5fdc5a1aede4370b9facfe6b5a883 /gcc/builtins.c
parente983a0280fa7ddda962a7179ea85bd3b01fa1df5 (diff)
downloadppe42-gcc-97d4c6a6f9fc5abb5e0751c9aec6e939b849bdbe.tar.gz
ppe42-gcc-97d4c6a6f9fc5abb5e0751c9aec6e939b849bdbe.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index e3c91dc635b..0436229fa81 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);
OpenPOWER on IntegriCloud