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: redirect_edge_and_branch questions


On Mon, 2004-10-04 at 19:16, Zdenek Dvorak wrote:
> Hello,
> 
> > NOw this is all so I can do something that i could work around here.. I
> > can stash away all the stmts ahead of time and then not have top worry
> > about it.  Im suprised other non-ssa tree CFG manipulations havent
> > tripped over it. Maybe Im just doing something weird.
> 
> simply noone tried to insert statements on edges and simultaneously use
> edge redirection or make_forwarder_block.  The former is not really that
> surprising, since trying it is a clear way to hell.  The later is due to
> the fact that make_forwarder_block is so far used only in loop optimizer
> on places where statement insertion is not to be expected (preheader
> creation etc.) Also the tree loop optimizer prefers
> bsi_insert_on_edge_immediate over leaving statements pending on edges
> (which might be other way how to solve your problem, depending on
> how much your optimization would be complicated by newly created basic
> blocks and inserted statements).

So I elected not to do that work since I didn't really have to, and my
guess was it was going to snowball even further.

Now I have a working version where I save the PENDING_STMT info I need.

I am, however, doing something I want to check out.

I am using the edge->aux field to store a pointer to an edge. Its for a
very short period, and then I clear it. So when I'm done, the field is
NULL again.  Can I do that OK?  I presume it is OK since edges are GC'd
(right?), and the aux pointer is declared
  PTR GTY((skip(""))) aux;

So is it kosher to do this? I don't want to actually allocate aux
fields, since I only ever need to temporarily store an edge pointer
while examining a basic block's incoming edge. I then do a couple of
redirects. Then they are cleared.

Is this OK, or is it bad Karma?

Andrew



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