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]

Re: [PR42861, VTA] bind values to expressions upon MO_VAL_USE


Here is a patch to fix PR target/42924, the PA64 bootstrap failure that
started with r156292, the patch to fix PR debug/42861.  It is based on
the patch Jakub sent me but returns an indirect reference (mem...)
instead of a direct one because that is what UNSPEC_DLTIND14R returns.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11 with no
regressions.

OK to check in?

Steve Ellcey
sje@cup.hp.com



2010-02-04  Steve Ellcey  <sje@cup.hp.com>

	PR target/42924
        * config/pa/pa.c (TARGET_DELEGITIMIZE_ADDRESS): Redefine.
        (pa_delegitimize_address): New function.


Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c      (revision 156489)
+++ config/pa/pa.c      (working copy)
@@ -167,6 +167,7 @@ static enum machine_mode pa_promote_func
 static void pa_asm_trampoline_template (FILE *);
 static void pa_trampoline_init (rtx, tree, rtx);
 static rtx pa_trampoline_adjust_address (rtx);
+static rtx pa_delegitimize_address (rtx);

 /* The following extra sections are only used for SOM.  */
 static GTY(()) section *som_readonly_data_section;
@@ -339,6 +340,8 @@ static size_t n_deferred_plabels = 0;
 #define TARGET_TRAMPOLINE_INIT pa_trampoline_init
 #undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
 #define TARGET_TRAMPOLINE_ADJUST_ADDRESS pa_trampoline_adjust_address
+#undef TARGET_DELEGITIMIZE_ADDRESS
+#define TARGET_DELEGITIMIZE_ADDRESS pa_delegitimize_address
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 ^L
@@ -9994,5 +9997,17 @@ pa_trampoline_adjust_address (rtx addr)
     addr = memory_address (Pmode, plus_constant (addr, 46));
   return addr;
 }
+
+static rtx
+pa_delegitimize_address (rtx orig_x)
+{
+  rtx x = delegitimize_mem_from_attrs (orig_x);
+
+  if (GET_CODE (x) == LO_SUM
+      && GET_CODE (XEXP (x, 1)) == UNSPEC
+      && XINT (XEXP (x, 1), 1) == UNSPEC_DLTIND14R)
+    return gen_const_mem (Pmode, XVECEXP (XEXP (x, 1), 0, 0));
+  return x;
+}
 ^L
 #include "gt-pa.h"



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