This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PUSH and POP next to first/last register use
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Sami Khawam <S dot Khawam at ee dot ed dot ac dot uk>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 26 Jan 2005 15:05:25 +0100
- Subject: Re: PUSH and POP next to first/last register use
- References: <41F7813C.3080907@ee.ed.ac.uk>
> I suppose this would require using REGNO_FIRST_UID(N) and
> REGNO_LAST_UID(N) at some point, however I would be very grateful if
> you can help me with it, as it seems that REGNO_FIRST_UID(N) is still
> reset to 0 when TARGET_ASM_FUNCTION_PROLOGUE is called.
REGNO_FIRST_UID and REGNO_LAST_UID are set by reg_scan (see passes.c),
but they do not take into account the CFG -- i.e. REGNO_FIRST_UID is not
guaranteed to dominate all uses, and REGNO_LAST_UID is not guaranteed to
postdominate them.
Using them is almost never the right thing to do -- witness the fact
that there are only three users in the whole of gcc's middle-end:
1) in CSE, and it is just a way to pick an order for registers
2) in initialize_uninitialized_subregs, and only as an optimization to
skip insns that surely don't refer to a reg.
3) loop.c, which is 9000 lines of complex code with a lot of heuristics
that were designed two major releases ago -- a lot of things changed
since then, and loop.c is going to be removed sooner or later.
What you want to do would mean multiple pushes or pops, right? You may
want to do a dominator/postdominator walk, it is quite cheap in HEAD.
Paolo