diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2007-01-18 13:54:11 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2007-01-18 13:54:11 +0100 |
commit | eedeea04da0bbdf7e975a31c9c55f3929657b909 (patch) | |
tree | 35528f51b61de752d5ace70f20f9840ecaf371df /gcc | |
parent | 9521dd6bd14f4915eecc79f886b805d3e1eb1ff7 (diff) | |
download | gcc-eedeea04da0bbdf7e975a31c9c55f3929657b909.zip gcc-eedeea04da0bbdf7e975a31c9c55f3929657b909.tar.gz gcc-eedeea04da0bbdf7e975a31c9c55f3929657b909.tar.bz2 |
re PR libfortran/29649 (Force core dump on runtime library errors)
2007-01-18 Francois-Xavier Coudert <coudert@clipper.ens.fr>
Tobias Burnus <burnus@net-b.de>
PR libfortran/29649
* gfortran.h (gfc_option_t): Add flag_dump_core.
* lang.opt: Add -fdump-core option.
* invoke.texi: Document the new options.
* trans-decl.c (gfc_build_builtin_function_decls): Add new
options to the call to set_std.
* options.c (gfc_init_options, gfc_handle_option): Set the
new options.
2007-01-18 Francois-Xavier Coudert <coudert@clipper.ens.fr>
Tobias Burnus <burnus@net-b.de>
PR libfortran/29649
* runtime/environ.c (variable_table): New GFORTRAN_ERROR_DUMPCORE
environment variable.
* runtime/compile_options.c (set_std): Add new argument.
* runtime/error.c (sys_exit): Move from io/unix.c. Add coredump functionality.
* libgfortran.h (options_t): New dump_core and backtrace members.
(sys_exit): Move prototype.
* io/unix.c (sys_exit): Move to runtime/error.c.
* configure.ac: Add check for getrlimit.
* configure: Regenerate.
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
From-SVN: r120897
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/fortran/gfortran.h | 1 | ||||
-rw-r--r-- | gcc/fortran/invoke.texi | 14 | ||||
-rw-r--r-- | gcc/fortran/lang.opt | 4 | ||||
-rw-r--r-- | gcc/fortran/options.c | 5 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 7 |
6 files changed, 40 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9dcead3..55c5ece 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2007-01-18 Francois-Xavier Coudert <coudert@clipper.ens.fr> + Tobias Burnus <burnus@net-b.de> + + PR libfortran/29649 + * gfortran.h (gfc_option_t): Add flag_dump_core. + * lang.opt: Add -fdump-core option. + * invoke.texi: Document the new options. + * trans-decl.c (gfc_build_builtin_function_decls): Add new + options to the call to set_std. + * options.c (gfc_init_options, gfc_handle_option): Set the + new options. + 2007-01-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/30476 diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 695d26d..64739fb 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1656,6 +1656,7 @@ typedef struct int flag_f2c; int flag_automatic; int flag_backslash; + int flag_dump_core; int flag_external_blas; int blas_matmul_limit; int flag_cray_pointer; diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 42f3b5e..9a9a008 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -121,7 +121,7 @@ by type. Explanations are in the following sections. -ffixed-line-length-@var{n} -ffixed-line-length-none @gol -ffree-line-length-@var{n} -ffree-line-length-none @gol -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 @gol --fcray-pointer -fopenmp -frange-check } +-fcray-pointer -fopenmp -frange-check -fno-backslash } @item Error and Warning Options @xref{Error and Warning Options,,Options to Request or Suppress Errors @@ -134,7 +134,8 @@ and Warnings}. @item Debugging Options @xref{Debugging Options,,Options for Debugging Your Program or GCC}. -@gccoptlist{-fdump-parse-tree -ffpe-trap=@var{list}} +@gccoptlist{-fdump-parse-tree -ffpe-trap=@var{list} +-fdump-core} @item Directory Options @xref{Directory Options,,Options for Directory Search}. @@ -559,6 +560,15 @@ zero), @samp{overflow} (overflow in a floating point operation), @samp{underflow} (underflow in a floating point operation), @samp{precision} (loss of precision during operation) and @samp{denormal} (operation produced a denormal value). + +@cindex -fdump-core option +@cindex options, -fdump-core +@item -fdump-core +@cindex core +Request that a core-dump file is written to disk when a runtime error +is encountered on systems that support core dumps. This option is +only effective for the compilation of the Fortran main program. + @end table @xref{Debugging Options,,Options for Debugging Your Program or GCC, diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index b744424..2991f7f 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -137,6 +137,10 @@ fdollar-ok Fortran Allow dollar signs in entity names +fdump-core +Fortran +Dump a core file when a runtime error occurs + fdump-parse-tree Fortran Display the code tree after parsing diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index e26ff36..cd937da 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -84,6 +84,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.flag_preprocessed = 0; gfc_option.flag_automatic = 1; gfc_option.flag_backslash = 1; + gfc_option.flag_dump_core = 0; gfc_option.flag_external_blas = 0; gfc_option.blas_matmul_limit = 30; gfc_option.flag_cray_pointer = 0; @@ -451,6 +452,10 @@ gfc_handle_option (size_t scode, const char *arg, int value) gfc_option.flag_backslash = value; break; + case OPT_fdump_core: + gfc_option.flag_dump_core = value; + break; + case OPT_fcray_pointer: gfc_option.flag_cray_pointer = value; break; diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 44ccbcc..000772c 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -2375,7 +2375,8 @@ gfc_build_builtin_function_decls (void) gfor_fndecl_set_std = gfc_build_library_function_decl (get_identifier (PREFIX("set_std")), void_type_node, - 3, + 4, + gfc_int4_type_node, gfc_int4_type_node, gfc_int4_type_node, gfc_int4_type_node); @@ -3143,6 +3144,10 @@ gfc_generate_function_code (gfc_namespace * ns) arglist = gfc_chainon_list (arglist, build_int_cst (gfc_int4_type_node, pedantic)); + arglist = gfc_chainon_list (arglist, + build_int_cst (gfc_int4_type_node, + gfc_option.flag_dump_core)); + tmp = build_function_call_expr (gfor_fndecl_set_std, arglist); gfc_add_expr_to_block (&body, tmp); } |