From 56812845490199b04123d9faf55cc2b338e6dfb9 Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Sat, 4 Jun 2016 11:00:58 +0000 Subject: [PATCH] re PR tree-optimization/52171 (memcmp/strcmp/strncmp can be optimized when the result is tested for [in]equality with 0) gcc/ChangeLog PR tree-optimization/52171 * config/sh/sh.c (sh_use_by_pieces_infrastructure_p): Use by_pieces_ninsns instead of move_by_pieces_ninsns. From-SVN: r237090 --- gcc/ChangeLog | 6 ++++++ gcc/config/sh/sh.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bce140bef53..3e11cb9e06c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-04 Oleg Endo + + PR tree-optimization/52171 + * config/sh/sh.c (sh_use_by_pieces_infrastructure_p): Use + by_pieces_ninsns instead of move_by_pieces_ninsns. + 2016-06-04 Oleg Endo * config/sh/sh.c (sh_print_operand_address): Don't use hardcoded 'r0' diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 74327aa7c7e..0960a99fd2c 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -12506,11 +12506,11 @@ sh_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size, switch (op) { case MOVE_BY_PIECES: - return move_by_pieces_ninsns (size, align, MOVE_MAX_PIECES + 1) + return by_pieces_ninsns (size, align, MOVE_MAX_PIECES + 1, op) < (!speed_p ? 2 : (align >= 32) ? 16 : 2); case STORE_BY_PIECES: case SET_BY_PIECES: - return move_by_pieces_ninsns (size, align, STORE_MAX_PIECES + 1) + return by_pieces_ninsns (size, align, STORE_MAX_PIECES + 1, op) < (!speed_p ? 2 : (align >= 32) ? 16 : 2); default: return default_use_by_pieces_infrastructure_p (size, align, -- 2.30.2