This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Help with "unable to generate reloads for" atomic_exchangesi
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: William Tambe <tambewilliam at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 24 Sep 2019 10:52:04 -0500
- Subject: Re: Help with "unable to generate reloads for" atomic_exchangesi
- References: <CAF8i9mMMPrnuO4NszLaFDOFCQ3yB-iwDJYwXtkEM3zjxdKo82Q@mail.gmail.com>
On Tue, Sep 24, 2019 at 04:31:49AM -0500, William Tambe wrote:
> I have defined atomic_exchangesi as follow in the machine description:
>
> (define_insn "atomic_exchangesi"
> [(set (match_operand:SI 0 "register_operand" "=r,r")
> (match_operand:SI 1 "memory_operand" "+B,W"))
> (set (match_dup 1)
> (unspec:SI
> [(match_operand:SI 2 "register_operand" "0,0")
> (match_operand:SI 3 "const_int_operand")]
> 0))]
> ""
> "@
> ...
> ...")
Don't use "+", just use matching constraints, like the "0" you already
have, but then "1"? Like
(define_insn "atomic_exchangesi"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(match_operand:SI 1 "memory_operand" "B,W"))
(set (match_operand:SI 2 "memory_operand" "=1,1")
(unspec:SI
[(match_operand:SI 3 "register_operand" "0,0")
(match_operand:SI 4 "const_int_operand")]
0))]
Segher