[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/12049] Unnecessary relaxation
From: |
amodra at gmail dot com |
Subject: |
[Bug gas/12049] Unnecessary relaxation |
Date: |
Sat, 23 Oct 2010 11:58:41 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=12049
Alan Modra <amodra at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |amodra at gmail dot com
AssignedTo|unassigned at sources dot |amodra at gmail dot com
|redhat.com |
--- Comment #17 from Alan Modra <amodra at gmail dot com> 2010-10-23 11:58:22
UTC ---
Nice testcase! The comment in my fix below explains how relax_frag went wrong.
I'll apply this later, probably tomorrow sometime.
Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.134
diff -u -p -r1.134 write.c
--- gas/write.c 19 Oct 2010 12:14:23 -0000 1.134
+++ gas/write.c 23 Oct 2010 11:55:01 -0000
@@ -2163,6 +2163,13 @@ relax_frag (segT segment, fragS *fragP,
if (stretch < 0
|| sym_frag->region == fragP->region)
target += stretch;
+ /* If we get here we know we have a forward branch. This
+ relax pass may have stretched previous instructions so
+ far that omitting STRETCH would make the branch
+ negative. Don't allow this in case the negative reach is
+ large enough to require a larger branch instruction. */
+ else if (target < address)
+ target = fragP->fr_next->fr_address + stretch;
}
}
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
- [Bug gas/12049] Unnecessary relaxation, (continued)
- [Bug gas/12049] Unnecessary relaxation, rafael.espindola at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, rafael.espindola at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, rafael.espindola at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, hjl.tools at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, hjl.tools at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, rafael.espindola at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, hjl.tools at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, rafael.espindola at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, hjl.tools at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation, hjl.tools at gmail dot com, 2010/10/22
- [Bug gas/12049] Unnecessary relaxation,
amodra at gmail dot com <=
- [Bug gas/12049] Unnecessary relaxation, hjl.tools at gmail dot com, 2010/10/25