aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2017-05-10 23:54:58 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2017-05-10 23:54:58 +0000
commit686048e48a63dae75b9ba0dca24d9fb6c2e44cea (patch)
tree78a8cde74a33dbdce1d370320fca8661a8526137
parent212b7e9cf3ea60a38943239707d82ab369e83c71 (diff)
downloadgcc-686048e48a63dae75b9ba0dca24d9fb6c2e44cea.zip
gcc-686048e48a63dae75b9ba0dca24d9fb6c2e44cea.tar.gz
gcc-686048e48a63dae75b9ba0dca24d9fb6c2e44cea.tar.bz2
re PR target/80090 (Incorrect assembler - output_addr_const may generate visibility output between op and address constant)
PR target/80090 * config/pa/pa.c (pa_assemble_integer): When outputting a SYMBOL_REF, handle calling assemble_external ourself. From-SVN: r247872
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/pa/pa.c28
2 files changed, 30 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4483f33..4ee565b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
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.
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 874d12d..3e65ba1 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -3299,6 +3299,24 @@ pa_output_64bit_ior (rtx *operands)
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))
@@ -3311,9 +3329,15 @@ pa_assemble_integer (rtx x, unsigned int size, int aligned_p)
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;
}
/* Output an ascii string. */