aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-08-11 15:50:13 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2005-08-11 13:50:13 +0000
commit8b67b708f159a6776a07d6eec9c44d3dc8ab9f6e (patch)
treed2c54ce8afd0ee3ffde950228cb4b59edbde4431 /gcc/fortran/trans.c
parent74b002ba34f1d63cc0130ad44076b462477c631f (diff)
downloadgcc-8b67b708f159a6776a07d6eec9c44d3dc8ab9f6e.zip
gcc-8b67b708f159a6776a07d6eec9c44d3dc8ab9f6e.tar.gz
gcc-8b67b708f159a6776a07d6eec9c44d3dc8ab9f6e.tar.bz2
re PR libfortran/20006 ($ format extension doesn't work)
PR libfortran/20006 * gfortran.h: Add is_main_program member to symbol_attribute. * trans-decl: Add a gfor_fndecl_set_std tree. (gfc_build_builtin_function_decls): Create it. (gfc_generate_function_code): Add this call at the beginning of the main program. * trans.c (gfc_generate_code): Move main_program and attr. * trans.h: Add declaration for gfor_fndecl_set_std. * Makefile.am: Add file runtime/compile_options.c. * Makefile.in: Regenerate. * libgfortran.h: Create structure compile_options_t. Define the compile_options variable and GFC_STD_ macros. * runtime/compile_options.c: New file. * runtime/error.c (notify_std): New function. * runtime/main.c (init): Call init_compile_options during initialization. * io/format.c: Use the new notify_std function for the $ descriptor extension. * gfortran.dg/runtime_warning_1.f90: New test. Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r102990
Diffstat (limited to 'gcc/fortran/trans.c')
-rw-r--r--gcc/fortran/trans.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 0ee8459..a3c3ddc 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -650,9 +650,6 @@ gfc_trans_code (gfc_code * code)
void
gfc_generate_code (gfc_namespace * ns)
{
- gfc_symbol *main_program = NULL;
- symbol_attribute attr;
-
if (ns->is_block_data)
{
gfc_generate_block_data (ns);
@@ -662,6 +659,9 @@ gfc_generate_code (gfc_namespace * ns)
/* Main program subroutine. */
if (!ns->proc_name)
{
+ gfc_symbol *main_program;
+ symbol_attribute attr;
+
/* Lots of things get upset if a subroutine doesn't have a symbol, so we
make one now. Hopefully we've set all the required fields. */
gfc_get_symbol ("MAIN__", ns, &main_program);
@@ -670,7 +670,9 @@ gfc_generate_code (gfc_namespace * ns)
attr.proc = PROC_UNKNOWN;
attr.subroutine = 1;
attr.access = ACCESS_PUBLIC;
+ attr.is_main_program = 1;
main_program->attr = attr;
+
/* Set the location to the first line of code. */
if (ns->code)
main_program->declared_at = ns->code->loc;