public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* unrecognized call_value instruction
@ 2008-09-30  9:03 Sivaprasad.pv
  2008-10-01  0:54 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Sivaprasad.pv @ 2008-09-30  9:03 UTC (permalink / raw)
  To: gcc

Hi all,

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.

Thanks,
P.V.Siva Prasad


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: unrecognized call_value instruction
  2008-09-30  9:03 unrecognized call_value instruction Sivaprasad.pv
@ 2008-10-01  0:54 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2008-10-01  0:54 UTC (permalink / raw)
  To: Sivaprasad.pv; +Cc: gcc

"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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-01  0:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-30  9:03 unrecognized call_value instruction Sivaprasad.pv
2008-10-01  0:54 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).