builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to reflect size of memory regions...
authorUlrich Weigand <uweigand@de.ibm.com>
Sun, 26 Sep 2004 19:15:00 +0000 (19:15 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Sun, 26 Sep 2004 19:15:00 +0000 (19:15 +0000)
* builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to
reflect size of memory regions being compared.

From-SVN: r88142

gcc/ChangeLog
gcc/builtins.c

index 718e131..9c745f9 100644 (file)
@@ -1,5 +1,10 @@
 2004-09-26  Ulrich Weigand  <uweigand@de.ibm.com>
 
+       * builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to
+       reflect size of memory regions being compared.
+
+2004-09-26  Ulrich Weigand  <uweigand@de.ibm.com>
+
        * builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR
        expressions.  Always clear MEM_SIZE and alias set.
 
index 9127f45..1aeae96 100644 (file)
@@ -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,