This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Reload CONST_VECTOR into memory on ppc.
- From: "Hartmut Penner" <HPENNER at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Geoff Keating <geoffk at geoffk dot org>, Aldy Hernandez <aldyh at redhat dot com>, "David Edelsohn" <edelsohn at us dot ibm dot com>
- Date: Fri, 19 Dec 2003 11:35:52 +0100
- Subject: [PATCH] Reload CONST_VECTOR into memory on ppc.
Hello,
good following compiling a big AltiVec testcase:
test.c: In function `part2':
test.c:2888: error: unrecognizable insn:
(insn 8625 5575 5570 510 (set (reg:V4SI 1)
(const_vector:V4SI [
(const_int 65537 [0x10001])
(const_int 65537 [0x10001])
(const_int 65537 [0x10001])
(const_int 65537 [0x10001])
])) -1 (nil)
(nil))
test.c:2888: internal compiler error: in extract_insn, at recog.c:2061
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
~
Const_vector was generated out of a V8HI vector with eight 0x1 by simplify-rtx.c
code. The V8HI was previously accepted as 'easy_vector_constant',
the transformed V4SI is not accepted as 'easy_vector_constan'.
This leads to that unrecognizable insn during reload.
Fix: Change PREFERED_RELOAD_CLASS to return NO_REGS in case
of CONST_VECTOR. This will force the CONST_VECTOR into memory,
if it is not a easy_vector_constant ('W' constraint).
bootstrapped & tested on PPC64 linux.
I don't have simple testcase.
Patch:
ChangeLog
2003-12-19 Hartmut Penner <hpenner@de.ibm.com>
* gcc/config/rs6000/rs6000.h (PREFERRED_RELOAD_CLASS): Force
CONST_VECTOR to memory.
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.302
diff -u -r1.302 rs6000.h
--- config/rs6000/rs6000.h 9 Dec 2003 01:57:45 -0000 1.302
+++ config/rs6000/rs6000.h 19 Dec 2003 09:13:15 -0000
@@ -1430,7 +1430,8 @@
in some cases it is preferable to use a more restrictive class.
On the RS/6000, we have to return NO_REGS when we want to reload a
- floating-point CONST_DOUBLE to force it to be copied to memory.
+ floating-point CONST_DOUBLE or vector CONST_VECTOR to force it to
+ be copied to memory.
We also don't want to reload integer values into floating-point
registers if we can at all help it. In fact, this can
@@ -1449,6 +1450,8 @@
: (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
&& (CLASS) == NON_SPECIAL_REGS) \
? GENERAL_REGS \
+ : (GET_CODE (X) == CONST_VECTOR) \
+ ? NO_REGS \
: (CLASS)))
/* Return the register class of a scratch register needed to copy IN into