[PATCH] Fix gcc.dg/weak/weak-1.c on SPARC

Eric Botcazou ebotcazou@adacore.com
Sun Nov 23 21:20:00 GMT 2008


This is again PR target/37170 but this time on the SPARC.  On this platform, 
symbols generally don't go from output_asm_insn through output_operand but 
directly through output_address or output_addr_const so

2008-07-22  Rafael Ávila de Espíndola  <espindola@google.com>

	* c-typeck.c (build_external_ref): Don't call assemble_external.
	* final.c (output_operand): Call assemble_external.

and

2008-09-22  Hans-Peter Nilsson  <hp@axis.com>

	PR middle-end/37170
	PR middle-end/37280
	* final.c (mark_symbol_ref_as_used): New helper function.
	(output_operand): Instead of just looking inside MEMs for
	SYMBOL_REFs, use new helper function and for_each_rtx.


are ineffective.


Symbols therefore need to be "marked" in output_addr_const for the SPARC but 
it turns out that they are already for another purpose there:

    case SYMBOL_REF:
      if (SYMBOL_REF_DECL (x))
	mark_decl_referenced (SYMBOL_REF_DECL (x));
#ifdef ASM_OUTPUT_SYMBOL_REF
      ASM_OUTPUT_SYMBOL_REF (file, x);
#else
      assemble_name (file, XSTR (x, 0));
#endif
      break;

so I'm wondering whether output_operand was the right place to mark them.

Tested on sparc-sun-solaris2.10, OK for mainline?


2008-11-23  Eric Botcazou  <ebotcazou@adacore.com>

	* final.c (output_addr_const) <SYMBOL_REF>: Call assemble_external
	on the associated SYMBOL_REF_DECL node, if any.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output_weak.diff
Type: text/x-diff
Size: 481 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081123/41321006/attachment.bin>


More information about the Gcc-patches mailing list