aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2013-11-11 21:02:19 +0100
committerUros Bizjak <uros@gcc.gnu.org>2013-11-11 21:02:19 +0100
commit5783ad0ea7403304e4ea9c06818373a3bc7e62b1 (patch)
tree751c66d387964afc5ded5eb70600325d74f8b33e /gcc/config
parenteb47f18904bc0ec0556a217beb0ae15a4a2d9b11 (diff)
downloadgcc-5783ad0ea7403304e4ea9c06818373a3bc7e62b1.zip
gcc-5783ad0ea7403304e4ea9c06818373a3bc7e62b1.tar.gz
gcc-5783ad0ea7403304e4ea9c06818373a3bc7e62b1.tar.bz2
re PR target/58853 (ICE in expand_set_or_movmem_prologue_epilogue_by_misaligned_moves)
PR target/58853 * config/i386/x86-tune.def (X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES): Rename from TARGET_MISALIGNED_MOVE_STRING_PROLOGUES. * config/i386/i386.h (TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES): Rename from TARGET_MISALIGNED_MOVE_STRING_PROLOGUES_EPILOGUES. Update for renamed X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES. * config/i386/i386.c (ix86_expand_set_or_movmem): Use TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES to calculate misaligned_prologue_used. Check that desired_aling <= epilogue_size_needed. testsuite/ChangeLog: PR target/58853 * gcc.target/i386/pr58853.c: New test. Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com> From-SVN: r204685
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c16
-rw-r--r--gcc/config/i386/i386.h4
-rw-r--r--gcc/config/i386/x86-tune.def14
3 files changed, 18 insertions, 16 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 430d562..8b8cdfae 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -23761,13 +23761,15 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp,
}
gcc_assert (desired_align >= 1 && align >= 1);
- /* Misaligned move sequences handles both prologues and epilogues at once.
- Default code generation results in smaller code for large alignments and
- also avoids redundant job when sizes are known precisely. */
- misaligned_prologue_used = (TARGET_MISALIGNED_MOVE_STRING_PROLOGUES
- && MAX (desired_align, epilogue_size_needed) <= 32
- && ((desired_align > align && !align_bytes)
- || (!count && epilogue_size_needed > 1)));
+ /* Misaligned move sequences handle both prologue and epilogue at once.
+ Default code generation results in a smaller code for large alignments
+ and also avoids redundant job when sizes are known precisely. */
+ misaligned_prologue_used
+ = (TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES
+ && MAX (desired_align, epilogue_size_needed) <= 32
+ && desired_align <= epilogue_size_needed
+ && ((desired_align > align && !align_bytes)
+ || (!count && epilogue_size_needed > 1)));
/* Do the cheap promotion to allow better CSE across the
main loop and epilogue (ie one load of the big constant in the
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 9836a40..123e3fa 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -353,8 +353,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
#define TARGET_PROMOTE_QImode ix86_tune_features[X86_TUNE_PROMOTE_QIMODE]
#define TARGET_FAST_PREFIX ix86_tune_features[X86_TUNE_FAST_PREFIX]
#define TARGET_SINGLE_STRINGOP ix86_tune_features[X86_TUNE_SINGLE_STRINGOP]
-#define TARGET_MISALIGNED_MOVE_STRING_PROLOGUES_EPILOGUES \
- ix86_tune_features[TARGET_MISALIGNED_MOVE_STRING_PROLOGUES]
+#define TARGET_MISALIGNED_MOVE_STRING_PRO_EPILOGUES \
+ ix86_tune_features[X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES]
#define TARGET_QIMODE_MATH ix86_tune_features[X86_TUNE_QIMODE_MATH]
#define TARGET_HIMODE_MATH ix86_tune_features[X86_TUNE_HIMODE_MATH]
#define TARGET_PROMOTE_QI_REGS ix86_tune_features[X86_TUNE_PROMOTE_QI_REGS]
diff --git a/gcc/config/i386/x86-tune.def b/gcc/config/i386/x86-tune.def
index 1a85ce2..23879f9 100644
--- a/gcc/config/i386/x86-tune.def
+++ b/gcc/config/i386/x86-tune.def
@@ -257,13 +257,13 @@ DEF_TUNE (X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE, "avoid_mem_opnd_for_cmove",
as MOVS and STOS (without a REP prefix) to move/set sequences of bytes. */
DEF_TUNE (X86_TUNE_SINGLE_STRINGOP, "single_stringop", m_386 | m_P4_NOCONA)
-/* TARGET_MISALIGNED_MOVE_STRING_PROLOGUES: Enable generation of compace
- prologues and epilogues by issuing a misaligned moves. This require
- target to handle misaligned moves and partial memory stalls resonably
- well.
- FIXME: This actualy may be a win on more targets than listed here. */
-DEF_TUNE (TARGET_MISALIGNED_MOVE_STRING_PROLOGUES,
- "misaligned_move_string_prologues",
+/* X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES: Enable generation of
+ compact prologues and epilogues by issuing a misaligned moves. This
+ requires target to handle misaligned moves and partial memory stalls
+ reasonably well.
+ FIXME: This may actualy be a win on more targets than listed here. */
+DEF_TUNE (X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES,
+ "misaligned_move_string_pro_epilogues",
m_386 | m_486 | m_CORE_ALL | m_AMD_MULTIPLE | m_GENERIC)
/* X86_TUNE_USE_SAHF: Controls use of SAHF. */