This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: PATCH: PR gas/12049: Unnecessary relaxation
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 18 Oct 2010 12:02:35 +1030
- Subject: Re: RFC: PATCH: PR gas/12049: Unnecessary relaxation
- References: <20101016222850.GA4335@intel.com>
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