From f5fec377965fb10837ee39ee309b1c1551c65f11 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 2 Dec 2008 17:14:18 +0000 Subject: PR middle-end/38343 * builtins.c (fold_builtin_memory_op): Convert len to sizetype before using it in POINTER_PLUS_EXPR. * gcc.c-torture/compile/pr38343-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142363 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/builtins.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/builtins.c') diff --git a/gcc/builtins.c b/gcc/builtins.c index 34066675873..444baa606d1 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -8993,6 +8993,7 @@ fold_builtin_memory_op (tree dest, tree src, tree len, tree type, bool ignore, i len = fold_build2 (MINUS_EXPR, TREE_TYPE (len), len, ssize_int (1)); + len = fold_convert (sizetype, len); dest = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len); dest = fold_convert (type, dest); if (expr) -- cgit v1.2.1