* config/i386/i386.c
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 9 Oct 2015 16:53:37 +0000 (18:53 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 9 Oct 2015 16:53:37 +0000 (18:53 +0200)
(expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Use
ROUND_DOWN where applicable.

From-SVN: r228665

gcc/ChangeLog
gcc/config/i386/i386.c

index 07195e5db0e55e6c44afc4b161a28297ae2071a6..f7b9e9f5c3997fd5ffb9a471e6106008380a3a67 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c
+       (expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Use
+       ROUND_DOWN where applicable.
+
 2015-10-09  Jeff Law  <law@redhat.com>
 
        * tree-vect-stmts.c (free_stmt_vec_info): Free the LHS of the
 
        * tree-ssa-dom.c (optimize_stmt): Don't set LOOPS_NEED_FIXUP here.
        * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Do it
-       here instead.  Tighten test to avoid setting LOOPS_NEED_FIXUP 
+       here instead.  Tighten test to avoid setting LOOPS_NEED_FIXUP
        unnecessarily.
 
 2015-10-07  Aditya Kumar  <aditya.k7@samsung.com>
index 4806a7cffa2950fc6dc36f98174a0597d3f4f33b..419966d8d4fb9ea680bf625835acfc056e9e12af 100644 (file)
@@ -25564,7 +25564,8 @@ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
                                    saveddest, *count, 1, OPTAB_DIRECT);
       /* We copied at most size + prolog_size.  */
       if (*min_size > (unsigned HOST_WIDE_INT)(size + prolog_size))
-       *min_size = (*min_size - size) & ~(unsigned HOST_WIDE_INT)(size - 1);
+       *min_size
+         = ROUND_DOWN (*min_size - size, (unsigned HOST_WIDE_INT)size);
       else
        *min_size = 0;
 
@@ -25582,9 +25583,10 @@ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
        *count = expand_simple_binop (GET_MODE (*count), PLUS, *count,
                                      constm1_rtx, *count, 1, OPTAB_DIRECT);
       else
-       *count = GEN_INT ((UINTVAL (*count) - 1) & ~(unsigned HOST_WIDE_INT)(size - 1));
+       *count = GEN_INT (ROUND_DOWN (UINTVAL (*count) - 1,
+                                     (unsigned HOST_WIDE_INT)size));
       if (*min_size)
-       *min_size = (*min_size - 1) & ~(unsigned HOST_WIDE_INT)(size - 1);
+       *min_size = ROUND_DOWN (*min_size - 1, (unsigned HOST_WIDE_INT)size);
     }
 }