This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]