This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: prevent (pre_inc ...) from satisfying "movhi" RTL template constraints
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Maxim Blinov <maxim dot a dot blinov at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 21 Jul 2017 20:43:59 -0500
- Subject: Re: prevent (pre_inc ...) from satisfying "movhi" RTL template constraints
- Authentication-results: sourceware.org; auth=none
- References: <CAHXVFWmLQyyxx2ZvqrAyZSnGN_q0gQVtmrD_c8ofqnkrULX_Gw@mail.gmail.com>
Hi Maxim,
On Sat, Jul 22, 2017 at 01:39:53AM +0100, Maxim Blinov wrote:
> > (define_insn "pushhi_16"
> > [(set (mem:HI (pre_inc:HI (reg:HI SP_REG)))
> > (match_operand:HI 0 "general_operand" "rni"))]
> > ""
> > "push %0"
> > )
("i" matches everything "n" does; did you mean "rmi"? If you did
mean "ri", you should use nonmemory_operand).
> My question is, why does the compiler match the above RTL code to
> my "movhi" template? I have not specified an auto {pre,post}
> inc/decremented ("<" or ">") operand constraint anywhere in the
> "movhi" template; thus, surely the template match should fail, if the
> RTL that is attempted to be matched contains such a *cremented
> expression?
Because your legitimate_address_p (or similar) is fine with it,
I suspect.
Segher