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: A question about define_insn and force-reg


Eric Fisher wrote:

> I think it's very interesting. I want to split a insn of loading SF
> data through SI symbol, such as (set (reg:SF 5 $5) (mem/u/f:SF
> (symbol_ref/u:SI ("*$LC0")))).
> I want to it firstly load the address into a register, then load the
> data through the register. So I define the insn as follows,
>   (define_insn "loadsf"
>   [(set (match_operand:SF 0 "register_operand" "=r")
>         (mem:SF (match_operand:SI 1 "immediate_operand" "m")))]
>   ""
>   {
>     operands[1] = force_reg (SImode, operands[1]);
>     return md_output_move (operands[0], operands[1]);
>   }
>   [(set_attr "type"	"load")
>    (set_attr "mode"	"SF")
>    (set_attr "length"	"*")])
> 
>   But the gcc will come out such error,
>   internal compiler error: in gen_reg_rtx,  at emit-rtl.c:819.
> 
>   Which is the codes as following at emit-rtl.c:819,
>    /* Don't let anything called after initial flow analysis create new
>      registers.  */
>   if (no_new_pseudos)
>     abort ();
> 
>   Why can't I create a new register? 

  Read about reload and no_new_pseudos in the docs for `movm'

http://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html

>So how should I do to implement it?

  Generate it earlier:

http://gcc.gnu.org/onlinedocs/gccint/Expander-Definitions.html#Expander-Defi
nitions

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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