From: Ulrich Weigand Date: Sun, 26 Sep 2004 19:15:00 +0000 (+0000) Subject: builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to reflect size of memory regions... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6cbaec9e895dd7f79385300731d46e37c07311c8;p=gcc.git builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to reflect size of memory regions being compared. * builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to reflect size of memory regions being compared. From-SVN: r88142 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 718e13116ff..9c745f9e01b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-09-26 Ulrich Weigand + + * builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to + reflect size of memory regions being compared. + 2004-09-26 Ulrich Weigand * builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR diff --git a/gcc/builtins.c b/gcc/builtins.c index 9127f45b6aa..1aeae965401 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3540,6 +3540,14 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target, arg1_rtx = get_memory_rtx (arg1); arg2_rtx = get_memory_rtx (arg2); arg3_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); + + /* Set MEM_SIZE as appropriate. */ + if (GET_CODE (arg3_rtx) == CONST_INT) + { + set_mem_size (arg1_rtx, arg3_rtx); + set_mem_size (arg2_rtx, arg3_rtx); + } + #ifdef HAVE_cmpmemsi if (HAVE_cmpmemsi) insn = gen_cmpmemsi (result, arg1_rtx, arg2_rtx, arg3_rtx,