From: Richard Sandiford Date: Wed, 30 Mar 2011 15:00:44 +0000 (+0000) Subject: re PR target/47551 (ICE when reloading neon registers from out-of-range offsets) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=159b81b00a8683b5fe7efdbaff73391a8d9e2d96;p=gcc.git re PR target/47551 (ICE when reloading neon registers from out-of-range offsets) gcc/ PR target/47551 * config/arm/arm.c (coproc_secondary_reload_class): Handle structure modes. Don't check neon_vector_mem_operand for vector or structure modes. gcc/testsuite/ PR target/47551 * gcc.target/arm/neon-modes-2.c: New test. From-SVN: r171730 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff4a5e28705..31a0d1552c9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-03-30 Richard Sandiford + + PR target/47551 + * config/arm/arm.c (coproc_secondary_reload_class): Handle + structure modes. Don't check neon_vector_mem_operand for + vector or structure modes. + 2011-03-30 Richard Sandiford Ramana Radhakrishnan diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index de9e6f9cd25..57fe96c9c03 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9152,11 +9152,14 @@ coproc_secondary_reload_class (enum machine_mode mode, rtx x, bool wb) return GENERAL_REGS; } + /* The neon move patterns handle all legitimate vector and struct + addresses. */ if (TARGET_NEON + && MEM_P (x) && (GET_MODE_CLASS (mode) == MODE_VECTOR_INT - || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) - && neon_vector_mem_operand (x, 0)) - return NO_REGS; + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT + || VALID_NEON_STRUCT_MODE (mode))) + return NO_REGS; if (arm_coproc_mem_operand (x, wb) || s_register_operand (x, mode)) return NO_REGS; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 52fbcaaec65..be3a9299b3c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-30 Richard Sandiford + + PR target/47551 + * gcc.target/arm/neon-modes-2.c: New test. + 2011-03-30 Jakub Jelinek PR c/48305 diff --git a/gcc/testsuite/gcc.target/arm/neon-modes-2.c b/gcc/testsuite/gcc.target/arm/neon-modes-2.c new file mode 100644 index 00000000000..40f1bba363b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/neon-modes-2.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-O1" } */ +/* { dg-add-options arm_neon } */ + +#include "arm_neon.h" + +#define SETUP(A) x##A = vld3_u32 (ptr + A * 0x20) +#define MODIFY(A) x##A = vld3_lane_u32 (ptr + A * 0x20 + 0x10, x##A, 1) +#define STORE(A) vst3_u32 (ptr + A * 0x20, x##A) + +#define MANY(A) A (0), A (1), A (2), A (3), A (4), A (5) + +void +bar (uint32_t *ptr, int y) +{ + uint32x2x3_t MANY (SETUP); + int *x = __builtin_alloca (y); + int z[0x1000]; + foo (x, z); + MANY (MODIFY); + foo (x, z); + MANY (STORE); +}