diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-02 17:14:18 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-02 17:14:18 +0000 |
commit | f5fec377965fb10837ee39ee309b1c1551c65f11 (patch) | |
tree | 39bbecf80e9d1c5b798a7278196759f5812197f4 /gcc/builtins.c | |
parent | 0ecf7a657255369b2827f6c14cf92c21b3c4e2f1 (diff) | |
download | gcc-f5fec377965fb10837ee39ee309b1c1551c65f11.tar.gz |
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
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) |