re PR rtl-optimization/12324 ([unit-at-a-time] not emitting function referenced from...
authorJan Hubicka <jh@suse.cz>
Wed, 3 Dec 2003 23:04:23 +0000 (00:04 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 3 Dec 2003 23:04:23 +0000 (23:04 +0000)
PR optimization/12324
* toplev.c  (rest_of_decl_compilation): Do not deffer when compiling
in unit-at-a-time mode.

From-SVN: r74252

gcc/ChangeLog
gcc/toplev.c

index fde381b07527b8146c2c9425017fa86be2e1827c..d951c37b83f731ac6c5fc338663577c144d013cf 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-03  Jan Hubicka  <jh@suse.cz>
+
+       PR optimization/12324
+       * toplev.c  (rest_of_decl_compilation): Do not deffer when compiling
+       in unit-at-a-time mode.
+
 2003-12-03  Jakub Jelinek  <jakub@redhat.com>
 
        * expr.c (store_constructor): Only set RTX_UNCHANGING_P for
index e4139611c5cffb2efda0b105bac2e10c08bd0026..47cdc73c7922e24e8d8699ad68eea77ed408f2c9 100644 (file)
@@ -1920,8 +1920,15 @@ rest_of_decl_compilation (tree decl,
        make_decl_rtl (decl, asmspec);
 
       /* Don't output anything when a tentative file-scope definition
-        is seen.  But at end of compilation, do output code for them.  */
-      if ((at_end || !DECL_DEFER_OUTPUT (decl)) && !DECL_EXTERNAL (decl))
+        is seen.  But at end of compilation, do output code for them.
+
+        We do output all variables when unit-at-a-time is active and rely on
+        callgraph code to defer them except for forward declarations
+        (see gcc.c-torture/compile/920624-1.c) */
+      if ((at_end
+          || !DECL_DEFER_OUTPUT (decl)
+          || (flag_unit_at_a_time && DECL_INITIAL (decl)))
+         && !DECL_EXTERNAL (decl))
        {
          if (flag_unit_at_a_time && !cgraph_global_info_ready
              && TREE_CODE (decl) != FUNCTION_DECL && top_level)