This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix PR target/37603
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 4 Oct 2008 14:21:22 -0400 (EDT)
- Subject: [committed] Fix PR target/37603
The enclosed change fixes a small error in legitimize_pic_address.
It was called with a BLKmode pointer to a function label. Forcing
the pointer to memory in BLKmode creates a constant that is not
legitimate. Further, the constant must be output in word mode to
ensure that it is correctly aligned. The HP dynamic linker can't
handle unaligned relocations for a function descriptors.
Tested on hppa-unknown-linux-gnu, hppa2.0-hp-hpux11.00 and
hppa64-hp-hpux11.11. Committed to 4.3 and trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2000-10-04 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/37603
* pa.c (legitimize_pic_address): Force function labels to memory in
word mode.
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 140520)
+++ config/pa/pa.c (working copy)
@@ -714,8 +714,8 @@
if (function_label_operand (orig, mode))
{
- /* Force function label into memory. */
- orig = XEXP (force_const_mem (mode, orig), 0);
+ /* Force function label into memory in word mode. */
+ orig = XEXP (force_const_mem (word_mode, orig), 0);
/* Load plabel address from DLT. */
emit_move_insn (tmp_reg,
gen_rtx_PLUS (word_mode, pic_offset_table_rtx,