I have an SPE testcase with lots of vector constants that is
triggering reload goofiness.
Reload is setting reg_equiv_consant[] for a vector constant and then
attempting to create an invalid vector instruction later on--
particularly, an instruction with a vector constant that is out of
range for the current architecture (e500 in this case).
I see the reg_equiv_constant[] set in reload checks
LEGITIMATE_CONSTANT_P which I believe is set incorrectly on the PPC
back end.
Even though this is my area, I'd like some feedback whether this is
indeed correct. I'm a bit confused by the documentation of the
LEGITIMATE_CONSTANT_P which seems to only apply to general operands,
and it's use throughout the compiler.
David, anyone, is this ok?
2003-06-19 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Adjust for
vectors.
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.239.4.3
diff -c -p -r1.239.4.3 rs6000.h
*** rs6000.h 2003/06/12 21:20:51 1.239.4.3
--- rs6000.h 2003/06/19 16:59:24
*************** typedef struct rs6000_args
*** 2015,2022 ****
acceptable. */
#define LEGITIMATE_CONSTANT_P(X) \
! (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \
|| (TARGET_POWERPC64 && GET_MODE (X) == DImode) \
|| easy_fp_constant (X, GET_MODE (X)))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
--- 2015,2025 ----
acceptable. */
#define LEGITIMATE_CONSTANT_P(X) \
! ((GET_CODE (X) != CONST_DOUBLE \
! && GET_CODE (X) != CONST_VECTOR) \
! || GET_MODE (X) == VOIDmode \
|| (TARGET_POWERPC64 && GET_MODE (X) == DImode) \
+ || easy_vector_constant (X, GET_MODE (X)) \
|| easy_fp_constant (X, GET_MODE (X)))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx