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]

Call for HPPA testers (was: [RFA:] Fix PR37170: weak-1.c regression, second edition)


> Date: Wed, 27 Aug 2008 18:29:43 +0200
> From: Hans-Peter Nilsson <hp@axis.com>

> Main points:
> - #ifndef ASM_OUTPUT_EXTERNAL was around the weak-handling too.
> - Inlined functions and emitted variables can be marked as weak;
>   there must be no weak-*reference* annotation for them.
> - output_operand doesn't catch all from code referenced
>   symbol_ref's.

...but those were beside the original point, that it's not
enough to, in output_operand, look inside mems to see all
required symbol_refs.

As mentioned, revision 138310 (and its add-on for PR 36974) is
an attempt to fix one special case of this.  With the previous
patch applied, it's redundant but benevolent except for being
misleading.  My guess is that it "worked" where output_operand
failed only because the mem(*) is usually outside, not part of
the match_operand part in call insns (the one reaching
output_operand), and luckily the reported platforms had a
symbol_ref there in bootstrap and tests (and not e.g. a reg).

Can someone with an affected system (HPPA) pretty please test
this patch, reverting 138310 and the later change, on top of my
previous one?

I've already regtested it on x86_64-unknown-linux-gnu.

	* final.c (call_from_call_insn): Delete.
	(final_scan_insn): Don't attempt to dig out and call
	assemble_external for SYMBOL_REFs of call insns here.

(*) There's always a "spurious" mem around the address in the
generated (call ...); Michael Meissner speculates that it was
because RMS knew of machines that could execute code in
registers.

Index: final.c
===================================================================
--- final.c	(revision 139233)
+++ final.c	(working copy)
@@ -1744,34 +1744,6 @@
     }
 }
 
-/* Given a CALL_INSN, find and return the nested CALL. */
-static rtx
-call_from_call_insn (rtx insn)
-{
-  rtx x;
-  gcc_assert (CALL_P (insn));
-  x = PATTERN (insn);
-
-  while (GET_CODE (x) != CALL)
-    {
-      switch (GET_CODE (x))
-	{
-	default:
-	  gcc_unreachable ();
-	case COND_EXEC:
-	  x = COND_EXEC_CODE (x);
-	  break;
-	case PARALLEL:
-	  x = XVECEXP (x, 0, 0);
-	  break;
-	case SET:
-	  x = XEXP (x, 1);
-	  break;
-	}
-    }
-  return x;
-}
-
 /* The final scan for one insn, INSN.
    Args are same as in `final', except that INSN
    is the insn being scanned.
@@ -2617,20 +2589,6 @@
 	targetm.asm_out.unwind_emit (asm_out_file, insn);
 #endif
 
-	if (CALL_P (insn))
-	  {
-	    rtx x = call_from_call_insn (insn);
-	    x = XEXP (x, 0);
-	    if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
-	      {
-		tree t;
-		x = XEXP (x, 0);
-		t = SYMBOL_REF_DECL (x);
-		if (t)
-		  assemble_external (t);
-	      }
-	  }
-
 	/* Output assembler code from the template.  */
 	output_asm_insn (templ, recog_data.operand);
 
@@ -3346,6 +3304,31 @@
   assemble_name (asm_out_file, buf);
 }
 
brgds, H-P


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