@@ -12043,6 +12043,17 @@ s390_option_override (void)
register_pass (&insert_pass_s390_early_mach);
}
+/* Implement TARGET_MOVE_BY_PIECES_PROFITABLE_P. */
+
+static bool
+s390_move_by_pieces_profitable_p (unsigned int size,
+ unsigned int align ATTRIBUTE_UNUSED,
+ bool speed_p ATTRIBUTE_UNUSED)
+{
+ return (size == 1 || size == 2
+ || size == 4 || (TARGET_ZARCH && size == 8));
+}
+
/* Initialize GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -12228,6 +12239,9 @@ s390_option_override (void)
#undef TARGET_SET_UP_BY_PROLOGUE
#define TARGET_SET_UP_BY_PROLOGUE s300_set_up_by_prologue
+#undef TARGET_MOVE_BY_PIECES_PROFITABLE_P
+#define TARGET_MOVE_BY_PIECES_PROFITABLE_P s390_move_by_pieces_profitable_p
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-s390.h"
@@ -744,11 +744,6 @@ do { \
#define MOVE_MAX_PIECES (TARGET_ZARCH ? 8 : 4)
#define MAX_MOVE_MAX 16
-/* Determine whether to use move_by_pieces or block move insn. */
-#define MOVE_BY_PIECES_P(SIZE, ALIGN) \
- ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \
- || (TARGET_ZARCH && (SIZE) == 8) )
-
/* Determine whether to use clear_by_pieces or block clear insn. */
#define CLEAR_BY_PIECES_P(SIZE, ALIGN) \
( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \
@@ -756,7 +751,9 @@ do { \
/* This macro is used to determine whether store_by_pieces should be
called to "memcpy" storage when the source is a constant string. */
-#define STORE_BY_PIECES_P(SIZE, ALIGN) MOVE_BY_PIECES_P (SIZE, ALIGN)
+#define STORE_BY_PIECES_P(SIZE, ALIGN) \
+ targetm.move_by_pieces_profitable_p \
+ (SIZE, ALIGN, optimize_function_for_size_p (cfun))
/* Likewise to decide whether to "memset" storage with byte values
other than zero. */