summaryrefslogtreecommitdiffstats
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-22 19:09:11 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-22 19:09:11 +0000
commitf23886abacad045dae2b04895dddea4aaec2db1c (patch)
treeddee91463b1c5b5ef8aaf5e8a3581d490478bed9 /libgfortran/runtime
parente88209700fe9871b7e94de36a676bdbd86d64a36 (diff)
downloadppe42-gcc-f23886abacad045dae2b04895dddea4aaec2db1c.tar.gz
ppe42-gcc-f23886abacad045dae2b04895dddea4aaec2db1c.zip
2006-03-22 Thomas Koenig <Thomas.Koenig@onlien.de>
PR fortran/19303 * gfortran.h (gfc_option_t): Add record_marker. * lang.opt: Add -frecord-marker=4 and -frecord-marker=8. * trans-decl.c: Add gfor_fndecl_set_record_marker. (gfc_build_builtin_function_decls): Set gfor_fndecl_set_record_marker. (gfc_generate_function_code): If we are in the main program and -frecord-marker was provided, call set_record_marker. * options.c (gfc_handle_option): Add handling for -frecord-marker=4 and -frecord-marker=8. * invoke.texi: Document -frecord-marker. 2006-03-22 Thomas Koenig <Thomas.Koenig@onlien.de> PR fortran/19303 * libgfortran.h (compile_options_t): Add record_marker. * runtime/compile_options.c (set_record_marker): New function. * io/open.c: If we have four-byte record markers, use GFC_INTEGER_4_HUGE as default record length. * io/file_pos.c (unformatted_backspace): Handle different size record markers. * io/transfer.c (us_read): Likewise. (us_write): Likewise. (next_record_r): Likewise. (write_us_marker): Likewise. (next_record_w): Likewise. 2006-03-22 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/19303 * gfortran.dg/record_marker_1.f90: New test case. * gfortran.dg/record_marker_2.f: New test case. * gfortran.dg/record_marker_3.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/compile_options.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libgfortran/runtime/compile_options.c b/libgfortran/runtime/compile_options.c
index ce5e52a34da..fb6ac509f13 100644
--- a/libgfortran/runtime/compile_options.c
+++ b/libgfortran/runtime/compile_options.c
@@ -74,3 +74,29 @@ set_convert (int conv)
{
compile_options.convert = conv;
}
+
+extern void set_record_marker (int);
+export_proto (set_record_marker);
+
+
+void
+set_record_marker (int val)
+{
+
+ switch(val)
+ {
+ case 4:
+ if (sizeof (GFC_INTEGER_4) != sizeof (gfc_offset))
+ compile_options.record_marker = sizeof (GFC_INTEGER_4);
+ break;
+
+ case 8:
+ if (sizeof (GFC_INTEGER_8) != sizeof (gfc_offset))
+ compile_options.record_marker = sizeof (GFC_INTEGER_8);
+ break;
+
+ default:
+ runtime_error ("Invalid value for record marker");
+ break;
+ }
+}
OpenPOWER on IntegriCloud