This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: porting GCC
- To: "Krzysztof Matula" <K dot Matula at adb dot pl>
- Subject: Re: porting GCC
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Fri, 02 Feb 2001 12:00:26 +0000
- cc: gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: Richard dot Earnshaw at arm dot com
> 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
>
>
>