]> gcc.gnu.org Git - gcc.git/commitdiff
re PR fortran/40309 (gfortran does not support static c/d-tors.)
authorTobias Burnus <burnus@net-b.de>
Mon, 1 Jun 2009 07:00:35 +0000 (09:00 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 1 Jun 2009 07:00:35 +0000 (09:00 +0200)
2009-06-01  Tobias Burnus  <burnus@net-b.de>

       PR fortran/40309
       * trans-decl.c (gfc_sym_identifier): Use "MAIN__" for PROGRAM "main".
       (create_main_function): Set main_identifier_node.

From-SVN: r148035

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c

index c94b7d720a434a76c2a6e5243e6bb93751c8a475..533ac20a337201e6e84c28c1415aacdcb605ca29 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-01  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/40309
+       * trans-decl.c (gfc_sym_identifier): Use "MAIN__" for PROGRAM "main".
+       (create_main_function): Set main_identifier_node.
+
 2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR fortran/40019
index a036aebd17273a579effb0b2405defb6f05a172e..ef6172c85c34d9da0dc4ba37528995fb666c1bc7 100644 (file)
@@ -289,7 +289,10 @@ gfc_get_label_decl (gfc_st_label * lp)
 static tree
 gfc_sym_identifier (gfc_symbol * sym)
 {
-  return (get_identifier (sym->name));
+  if (sym->attr.is_main_program && strcmp (sym->name, "main") == 0)
+    return (get_identifier ("MAIN__"));
+  else
+    return (get_identifier (sym->name));
 }
 
 
@@ -3874,6 +3877,8 @@ create_main_function (tree fndecl)
   tmp =  build_function_type_list (integer_type_node, integer_type_node,
                                   build_pointer_type (pchar_type_node),
                                   NULL_TREE);
+  main_identifier_node = get_identifier ("main");
+  ftn_main = build_decl (FUNCTION_DECL, main_identifier_node, tmp);
   ftn_main = build_decl (FUNCTION_DECL, get_identifier ("main"), tmp);
   DECL_EXTERNAL (ftn_main) = 0;
   TREE_PUBLIC (ftn_main) = 1;
This page took 0.069201 seconds and 5 git commands to generate.