This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] When possible, use short pc-relative branch to thunk function on PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Jan 2009 12:35:25 -0500 (EST)
- Subject: [committed] When possible, use short pc-relative branch to thunk function on PA
This fixes another regression arising from my attempt to add support to
use long branches from thunks. We were always using long branches on
targets with named sections even when it was possible to use a short
pc-relative branch.
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11. Committed to
trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2009-01-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (pa_asm_output_mi_thunk): Use pc-relative branch to thunk
function when not using named sections on targets with named sections
if branch distance is less than 262132.
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 143207)
+++ config/pa/pa.c (working copy)
@@ -7980,6 +7980,10 @@
|| ((DECL_SECTION_NAME (thunk_fndecl)
== DECL_SECTION_NAME (function))
&& last_address < 262132)))
+ || (targetm.have_named_sections
+ && DECL_SECTION_NAME (thunk_fndecl) == NULL
+ && DECL_SECTION_NAME (function) == NULL
+ && last_address < 262132)
|| (!targetm.have_named_sections && last_address < 262132))))
{
if (!val_14)