aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-03-30 15:18:55 +0200
committerRichard Biener <rguenther@suse.de>2022-03-31 09:18:42 +0200
commitb8207ad367174df5f2e2fdf3305c97ed227d8f78 (patch)
tree328cb87df4eccad37fd03f0dfc040074c73a937a /gcc
parent63cd7cef7e0f49fa557c5f694dbbd2e68de1f822 (diff)
downloadgcc-b8207ad367174df5f2e2fdf3305c97ed227d8f78.zip
gcc-b8207ad367174df5f2e2fdf3305c97ed227d8f78.tar.gz
gcc-b8207ad367174df5f2e2fdf3305c97ed227d8f78.tar.bz2
Revert "gimple: allow more folding of memcpy [PR102125]"
This reverts commit 5f6a6c91d7c592cb49f7c519f289777eac09bb74.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-fold.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index e73bc6a..270a9a2 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -67,8 +67,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-vector-builder.h"
#include "tree-ssa-strlen.h"
#include "varasm.h"
-#include "memmodel.h"
-#include "optabs.h"
#include "internal-fn.h"
enum strlen_range_kind {
@@ -962,17 +960,14 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
= build_int_cst (build_pointer_type_for_mode (char_type_node,
ptr_mode, true), 0);
- /* If we can perform the copy efficiently with first doing all loads and
- then all stores inline it that way. Currently efficiently means that
- we can load all the memory with a single set operation and that the
- total size is less than MOVE_MAX * MOVE_RATIO. */
+ /* If we can perform the copy efficiently with first doing all loads
+ and then all stores inline it that way. Currently efficiently
+ means that we can load all the memory into a single integer
+ register which is what MOVE_MAX gives us. */
src_align = get_pointer_alignment (src);
dest_align = get_pointer_alignment (dest);
if (tree_fits_uhwi_p (len)
- && (compare_tree_int
- (len, (MOVE_MAX
- * MOVE_RATIO (optimize_function_for_size_p (cfun))))
- <= 0)
+ && compare_tree_int (len, MOVE_MAX) <= 0
/* FIXME: Don't transform copies from strings with known length.
Until GCC 9 this prevented a case in gcc.dg/strlenopt-8.c
from being handled, and the case was XFAILed for that reason.
@@ -1006,7 +1001,6 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
scalar_int_mode mode;
if (int_mode_for_size (ilen * 8, 0).exists (&mode)
&& GET_MODE_SIZE (mode) * BITS_PER_UNIT == ilen * 8
- && have_insn_for (SET, mode)
/* If the destination pointer is not aligned we must be able
to emit an unaligned store. */
&& (dest_align >= GET_MODE_ALIGNMENT (mode)