This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, committed] SH: Fix PR58314 (unsatisfied constraints)
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Christian Bruel <christian dot bruel at st dot com>
- Cc: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, "oleg dot endo\ at t-online dot de" <oleg dot endo at t-online dot de>, "gcc-patches\ at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 19 Sep 2013 17:29:11 +0100
- Subject: Re: [PATCH, committed] SH: Fix PR58314 (unsatisfied constraints)
- Authentication-results: sourceware.org; auth=none
- References: <52395C62 dot 5000105 at st dot com> <1379509163 dot 32276 dot 140 dot camel at yam-132-YW-E178-FTW> <5239C90C dot 6040304 at st dot com> <20130919 dot 081524 dot 489555491 dot kkojima at rr dot iij4u dot or dot jp> <523AB982 dot 9050303 at st dot com>
Christian Bruel <email@example.com> writes:
> Index: gcc/config/sh/sh.md
> --- gcc/config/sh/sh.md (revision 202699)
> +++ gcc/config/sh/sh.md (working copy)
> @@ -6894,9 +6894,11 @@ label:
> ;; reloading MAC subregs otherwise. For that probably special patterns
> ;; would be required.
> (define_insn "*mov<mode>_reg_reg"
> - [(set (match_operand:QIHI 0 "arith_reg_dest" "=r,m,*z")
> - (match_operand:QIHI 1 "register_operand" "r,*z,m"))]
> - "TARGET_SH1 && !t_reg_operand (operands, VOIDmode)"
> + [(set (match_operand:QIHI 0 "general_movdst_operand" "=r,m,*z")
> + (match_operand:QIHI 1 "general_movsrc_operand" "r,*z,m"))]
> + "TARGET_SH1 && !t_reg_operand (operands, VOIDmode)
> + && arith_reg_dest (operands, <MODE>mode)
> + && register_operand (operands, <MODE>mode)"
This defeats the purpose of changing the predicates though. The problem
with the original pattern was that you shouldn't have a situation where
the constraints allow a combination that recog wouldn't match to the
same define_insn. Constraints must always match a subset of what
recog would match.
Sorry for just saying something's wrong without suggesting a fix,
but I don't know anything about the SH port. In general though,
the "r<-r", "r<-m" and "m<-r" alternatives should be part of a single
define_insn, rather than split across several. Which sounds like what
Oleg was suggesting about folding the r<-r alternatives back into the