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]

Re: porting GCC


> It worked :)

Good.
> But soon I reached another problem...
> 
> I am generating several insn-s inside define_expand. The meaning of the code
> is not exactly the same, as the rtl matched. The problem is that GCC always
> notes the last insn I generate with REG_EQUAL expression, corresponding to
> the ORIGINAL code... I don't know how to avoid this...

Why is this a problem?  Gcc annotates the end of the sequence with a note 
of the equivalent it collapses to.  If you think of (symbol_ref 
("__clz_tab")) as the final address that will be dereferenced then the 
expression

	(unspec [(symbol_ref ("__clz_tab"))] 3)
should be thought of as being equivalent to

	(minus (symbol_ref ("__clz_tab")) (reg:SI base_reg))

[we don't express it this way since then the compiler might try to 
simplify the expression in a way that would be incorrect, but 
mathematically when the base_reg value is added back on we end up with the 
address we really want.]

> 
> (insn 9 8 11 (set (reg:SI 15)
>         (plus:SI (reg:SI 14)
> 
> spec:SI[ 
>                     (symbol_ref/v:SI ("__clz_tab"))
>                 ]  3))) -1 (nil)
>     (nil))
> 
> (insn 11 9 12 (set (reg:SI 16)
>         (mem:SI (reg:SI 9))) -1 (nil)
>     (nil))
> 
> (insn 12 11 14 (set (reg:SI 13)
>         (plus:SI (reg:SI 16)
>             (reg:SI 15))) -1 (nil)
>     (nil))
> 
> (insn 14 12 16 (set (reg:SI 13)
>         (reg:SI 13)) -1 (nil)
>     (expr_list:REG_EQUAL (plus:SI (mem:SI (reg:SI 9))
>             (symbol_ref/v:SI ("__clz_tab")))
>         (nil)))
> 
> KM
> 
> 
> 



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