2017-05-10 John David Anglin <danglin@gcc.gnu.org>
+ PR target/80090
+ * config/pa/pa.c (pa_assemble_integer): When outputting a SYMBOL_REF,
+ handle calling assemble_external ourself.
+
PR target/79027
* config/pa/pa.c (pa_cannot_change_mode_class): Reject changes to/from
modes with zero size. Enhance comment.
static bool
pa_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
+ bool result;
+ tree decl = NULL;
+
+ /* When we have a SYMBOL_REF with a SYMBOL_REF_DECL, we need to call
+ call assemble_external and set the SYMBOL_REF_DECL to NULL before
+ calling output_addr_const. Otherwise, it may call assemble_external
+ in the midst of outputing the assembler code for the SYMBOL_REF.
+ We restore the SYMBOL_REF_DECL after the output is done. */
+ if (GET_CODE (x) == SYMBOL_REF)
+ {
+ decl = SYMBOL_REF_DECL (x);
+ if (decl)
+ {
+ assemble_external (decl);
+ SET_SYMBOL_REF_DECL (x, NULL);
+ }
+ }
+
if (size == UNITS_PER_WORD
&& aligned_p
&& function_label_operand (x, VOIDmode))
output_addr_const (asm_out_file, x);
fputc ('\n', asm_out_file);
- return true;
+ result = true;
}
- return default_assemble_integer (x, size, aligned_p);
+ else
+ result = default_assemble_integer (x, size, aligned_p);
+
+ if (decl)
+ SET_SYMBOL_REF_DECL (x, decl);
+
+ return result;
}
\f
/* Output an ascii string. */