This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: porting GCC
----- Original Message -----
From: "Richard Earnshaw" <rearnsha@arm.com>
To: "Krzysztof Matula" <km@taboo.eu.org>
Cc: <gcc@gcc.gnu.org>; <Richard.Earnshaw@arm.com>
Sent: Thursday, February 01, 2001 12:09
Subject: Re: porting GCC
> > I am extending one of GCC ports an I have the following problem:
> >
> > I need to detect all references to to objects in data segment
(SYMBOL_REF/v)
> > and modify rtx in such way, that the segment base address is added to
the
> > offset (represented by the symbol itself). Generating such rtx is not a
[...]
> > I think I have to flag the rtx generated in define_expand in some way
and
> > setup the predicate used in define_insn to reject unflagged symbol
refs...
> >
> This is similar to the problem faced by many ports when generating PIC
> code. The normal approach is to wrap symbol refs in an UNSPEC and then
> restrict the recognizer rules to only allow such wrapped symbols. Take a
> look at how other machines handle this case for PIC.
It worked :)
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...
(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