aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2020-04-16 23:26:41 -0500
committerPeter Bergner <bergner@linux.ibm.com>2020-04-16 23:26:41 -0500
commitdd75498db79675a1a0b73c25e5f110969ee72d9d (patch)
tree2a922265561c7abda125081907967a1ef97345cf /gcc/config
parent5fb9a619eee6632f89d9d8df1515addb9a4a6404 (diff)
downloadgcc-dd75498db79675a1a0b73c25e5f110969ee72d9d.zip
gcc-dd75498db79675a1a0b73c25e5f110969ee72d9d.tar.gz
gcc-dd75498db79675a1a0b73c25e5f110969ee72d9d.tar.bz2
rs6000: Fix ICE in decompose_normal_address. [PR93974]
Fix an ICE in decompose_normal_address(), which cannot handle Altivec AND: addresses, by disallowing them via implementing the target hook rs6000_cannot_substitute_mem_equiv_p. gcc/ PR rtl-optimization/93974 * config/rs6000/rs6000.c (TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P): Define. (rs6000_cannot_substitute_mem_equiv_p): New function. gcc/testsuite/ PR rtl-optimization/93974 * g++.dg/pr93974.C: New test.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/rs6000.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 4defc1a..a2992e6 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1734,6 +1734,10 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_MANGLE_DECL_ASSEMBLER_NAME
#define TARGET_MANGLE_DECL_ASSEMBLER_NAME rs6000_mangle_decl_assembler_name
+
+#undef TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P
+#define TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P \
+ rs6000_cannot_substitute_mem_equiv_p
/* Processor table. */
@@ -26375,6 +26379,22 @@ rs6000_predict_doloop_p (struct loop *loop)
return true;
}
+/* Implement TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P. */
+
+static bool
+rs6000_cannot_substitute_mem_equiv_p (rtx mem)
+{
+ gcc_assert (MEM_P (mem));
+
+ /* curr_insn_transform()'s handling of subregs cannot handle altivec AND:
+ type addresses, so don't allow MEMs with those address types to be
+ substituted as an equivalent expression. See PR93974 for details. */
+ if (GET_CODE (XEXP (mem, 0)) == AND)
+ return true;
+
+ return false;
+}
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-rs6000.h"