RFC: PATCH: PR gas/12049: Unnecessary relaxation

Alan Modra amodra@gmail.com
Mon Oct 18 01:32:00 GMT 2010


On Sat, Oct 16, 2010 at 03:28:50PM -0700, H.J. Lu wrote:
> 1. Set address for each frag.
> 2. Relax and update address for each frag.  For rs_machine_dependent
> frag, if its size grows with forward reference, update fr_address for
> all successive frags.
> 3. If stretched, goto 2.
> 
> Does it make any senses?

No it does not.  The frag loop here is already two deep in loops (loop
until nothing changed this segment, and loop until nothing changed in
all segments).  You've just made the innermost loop over frags
O(n**2).  I think that is way too expensive.

A possible fix for your testcase is to allow relax_frag to shrink
rs_machine_dependent frags, rather than just grow them as it does at
the moment.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list