This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: PATCH: PR gas/12049: Unnecessary relaxation
On Mon, Oct 18, 2010 at 6:48 AM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Oct 18, 2010 at 06:25:41AM -0700, H.J. Lu wrote:
>> On Sun, Oct 17, 2010 at 10:32 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> > On Sun, Oct 17, 2010 at 8:35 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> >> On Sun, Oct 17, 2010 at 6:32 PM, Alan Modra <amodra@gmail.com> wrote:
>> >>> 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.
>> >>>
>> >> I tried it and it doesn't work. The problem is
>
> You didn't try very hard. ?This patch of course needs to touch all the
> other md_relax_tables too.
>
> Index: gas/as.h
> ===================================================================
> RCS file: /cvs/src/src/gas/as.h,v
> retrieving revision 1.68
> diff -u -p -r1.68 as.h
> --- gas/as.h ? ?3 Jul 2010 20:52:24 -0000 ? ? ? 1.68
> +++ gas/as.h ? ?18 Oct 2010 13:29:10 -0000
> @@ -323,6 +323,8 @@ struct relax_type
>
> ? /* Next longer relax-state. ?0 means there is no 'next' relax-state. ?*/
> ? relax_substateT rlx_more;
> + ?/* Next smaller relax-state. ?-1 means there is no 'next' relax-state. ?*/
> + ?relax_substateT rlx_less;
> ?};
>
I tried your patch on
.fill 56, 1, 0x90
jne .LBB0_43
.fill 10, 1, 0x90
jne .LBB0_43
.fill 5, 1, 0x90
.align 16, 0x90
.fill 118, 1, 0x58
.LBB0_43:
nop
I got
38: 0f 85 98 00 00 00 jne 0xd6
48: 0f 85 88 00 00 00 jne 0xd6
My patch generates:
38: 0f 85 88 00 00 00 jne 0xc6
48: 75 7c jne 0xc6
--
H.J.