This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dummy questions on GCC internals


> One more question: what's meant under the "insn does not satisfy its
> constraints"? I have addhi3 defined as:
> 

This means that the insn below doesn't match the pattern for addhi3.

> (define_insn "addhi3"
>   [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r")
>         (plus:HI (match_operand:HI 1 "general_operand" "0,0")
>                  (match_operand:HI 2 "general_operand" "ri,m")))]
>   ""
>   "@
>   addhi3\t%2,%0
>   addhi3\t(%2),%0")
> 
> and receive the following error:
> 
> z80-test/test.c: In function `m':
> z80-test/test.c:12: error: insn does not satisfy its constraints:
> (insn/f 55 54 56 0x0 (set (reg/f:HI 8 ix)
>         (plus:HI (reg/f:HI 8 ix)
>             (reg/f:HI 10 sp))) 8 {addhi3} (nil)
>     (nil))
> z80-test/test.c:12: internal compiler error: in final_scan_insn, at final.c:2722
> 
> Is it the problem in addhi3 definition or something else may influence
> on this?

Register classes can also affect this, though I'm not sure how 'r' would
interact off the top of my head since it's a general constraint. My
guess would be that for some reason it doesn't believe that sp is part
of 'r'. Not having the rest of the port... :)

-eric

-- 
Eric Christopher <echristo@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]