function.c (INVOKE__main): Do not define.
authorMark Mitchell <mark@codesourcery.com>
Sun, 1 May 2005 18:23:27 +0000 (18:23 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 1 May 2005 18:23:27 +0000 (18:23 +0000)
* function.c (INVOKE__main): Do not define.
(expand_main_function): Check HAS_INIT_SECTION when determining
whether or not to call __main.

From-SVN: r99076

gcc/ChangeLog
gcc/function.c

index 07d8343..6ba6bb8 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-01  Mark Mitchell  <mark@codesourcery.com>
+
+       * function.c (INVOKE__main): Do not define.
+       (expand_main_function): Check HAS_INIT_SECTION when determining
+       whether or not to call __main.
+
 2005-05-01  Kazu Hirata  <kazu@cs.umass.edu>
 
        * tree-ssa-loop-ivopts.c: Fix a comment typo.
index 156dc3b..bde08a8 100644 (file)
@@ -3867,14 +3867,6 @@ init_function_for_compilation (void)
   VARRAY_GROW (sibcall_epilogue, 0);
 }
 
-/* Define IVOKE__main if we should emit a call to __main at the start
-   of "main".  */ 
-#if (!defined(INVOKE__main)                    \
-     && !defined(INIT_SECTION_ASM_OP)          \
-     && !defined(INIT_ARRAY_SECTION_ASM_OP))
-#define INVOKE__main
-#endif
-
 void
 expand_main_function (void)
 {
@@ -3914,7 +3906,10 @@ expand_main_function (void)
     }
 #endif
 
-#if defined(INVOKE__main)
+#if (defined(INVOKE__main)                             \
+     || (!defined(HAS_INIT_SECTION)                    \
+        && !defined(INIT_SECTION_ASM_OP)               \
+        && !defined(INIT_ARRAY_SECTION_ASM_OP)))
   emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0);
 #endif
 }