From b867c7ca88776d062e3e62c212fb0a59b6d688c9 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 9 Oct 2015 18:53:37 +0200 Subject: [PATCH] * config/i386/i386.c (expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Use ROUND_DOWN where applicable. From-SVN: r228665 --- gcc/ChangeLog | 8 +++++++- gcc/config/i386/i386.c | 8 +++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07195e5db0e..f7b9e9f5c39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-09 Uros Bizjak + + * config/i386/i386.c + (expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Use + ROUND_DOWN where applicable. + 2015-10-09 Jeff Law * tree-vect-stmts.c (free_stmt_vec_info): Free the LHS of the @@ -224,7 +230,7 @@ * 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 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4806a7cffa2..419966d8d4f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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); } } -- 2.30.2