This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] sh.h: Fix PREDICATE_CODES.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: joern dot rennecke at st dot com, aoliva at redhat dot com
- Date: Sun, 03 Apr 2005 01:18:48 -0500 (EST)
- Subject: [patch] sh.h: Fix PREDICATE_CODES.
Hi,
Attached is a patch to fix PREDICATE_CODES by adding one more code.
Without this patch, the straightforward conversion of predicates to
predicates.md would fail, causing an "unrecognized insn" of the form
(set (reg:SI ...)
(const:SI (unspec ... UNSPEC_GOTOFF)))
The reason is that predicates generated from predicates.md are tighter
than the traditional form of predicates written entirely in C. That
is, if we have
(define_predicate "general_movsrc_operand"
(match_code "subreg,reg,const_int,const_double,mem")
:
:
then this predicate does not accept any code other than those listed
inside match_code. In particular, CONST is rejected, including the
one with UNSPEC_GOTOFF.
Built sh-elf. OK to apply?
Kazu Hirata
2005-04-03 Kazu Hirata <kazu@cs.umass.edu>
* config/sh/sh.h (PREDICATE_CODES): Add CONST to
general_movsrc_operand.
Index: sh.h
===================================================================
RCS file: /home/kazu/nobackup/gcc-cvs/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.261
diff -u -d -p -r1.261 sh.h
--- sh.h 30 Dec 2004 03:08:06 -0000 1.261
+++ sh.h 3 Apr 2005 05:45:57 -0000
@@ -3355,7 +3355,7 @@ extern int rtx_equal_function_value_matt
{"fpscr_operand", {REG}}, \
{"fpul_operand", {REG}}, \
{"general_extend_operand", {SUBREG, REG, MEM, TRUNCATE}}, \
- {"general_movsrc_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM}}, \
+ {"general_movsrc_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM, CONST }}, \
{"general_movdst_operand", {SUBREG, REG, MEM}}, \
{"unaligned_load_operand", {MEM}}, \
{"greater_comparison_operator", {GT,GE,GTU,GEU}}, \