diff options
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 52a0268..cced662 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1204,6 +1204,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data) register const char *name; unsigned int align; int reloc = 0; + rtx decl_rtl; last_assemble_variable_decl = 0; @@ -1254,6 +1255,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data) if (TREE_ASM_WRITTEN (decl)) return; + /* Make sure ENCODE_SECTION_INFO is invoked before we set ASM_WRITTEN. */ + decl_rtl = DECL_RTL (decl); + TREE_ASM_WRITTEN (decl) = 1; /* Do no output if -fsyntax-only. */ @@ -1269,7 +1273,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data) return; } - name = XSTR (XEXP (DECL_RTL (decl), 0), 0); + name = XSTR (XEXP (decl_rtl, 0), 0); if (TREE_PUBLIC (decl) && DECL_NAME (decl) && ! first_global_object_name && ! (DECL_COMMON (decl) && (DECL_INITIAL (decl) == 0 |