varasm.c (assemble_variable): Call resolve_unique_section before checking DECL_SECTIO...
authorJason Merrill <jason@redhat.com>
Fri, 15 Mar 2002 18:44:14 +0000 (13:44 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 15 Mar 2002 18:44:14 +0000 (13:44 -0500)
        * 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

gcc/ChangeLog
gcc/varasm.c

index 373cbdd23e36edb4e276ac1d2ac3822e159bb3f3..b252ab0e7febb645fe2ecaa239c3066af701bb12 100644 (file)
@@ -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
index 06ee8b82db9b2f3be9a8366bebb4147095820a6c..f8df75b660866a0befd4a8f621d5c2eebc69ffdb 100644 (file)
@@ -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),