passes.c (rest_of_decl_compilation): Don't defer call of assemble_variable if its...
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 12 Jul 2004 21:51:03 +0000 (21:51 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Mon, 12 Jul 2004 21:51:03 +0000 (21:51 +0000)
* passes.c (rest_of_decl_compilation): Don't defer call of
assemble_variable if its DECL_RTL is already set.

From-SVN: r84576

gcc/ChangeLog
gcc/passes.c

index 489ca19a8a5ba7963688d4252bb9067df89e0653..96b391fb8c8ee2b80e43977b0f2db53a42c3048f 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-12  Alexandre Oliva  <aoliva@redhat.com>
+
+       * passes.c (rest_of_decl_compilation): Don't defer call of
+       assemble_variable if its DECL_RTL is already set.
+
 2004-07-12  Sebastian Pop  <pop@cri.ensmp.fr>
 
        * cfgloop.h (struct loop): Add nb_iterations field.
index 0e85c1c57bc5ea603805047e0e0ae3c852fced42..52b71a3646338a837fa302341ee3601998799d35 100644 (file)
@@ -370,7 +370,14 @@ rest_of_decl_compilation (tree decl,
          && !DECL_EXTERNAL (decl))
        {
          if (flag_unit_at_a_time && !cgraph_global_info_ready
-             && TREE_CODE (decl) != FUNCTION_DECL && top_level)
+             && TREE_CODE (decl) != FUNCTION_DECL && top_level
+             /* If we defer processing of decls that have had their
+                DECL_RTL set above (say, in make_decl_rtl),
+                check_global_declarations() will clear it before
+                assemble_variable has a chance to act on it.  This
+                would remove all traces of the register name in a
+                global register variable, for example.  */
+             && !DECL_RTL_SET_P (decl))
            cgraph_varpool_finalize_decl (decl);
          else
            assemble_variable (decl, top_level, at_end, 0);