diff options
author | Jason Merrill <jason@redhat.com> | 2002-03-15 13:44:14 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-03-15 13:44:14 -0500 |
commit | 1540944868008eb593c8448eecafc253c0246ce3 (patch) | |
tree | f9851e49934bafc5dfa1ab66e0d14f9e2788eb5b /gcc | |
parent | 32135a8c0ca88b46200a10ada7e987b3e5bbd34b (diff) | |
download | gcc-1540944868008eb593c8448eecafc253c0246ce3.zip gcc-1540944868008eb593c8448eecafc253c0246ce3.tar.gz gcc-1540944868008eb593c8448eecafc253c0246ce3.tar.bz2 |
varasm.c (assemble_variable): Call resolve_unique_section before checking DECL_SECTION_NAME.
* varasm.c (assemble_variable): Call resolve_unique_section before
checking DECL_SECTION_NAME. Use zeros for a decl with DECL_INITIAL
of error_mark_node.
From-SVN: r50824
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/varasm.c | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 373cbdd..b252ab0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-03-15 Jason Merrill <jason@redhat.com> + + * varasm.c (assemble_variable): Call resolve_unique_section before + checking DECL_SECTION_NAME. Use zeros for a decl with DECL_INITIAL + of error_mark_node. + 2002-03-15 Richard Earnshaw <rearnsha@arm.com> PR target/5170 diff --git a/gcc/varasm.c b/gcc/varasm.c index 06ee8b8..f8df75b 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1602,6 +1602,13 @@ assemble_variable (decl, top_level, at_end, dont_output_data) if (TREE_PUBLIC (decl)) maybe_assemble_visibility (decl); + /* Output any data that we will need to use the address of. */ + if (DECL_INITIAL (decl) == error_mark_node) + reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0; + else if (DECL_INITIAL (decl)) + reloc = output_addressed_constants (DECL_INITIAL (decl)); + resolve_unique_section (decl, reloc); + /* Handle uninitialized definitions. */ if ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node @@ -1652,14 +1659,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data) if (TREE_PUBLIC (decl) && DECL_NAME (decl)) globalize_decl (decl); - /* Output any data that we will need to use the address of. */ - if (DECL_INITIAL (decl) == error_mark_node) - reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0; - else if (DECL_INITIAL (decl)) - reloc = output_addressed_constants (DECL_INITIAL (decl)); - /* Switch to the appropriate section. */ - resolve_unique_section (decl, reloc); variable_section (decl, reloc); /* dbxout.c needs to know this. */ @@ -1684,7 +1684,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data) if (!dont_output_data) { - if (DECL_INITIAL (decl)) + if (DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node) /* Output the actual data. */ output_constant (DECL_INITIAL (decl), tree_low_cst (DECL_SIZE_UNIT (decl), 1), |