This is the mail archive of the gcc-help@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: unrecognized call_value instruction


"Sivaprasad.pv" <sivaprasad.pv@redpinesignals.com> writes:

> We want to upgrade  our cross compiler (for custom processor) from
> gcc.3.3 to gcc.4.3.1.
> In this process we have successfully build the compiler, But it is
> fail to recognize the following (function with return value) insn
>
> test.c:17: error: unrecognizable insn:
> (call_insn 14 13 15 3 test.c:15 (set (reg:HI 0 d2)
>        (call (mem:SI (symbol_ref:SI ("add") [flags 0x3] <function_decl
> 0xb7d08930 add>) [0 S4 A16])
>            (const_int 8 [0x8]))) -1 (expr_list:REG_EH_REGION
> (const_int 0 [0x0])
>        (nil))
>    (nil))
> test.c:17: internal compiler error: in extract_insn, at recog.c:1990
>
> This is our define_expand for our call_value pattern:
>
> (define_expand "call_value"
>  [(set (match_operand 0 "register_operand" "")
>          (call (match_operand:SI 1 "" "")
>          (match_operand:SI 2 "" "")))]
>  ""
>  "
> {
>    if (GET_CODE (operands[1]) == MEM
>      && ! address_operand (XEXP (operands[1], 0), SImode))
>  {
>    operands[1] = gen_rtx_MEM (GET_MODE (operands[1]),
>                   force_reg (Pmode, XEXP (operands[1], 0)));
>  }
> }")
>
> define_insn for our call_value pattern:
>
> (define_insn "*call_value"
>  [(set (match_operand 0 "register_operand" "=x,x")
>        (call (mem:SI (match_operand:SI 1 "address_operand" "a,R"))
>                (match_operand 2 "" ""))) ]
>  ""
>  "@
>  jsri %1
>  jsr %1"
>  [(set_attr "type" "call")])
>
> where x- is return registers
>          a= address register which can hold address of the function
>          R= symbolic operand
>
> The same pattern definitions are working fine with gcc-3.3, But
> failing with gcc-4.3.1.
> I am unable to identify actual reason,so can you please help me in
> this regard.


Hard to say for sure what the problem is, but it seems like the most
likely cause would be your GO_IF_LEGITIMATE_ADDRESS macro rejecting
(symbol_ref:SI "add").

If that doesn't help, you're going to have to debug it.

Ian


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