Commit Graph

1472 Commits

Author SHA1 Message Date
Jerry DeLisle 41c3cddc6b re PR fortran/43409 (I/O: INQUIRE for SIZE does not work.)
2010-03-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/43409
	* ioparm.def: Change inquire size variable to type pointer to
	GFC_IO_INT type.

2010-03-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/43409
	* io/unix.h: Add prototype for new function to return file size.
	* io/unix.c (file_size): New function.
	* io/inquire.c (inquire_via_unit): Use new function.
	(inquire_via_filename): Use new function.

From-SVN: r157593
2010-03-20 14:39:00 +00:00
Jerry DeLisle bf71e8f028 transfer.c (read_sf_internal): Remove stray function declaration used during debigging.
2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (read_sf_internal): Remove stray function declaration
	used during debigging.

From-SVN: r157531
2010-03-18 03:26:07 +00:00
Jerry DeLisle 59011a60c0 re PR fortran/43265 (No EOF condition if reading with '(x)' from an empty file)
2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43265
	* io/io.h: Delete prototype for read_sf, making it static.
	* io/read.c (read_x): Modify to call hit_eof if PAD="no".
	* io/transfer.c (read_sf_internal): New static function extracted from
	read_sf for use on internal units only. Handle empty string case.
	(read_sf): New factoring of this function, make it static.  Add special
	conditions for EOF based on ADVANCE="no", PAD="no", and whether any
	bytes have been previously read from the record.
	(read_block_form): Modify to call read_sf or read_sf_internal.
	(next_record_r): Add a done flag similar to next_record_w. Call hit_eof
	if internal array unit next record returns finished, meaning an EOF was
	found and not done, ie not the last record expected.  For external
	units call hit_eof if item_count is 1 or there are no pending spaces.
	(next_record): Update call to next_record_r.

From-SVN: r157527
2010-03-18 02:38:17 +00:00
Kai Tietz b2ef02df53 format.c (parse_format_list): Add to ERROR, WARNING, SILENT enumerators NOTIFICATION_ prefix.
2010-03-12  Kai Tietz  <kai.tietz@onevision.com>

        PR/42950
        * io/format.c (parse_format_list): Add to ERROR, WARNING,
        SILENT enumerators NOTIFICATION_ prefix.
        * runtime/error.c (notification_std): Likewise.
        * libgfortran.h (notification): Likewise.
        (GFC_LARGEST_BUF): Check for HAVE_GFC_INTEGER_16.

From-SVN: r157407
2010-03-12 15:43:55 +01:00
Tobias Burnus 2f4d643dab re PR fortran/43228 (NAMELIST I/O: Reading at 2 dimensions (rank) array values.)
2010-03-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43228
        * io/list_read.c (nml_parse_qualifier): Disable expanded_read
        for array sections.

2010-03-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43228
        * gfortran.dg/namelist_61.f90: New test.

From-SVN: r157389
2010-03-11 17:06:37 +01:00
Jerry DeLisle b7137299f1 re PR libfortran/43320 (200.sixtrack fails setup)
2010-03-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43320
	* io/transfer.c (next_record_r): Add hit_eof based on item_count
	condition.

From-SVN: r157377
2010-03-11 02:15:33 +00:00
Jerry DeLisle 04b98fd2ed re PR fortran/43265 (No EOF condition if reading with '(x)' from an empty file)
2010-03-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43265
	* io/read.c: Include fbuf.h and unix.h to enable lower level I/O for
	read_x. (read_x): Replace the use of read_sf with equivalent lower level
	I/O, eliminating unneeded code and handling EOF and EOR conditions.
	* io/io.h: Revise prototype for read_sf.
	* io/transfer.c (read_sf): Delete no_error parameter and all uses of it.
	(read_block_form): Likewise.
	(next_record_r): Delete wrong code call to hit_eof.

From-SVN: r157310
2010-03-09 14:41:17 +00:00
Kai Tietz 196c8bc8a3 libgfortran.h (_POSIX): Define if __MINGW32__ is defined.
2010-03-08  Kai TIetz  <kai.tietz@onevision.com>

        PR/42950
        * libgfortran.h (_POSIX): Define if __MINGW32__ is defined.
        (gfc_printf): Define to gnu_printf for __MINGW32__ case,
        otherwise to __printf__.
        (gfc_strtof,gfc_strtod,gfc_strtold): Define for mingw case
        to POSIX compatible converter functions.
        (runtime_error): Use instead gfc_printf as formatter
        attribute name.
        (runtime_error_at): Likewise.
        (runtime_warning_at): Likewise.
        (st_printf): Likewise.
        * intrinsics/date_and_time.c (localtime_r): Undefine
        possible defined macro.
        (gmtime_r): Likewise.
        * io/read.c (convert_real): Use gfc_strtof, gfc_strtod,
        and gfc_strtold.

From-SVN: r157271
2010-03-08 09:01:55 +01:00
Jerry DeLisle f205d1da0f Fix ChangeLog Entry.
From-SVN: r157061
2010-02-25 05:53:35 +00:00
Jerry DeLisle f983954d59 transfer.c (require_type): Subtract one from item_count for output of error message.
2010-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (require_type): Subtract one from item_count for output
	of error message.  Add comment before formatted_transfer function
	explaining why the item_count is off by one.

From-SVN: r157060
2010-02-25 05:47:10 +00:00
Rainer Orth 28c64ec893 * io/write_float.def (WRITE_FLOAT): Use __builtin_signbit.
From-SVN: r157048
2010-02-24 15:35:40 +00:00
Jerry DeLisle 3bbc846211 list_read.c (list_formatted_read_scalar): Remove duplicate code.
2010-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/list_read.c (list_formatted_read_scalar): Remove duplicate code.

From-SVN: r156988
2010-02-23 05:00:42 +00:00
Tobias Burnus e76e92315f re PR libfortran/42996 (Incorrect length returned from get_command_argument intrinsic)
2010-02-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42996
        * intrinsics/args.c (get_command_argument_i4): Always return
        commandline-argument length for length parameter.

From-SVN: r156630
2010-02-09 18:04:57 +01:00
Jerry DeLisle 6c076a6c42 re PR libfortran/42742 (Handle very large format strings correctly)
2010-02-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/42742
	* io/format.c (reset_fnode_counters): Use the correct pointer to the
	head of the fnode list. (parse_format): Remove previous hack that set
	limit on size of format string for caching.

From-SVN: r156568
2010-02-07 07:45:55 +00:00
Jerry DeLisle 26bda00088 PR libfortran
2010-02-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran
	* io/transfer.c (read_sf): Handle EOR and EOF conditions for
	ADVANCE="no" with PAD="yes" or PAD="no".

From-SVN: r156540
2010-02-06 14:39:51 +00:00
Jerry DeLisle e3e2cdd182 re PR fortran/42901 (reading array of structures from namelist fails)
2010-02-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/42901
	* io/list_read.c (nml_get_obj_data): Add new qualifier flag, clean up
	code, and adjust logic to set namelist info pointer correctly for array
	qualifiers of derived type components.

From-SVN: r156487
2010-02-04 01:49:41 +00:00
Jerry DeLisle 6d1adadd1b Add PR number to ChangeLog.
From-SVN: r155940
2010-01-15 15:55:24 +00:00
Jerry DeLisle 601aa68fd9 format.c (parse_format): Set limit on size of format strings that will be cached.
2010-01-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/format.c (parse_format): Set limit on size of format strings that
	will be cached.

From-SVN: r155939
2010-01-15 15:52:28 +00:00
Rainer Orth b9497ab5ed stdint.m4 (GCC_HEADER_STDINT): Don't typedef uint8_t etc.
config:
	* stdint.m4 (GCC_HEADER_STDINT): Don't typedef uint8_t etc. if
	corresponding macros already exist.

	libdecnumber:
	* configure: Regenerate.

	libgfortran:
	* configure: Regenerate.

	libgomp:
	* configure: Regenerate.

	libstdc++-v3:
	* configure: Regenerate.

From-SVN: r155648
2010-01-05 14:02:37 +00:00
Janne Blomqvist 982198d511 ChangeLog-2002: Add copyright footer.
2009-01-04  Tobias Burnus  <burnus@net-b.de>

        * ChangeLog-2002: Add copyright footer.
        * ChangeLog-2003: Ditto.
        * ChangeLog-2004: Ditto.
        * ChangeLog-2005: Ditto.
        * ChangeLog-2006: Ditto.
        * ChangeLog-2007: Ditto.
        * ChangeLog-2008: Ditto.
        * ChangeLog-2009: Ditto.
        * ChangeLog: Ditto.

From-SVN: r155611
2010-01-04 09:59:59 +01:00
Janne Blomqvist c9828e7878 PR libfortran/42420 Large file capable stat for MingW
From-SVN: r155593
2010-01-03 20:09:37 +02:00
Janne Blomqvist f18c74a73d Rotate ChangeLogs for 2008 and 2009
From-SVN: r155592
2010-01-03 20:08:27 +02:00
Janne Blomqvist a8572b62e7 Increase clock resolution for system_clock_8.
From-SVN: r155359
2009-12-19 12:43:11 +02:00
Tobias Burnus 17314cd9eb re PR libfortran/41711 ([F08] BOZ edit-descr does not support reading large kind reals)
2009-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41711
        * io/read.c (set_integer): Support kind=10 for reading
        real/complex BOZ.

2009-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41711
        * gfortran.dg/boz_15.f90: New test.

From-SVN: r155088
2009-12-08 15:12:06 +01:00
Janus Weil a15b72fa7f re PR fortran/41478 (Corrupted memory using PACK for derived-types with allocated components)
libgfortran/
2009-12-06  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41478
	PR fortran/42268
	* intrinsics/pack_generic.c (pack): Add safety checks for the case that
	'vector' is NULL.


gcc/testsuite/
2009-12-06  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41478
	PR fortran/42268
	* gfortran.dg/intrinsic_pack_5.f90: New test.

From-SVN: r155024
2009-12-06 23:57:13 +01:00
Ralf Wildenhues 43e02a8a71 Sync from git Libtool and regenerate.
/:
	PR target/38384
	PR bootstrap/40972
	* libtool.m4: Sync from git Libtool.
	* ltoptions.m4: Likewise.
	* ltversion.m4: Likewise.
	* lt~obsolete.m4: Likewise.
	* ltmain.sh: Likewise.

boehm-gc/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.

fixincludes/:
	* configure: Regenerate.

gcc/:
	* configure: Regenerate.

libffi/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgfortran/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libgomp/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libjava/classpath/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* doc/api/Makefile.in: Regenerate.
	* examples/Makefile.in: Regenerate.
	* external/Makefile.in: Regenerate.
	* external/jsr166/Makefile.in: Regenerate.
	* external/relaxngDatatype/Makefile.in: Regenerate.
	* external/sax/Makefile.in: Regenerate.
	* external/w3c_dom/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* lib/Makefile.in: Regenerate.
	* native/Makefile.in: Regenerate.
	* native/fdlibm/Makefile.in: Regenerate.
	* native/jawt/Makefile.in: Regenerate.
	* native/jni/Makefile.in: Regenerate.
	* native/jni/classpath/Makefile.in: Regenerate.
	* native/jni/gconf-peer/Makefile.in: Regenerate.
	* native/jni/gstreamer-peer/Makefile.in: Regenerate.
	* native/jni/gtk-peer/Makefile.in: Regenerate.
	* native/jni/java-io/Makefile.in: Regenerate.
	* native/jni/java-lang/Makefile.in: Regenerate.
	* native/jni/java-math/Makefile.in: Regenerate.
	* native/jni/java-net/Makefile.in: Regenerate.
	* native/jni/java-nio/Makefile.in: Regenerate.
	* native/jni/java-util/Makefile.in: Regenerate.
	* native/jni/midi-alsa/Makefile.in: Regenerate.
	* native/jni/midi-dssi/Makefile.in: Regenerate.
	* native/jni/native-lib/Makefile.in: Regenerate.
	* native/jni/qt-peer/Makefile.in: Regenerate.
	* native/jni/xmlj/Makefile.in: Regenerate.
	* native/plugin/Makefile.in: Regenerate.
	* resource/Makefile.in: Regenerate.
	* scripts/Makefile.in: Regenerate.
	* tools/Makefile.in: Regenerate.

libjava/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libmudflap/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libobjc/:
	* configure: Regenerate.

libssp/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libstdc++-v3/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

lto-plugin/:
	* configure: Regenerate.
	* Makefile.in: Regenerate.

zlib/:
	* Makefile.in: Regenerate.
	* configure: Regenerate.

From-SVN: r155012
2009-12-05 17:18:53 +00:00
Janne Blomqvist a4384badd7 PR libfortran/40812 Large file support for MinGW
From-SVN: r154984
2009-12-04 18:28:44 +02:00
Janus Weil 7c1dab0d8b backport: re PR fortran/42053 ([OOP] SELECT TYPE: reject duplicate CLASS IS blocks)
merge from fortran-dev branch:


gcc/fortran/

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/42053
	* resolve.c (resolve_select_type): Check for duplicate CLASS IS blocks.

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41631
	* decl.c (gfc_match_derived_decl): Set extension level.
	* gfortran.h (symbol_attribute): Expand 'extension' bit field to 8 bit.
	* iresolve.c (gfc_resolve_extends_type_of): Return value of
	'is_extension_of' has kind=4.
	* match.c (select_type_set_tmp,gfc_match_class_is): Create temporary
	for CLASS IS blocks.
	* module.c (MOD_VERSION): Bump module version.
	(ab_attribute,attr_bits): Remove AB_EXTENSION.
	(mio_symbol_attribute): Handle expanded 'extension' field.
	* resolve.c (resolve_select_type): Implement CLASS IS blocks.
	(resolve_fl_variable_derived): Show correct type name.
	* symbol.c (gfc_build_class_symbol): Set extension level.

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	* intrinsic.h (gfc_resolve_extends_type_of): Add prototype.
	* intrinsic.c (add_functions): Use 'gfc_resolve_extends_type_of'.
	* iresolve.c (gfc_resolve_extends_type_of): New function, which
	replaces the call to EXTENDS_TYPE_OF by the library function
	'is_extension_of' and modifies the arguments.
	* trans-intrinsic.c (gfc_conv_extends_type_of): Removed.
	(gfc_conv_intrinsic_function): FOR EXTENDS_TYPE_OF, don't call
	gfc_conv_extends_type_of but gfc_conv_intrinsic_funcall.

2009-11-30  Paul Thomas  <pault@gcc.gnu.org>
	    Janus Weil  <janus@gcc.gnu.org>

	* decl.c (encapsulate_class_symbol): Replaced by
	'gfc_build_class_symbol'.
	(build_sym,build_struct): Call 'gfc_build_class_symbol'.
	(gfc_match_derived_decl): Replace vindex by hash_value.
	* dump-parse-tree.c (show_symbol): Replace vindex by hash_value.
	* gfortran.h (symbol_attribute): Add field 'vtab'.
	(gfc_symbol): Replace vindex by hash_value.
	(gfc_class_esym_list): Ditto.
	(gfc_get_derived_type,gfc_build_class_symbol,gfc_find_derived_vtab):
	New prototypes.
	* module.c (mio_symbol): Replace vindex by hash_value.
	* resolve.c (vindex_expr): Rename to 'hash_value_expr'.
	(resolve_class_compcall,resolve_class_typebound_call): Renamed
	'vindex_expr'.
	(resolve_select_type): Replace $vindex by $vptr->$hash.
	* symbol.c (gfc_add_save): Handle vtab symbols.
	(gfc_type_compatible): Rewrite.
	(gfc_build_class_symbol): New function which replaces
	'encapsulate_class_symbol'.
	(gfc_find_derived_vtab): New function to set up a vtab symbol for a
	derived type.
	* trans-decl.c (gfc_create_module_variable): Handle vtab symbols.
	* trans-expr.c (select_class_proc): Replace vindex by hash_value.
	(gfc_conv_derived_to_class): New function to construct a temporary
	CLASS variable from a derived type expression.
	(gfc_conv_procedure_call): Call 'gfc_conv_derived_to_class'.
	(gfc_conv_structure): Initialize the $extends and $size fields of
	vtab symbols.
	(gfc_trans_class_assign): Replace $vindex by $vptr. Remove the $size
	assignment.
	* trans-intrinsic.c (gfc_conv_same_type_as): Replace $vindex by
	$vptr->$hash, and replace vindex by hash_value.
	* trans-stmt.c (gfc_trans_allocate): Insert $vptr references, replace
	$vindex by $vptr. Remove the $size assignment.
	* trans-types.c (gfc_get_derived_type): Make it non-static.


gcc/testsuite/

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/42053
	* gfortran.dg/select_type_9.f03: New.

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41631
	* gfortran.dg/extends_type_of_1.f03: Fix invalid test case.
	* gfortran.dg/module_md5_1.f90: Adjusted MD5 sum.
	* gfortran.dg/select_type_1.f03: Remove FIXMEs.
	* gfortran.dg/select_type_2.f03: Ditto.
	* gfortran.dg/select_type_8.f03: New test.

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	* gfortran.dg/extends_type_of_1.f03: New test.
	* gfortran.dg/same_type_as_1.f03: Extended.

2009-11-30  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/class_4c.f03: Add dg-additional-sources.
	* gfortran.dg/class_4d.f03: Rename module. Cleanup modules.


libgfortran/

2009-11-30  Janus Weil  <janus@gcc.gnu.org>

	* gfortran.map: Add _gfortran_is_extension_of.
	* Makefile.am: Add intrinsics/extends_type_of.c.
	* Makefile.in: Regenerated.
	* intrinsics/extends_type_of.c: New file.

From-SVN: r154840
2009-11-30 21:43:06 +01:00
Kai Tietz 509f7fdc0e unix.c (find_file): Add variable id conditionally for mingw targets.
2009-11-30  Kai Tietz  <Kai.Tietz@onevision.com>

        * io/unix.c (find_file): Add variable id conditionally for
        mingw targets.

From-SVN: r154806
2009-11-30 15:12:33 +01:00
Jakub Jelinek 14ca4cf89c pack_generic.c (pack_internal): Remove unused zero_sized variable.
* intrinsics/pack_generic.c (pack_internal): Remove unused
	zero_sized variable.
	* intrinsics/unpack_generic.c (unpack0): Remove unused size
	variable.
	* io/write.c (namelist_write_newline): Remove unused length
	variable.
	* io/unix.c (find_file): Remove unused id variable.
	* m4/ifunction.m4 (SCALAR_ARRAY_FUNCTION): Remove unused sstride
	variable.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

From-SVN: r154729
2009-11-28 21:29:51 +01:00
Janne Blomqvist 872d209423 Move includes after include guards
From-SVN: r154343
2009-11-19 22:23:03 +02:00
Jerry DeLisle 0b4d979f55 re PR fortran/42090 (I/O: Problems when reading partial records in formatted direct access files)
2009-11-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/42090
	* io/transfer.c (skip_record): Set bytes_left_subrecord to zero after
	skipping the remaining bytes in the record.
	(next_record_r): Call skip_record with the number of bytes_left to be
	skipped.

From-SVN: r154316
2009-11-19 04:50:04 +00:00
Janne Blomqvist a2f560d05c Forgot files from r153825
From-SVN: r153827
2009-11-03 00:14:20 +02:00
Janne Blomqvist 92cbdb6845 Split up io/io.h
From-SVN: r153825
2009-11-02 23:52:59 +02:00
Janne Blomqvist 23db99134a PR libfortran/41219 Fix build warnings
From-SVN: r153769
2009-10-31 00:37:47 +02:00
Jerry DeLisle 486024b158 re PR libfortran/41711 ([F08] BOZ edit-descr does not support reading large kind reals)
2009-10-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41711
	* libgfortran.h: Define larger sizes for BOZ conversion	buffers.
	* io/write.c (extract_uint): Include case where size is 10 if integer
	is large enough. (write_int): Rename to	write_boz. (write_boz): Factor
	out extract_uint and delete the	conversion function.
	(btoa_big): New binary conversion function.
	(otoa_big): New octal conversion function.
	(ztoa_big): New	hexidecimal conversion function.
	(write_b): Modify to use new function.
	(write_o): Likewise.
	(write_z): Likewise.

From-SVN: r153724
2009-10-29 19:20:18 +00:00
Jerry DeLisle 0a81006d27 re PR libfortran/41683 (F2003 Repeat specification after P descriptor rejected)
2009-10-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41683
	* io/format.c (parse_format_list): Allow a repeat specifier immediately
	after a P specifier.

From-SVN: r152695
2009-10-13 01:43:39 +00:00
Jerry DeLisle a30595bf43 re PR fortran/38439 (I/O PD edit descriptor inconsistency)
2009-10-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/38439
	* io/format.c (parse_format_list): Correct logic for FMT_F reading vs
	writing. Code clean-up.

From-SVN: r152657
2009-10-12 00:52:45 +00:00
Jerry DeLisle d8c00a207c re PR fortran/38439 (I/O PD edit descriptor inconsistency)
2009-10-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/38439
	* io/format.c (parse_format_list): Add check for tokens not allowed
	after P specifier. Fix comments.  Remove un-needed code. Fix the
	default exponent list. Correct pointer assignment error.

From-SVN: r152644
2009-10-11 17:37:50 +00:00
Jerry DeLisle 0e8fc1857d re PR libfortran/35862 ([F2003] Implement new rounding modes for run time)
2009-10-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/35862
	* write_float.def (outout_float): Fix handling of special case where no
	digits after the decimal point and values less than 1.0. Adjust index
	into digits string. (WRITE_FLOAT): Remove special case code from macro.

From-SVN: r152483
2009-10-06 03:08:20 +00:00
Jerry DeLisle 379924dd59 re PR libfortran/35862 ([F2003] Implement new rounding modes for run time)
2009-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/35862
	* io.h (gfc_unit): Add round_status.
	(format_token): Add enumerators for rounding format specifiers.
	* transfer.c (round_opt): New options table.
	(formatted_transfer_scalar_read): Add set round_status for each rounding
	format token. (formatted_transfer_scalar_write): Likewise.
	* format.c (format_lex): Tokenize the rounding format specifiers.
	(parse_format_list): Parse the rounding format specifiers.
	* write_float.def (outout_float): Modify rounding code to use new
	variable rchar to set the appropriate rounding. Fix some whitespace.
	* unit.c (get_internal_unit): Initialize rounding mode for internal
	units. (init_units): Likewise.

From-SVN: r152263
2009-09-29 02:47:54 +00:00
Iain Sandoe db1cf15c83 configure.ac: Check for GFORTRAN_C99_1.1 funcs in OS libm.
2009-09-19  Iain Sandoe  <iain.sandoe@sandoe-acoustics.co.uk>

* configure.ac: Check for GFORTRAN_C99_1.1 funcs in OS libm.
        * configure: Regenerate.
        * config.h.in: Ditto.

From-SVN: r151972
2009-09-22 12:23:06 +02:00
Jerry DeLisle bf187ce8be re PR fortran/41328 (bad iostat when reading DOS file in a character array (non-advancing))
2009-09-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41328
	* io/transfer.c (read_sf): Set at_eof flag on short read if any
	characters were successfully read so that EOF condition with no EOR
	marker succeeds.

From-SVN: r151877
2009-09-19 04:41:38 +00:00
Jerry DeLisle ee3eb6a416 re PR fortran/41328 (bad iostat when reading DOS file in a character array (non-advancing))
2009-09-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41328
	* io/transfer.c (read_sf): Adjust fbuf position and do proper
	fbuf reads to traverse CR, CR-LF, and LF style line ends.

From-SVN: r151665
2009-09-13 03:41:41 +00:00
Jerry DeLisle b495ad7f55 re PR fortran/41219 (libgfortran build warnings)
2009-09-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41219
	* io/write.c (write_a_char4): Use correct type for crlf constant.

From-SVN: r151653
2009-09-12 15:08:27 +00:00
Ralf Wildenhues 878f62e5bd Override all per-target *_LINK variables correctly.
boehm-gc/:
	* Makefile.am (libgcjgc_la_LINK, gctest_LINK): New.
	(gctest_LDADD): Depend on libgcjgc.la instead of ./libgcjgc.la,
	so that library dependency resolution works with portable make.
	* Makefile.in: Regenerate.

libgfortran/:
	* Makefile.am (libgfortranbegin_la_LINK): New.
	* Makefile.in: Regenerate.

libgomp/:
	* Makefile.am (libgomp_la_LINK): New.
	* Makefile.in: Regenerate.

libjava/:
	* Makefile.am (libgij_la_LINK, libjvm_la_LINK): New.
	* Makefile.in: Regenerate.

libstdc++-v3/:
	* src/Makefile.am (libstdc___la_LINK): New.
	* src/Makefile.in: Regenerate.

From-SVN: r151627
2009-09-11 05:02:20 +00:00
Paolo Bonzini c13e029be4 stdint.m4 (GCC_HEADER_STDINT): Revert changes to this macro in the previous two patches.
config:
2009-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* stdint.m4 (GCC_HEADER_STDINT): Revert changes to this macro in
	the previous two patches.

libgfortran:
2009-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libdecnumber:
2009-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

From-SVN: r151574
2009-09-09 19:42:21 +00:00
Paolo Bonzini d72a3ac17b stdint.m4: Store temporary file in $tmp/_GCC_STDINT_H.
2009-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* stdint.m4: Store temporary file in $tmp/_GCC_STDINT_H.
	Eliminate now pointless comments.

libdecnumber:
2009-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libgfortran:
2009-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

From-SVN: r151567
2009-09-09 16:51:14 +00:00
Jerry DeLisle 951b8fbe45 re PR fortran/41192 (NAMELIST input with just a comment ("&NAME ! comment \") fails)
2009-09-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/41192
	* io/list_read.c (eat_line): Enable eat_line to function on
	internal units.

	PR libgfortran/41219
	* io/list_read.c (nml_read_obj): Replace GFC_DTYPE_UNKNOWN with
	BT_NULL to get rid of warning.

From-SVN: r151495
2009-09-08 00:59:05 +00:00
Tobias Burnus aa4042b15e re PR fortran/41219 (libgfortran build warnings)
2009-09-04  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41219
        * intrinsics/getlog.c: Define _POSIX for MINGW32.

From-SVN: r151417
2009-09-04 11:25:00 +02:00
Tobias Burnus ee5111a441 re PR fortran/41219 (libgfortran build warnings)
2009-09-03  Tobias Burnus  <burnus@net-b.de>

       PR fortran/41219
       * intrinsics/iso_c_binding.c (c_f_pointer_u0): Move variable
       declaration out of the loop.

From-SVN: r151371
2009-09-03 09:36:36 +02:00
Thomas Koenig 01d93568e8 pack.m4 (pack_'rtype_code`): Use count_0 for counting true values in a logical array.
2009-08-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* m4/pack.m4 (pack_'rtype_code`): Use count_0 for counting true
	values in a logical array.  Mark bounds checking tests as
	unlikely.
	* intrinsics/pack_generic.c (pack_internal): Likewise.
	* runtime/bounds.c (count_0):  Fix off-by-one error in detecting
	empty arrays.
	* generated/pack_c4.c: Regenerated.
	* generated/pack_c8.c: Regenerated.
	* generated/pack_c10.c: Regenerated.
	* generated/pack_c16.c: Regenerated.
	* generated/pack_i1.c: Regenerated.
	* generated/pack_i16.c: Regenerated.
	* generated/pack_i2.c: Regenerated.
	* generated/pack_i4.c: Regenerated.
	* generated/pack_i8.c: Regenerated.
	* generated/pack_r4.c: Regenerated.
	* generated/pack_r8.c: Regenerated.
	* generated/pack_r10.c: Regenerated.
	* generated/pack_r16.c: Regenerated.

From-SVN: r151225
2009-08-30 09:02:01 +00:00
Thomas Koenig 8c39b98796 re PR libfortran/34670 (bounds checking for array intrinsics)
2009-08-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* runtime/bounds.c (count_0):  New function.
	* intrinsics/unpack_generic (unpack_bounds):  New function.
	(unpack_internal):  Remove zero stride checks.
	(unpack1):  Use unpack_bounds.
	(unpack1_char):  Likeweise.
	(unpack1_char4):  Likewise
	(unpack0):  Likewise.
	(unpack0_char):  Likewise.
	(unpack0_char4):  Likewise.

2009-08-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* gfortran.dg/unpack_bounds_1.f90:  New test.
	* gfortran.dg/unpack_bounds_2.f90:  New test.
	* gfortran.dg/unpack_bounds_3.f90:  New test.

From-SVN: r151085
2009-08-25 17:05:10 +00:00
Steven G. Kargl 4551438c75 re PR libfortran/41157 (dtime not consistent in times reported)
2009-08-24  Steven G. Kargl  <kargl@gcc.gnu.org>

    PR fortran/41157
    * dtime.c (dtime_sub): Fix computing time increment.
    * time_1.h: Add <sys/types.h> header.  Use RUSAGE_SELF macro instead
    of a hardcoded 0.

From-SVN: r151072
2009-08-25 01:47:23 +00:00
Ralf Wildenhues df58e64872 Update AC_PREREQ entries to 2.64
/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

intl/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libdecnumber/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libiberty/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libjava/classpath/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libjava/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libjava/libltdl/:
	* configure.ac (AC_PREREQ): Bump to 2.64.  Remove FIXME.

libssp/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libobjc/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libstdc++-v3/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libada/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libgcc/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libgfortran/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

boehm-gc/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

gnattools/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

gcc/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

fixincludes/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libmudflap/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

zlib/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libffi/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libcpp/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

libgomp/:
	* configure.ac (AC_PREREQ): Bump to 2.64.

From-SVN: r151059
2009-08-24 19:08:51 +00:00
Steven G. Kargl 1237f8f1c4 cshift0.c: Update license to GPL3+exception.
2009-08-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	* intrinsics/cshift0.c: Update license to GPL3+exception.
	* runtime/fpu.c: Add a GPL3+exception statement.

From-SVN: r151038
2009-08-23 19:10:25 +00:00
Ralf Wildenhues 70fa0efaf4 Cleanups after the update to Autoconf 2.64, Automake 1.11.
/:
	* configure.ac: Remove --with-datarootdir, --with-docdir,
	--with-pdfdir, --with-htmldir switches.
	* configure: Regenerate.

gcc/:
	* configure.ac: Remove --with-datarootdir, --with-docdir,
	--with-htmldir switches.  No need to call AC_SUBST for
	datarootdir, docdir, htmldir any more.
	* configure: Regenerate.
	* doc/install.texi (Configuration): Document --datarootdir,
	--docdir, --htmldir, --pdfdir; update documentation for
	--infodir, --mandir.
	(Prerequisites): Bump Autoconf version to 2.64, Automake to
	1.11, M4 to 1.4.6.

libgfortran/:
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

libjava/classpath/:
	* doc/cp-hacking.texinfo (Needed Tools and Libraries): Bump
	Autoconf version to 2.64, Automake to 1.11, M4 to 1.4.6.

libjava/:
	* HACKING: Use aclocal-1.11 and autoconf-2.64 in example.
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

libstdc++-v3/:
	* doc/xml/manual/build_hacking.xml: Use tools from Autoconf
	2.64 and Automake 1.11 in examples; update link to Autoconf
	manual page about quadrigraphs.
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

libssp/:
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

boehm-gc/:
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

libmudflap/:
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

zlib/:
	* Makefile.am (install-html, install-pdf, html): Remove.
	* Makefile.in: Regenerate.

libffi/:
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

libgomp/:
	* Makefile.am (install-html, install-pdf): Remove.
	* Makefile.in: Regenerate.

From-SVN: r151015
2009-08-22 13:41:50 +00:00
Ralf Wildenhues 5213506e24 Regenerate tree using Autoconf 2.64 and Automake 1.11.
config/:
	* override.m4 (_GCC_AUTOCONF_VERSION): Bump to 2.64.

:
	* configure: Regenerate.

intl/:
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* config.h.in: Regenerate.

libiberty/:
	* config.in: Regenerate.
	* configure: Regenerate.

boehm-gc/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* include/gc_config.h.in: Regenerate.

fixincludes/:
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* config.h.in: Regenerate.

gcc/:
	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.

libgcc/:
	* configure: Regenerate.

gnattools/:
	* configure: Regenerate.

libada/:
	* configure: Regenerate.

libcpp/:
	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.

libdecnumber/:
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* config.in: Regenerate.

libffi/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* fficonfig.h.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgfortran/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.

libgomp/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libjava/classpath/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* doc/api/Makefile.in: Regenerate.
	* examples/Makefile.in: Regenerate.
	* external/Makefile.in: Regenerate.
	* external/jsr166/Makefile.in: Regenerate.
	* external/relaxngDatatype/Makefile.in: Regenerate.
	* external/sax/Makefile.in: Regenerate.
	* external/w3c_dom/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* include/config.h.in: Regenerate.
	* lib/Makefile.in: Regenerate.
	* native/Makefile.in: Regenerate.
	* native/fdlibm/Makefile.in: Regenerate.
	* native/jawt/Makefile.in: Regenerate.
	* native/jni/Makefile.in: Regenerate.
	* native/jni/classpath/Makefile.in: Regenerate.
	* native/jni/gconf-peer/Makefile.in: Regenerate.
	* native/jni/gstreamer-peer/Makefile.in: Regenerate.
	* native/jni/gtk-peer/Makefile.in: Regenerate.
	* native/jni/java-io/Makefile.in: Regenerate.
	* native/jni/java-lang/Makefile.in: Regenerate.
	* native/jni/java-math/Makefile.in: Regenerate.
	* native/jni/java-net/Makefile.in: Regenerate.
	* native/jni/java-nio/Makefile.in: Regenerate.
	* native/jni/java-util/Makefile.in: Regenerate.
	* native/jni/midi-alsa/Makefile.in: Regenerate.
	* native/jni/midi-dssi/Makefile.in: Regenerate.
	* native/jni/native-lib/Makefile.in: Regenerate.
	* native/jni/qt-peer/Makefile.in: Regenerate.
	* native/jni/xmlj/Makefile.in: Regenerate.
	* native/plugin/Makefile.in: Regenerate.
	* resource/Makefile.in: Regenerate.
	* scripts/Makefile.in: Regenerate.
	* tools/Makefile.in: Regenerate.

libjava/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* include/config.h.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libjava/libltdl/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config-h.in: Regenerate.
	* configure: Regenerate.

libmudflap/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libobjc/:
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* config.h.in: Regenerate.

libssp/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.

libstdc++-v3/:
	* Makefile.in: Regenerate.
	* acinclude.m4: Regenerate.
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

zlib/:
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

From-SVN: r151014
2009-08-22 13:22:20 +00:00
Ralf Wildenhues 84fec8a537 LIBTOOLFLAGS, and *_LINK fixes for Automake 1.11
boehm-gc/:
	* Makefile.am (LTCOMPILE, LTLINK): Add $(AM_LIBTOOLFLAGS)
	and $(LIBTOOLFLAGS).
	* Makefile.in: Regenerate.

libgfortran/:
	* Makefile.am (libgfortran_la_LINK): Add $(libgfortran_la_LDFLAGS).
	* Makefile.in: Regenerate.

libjava/:
	* Makefile.am (libgcj_la_LINK, libgcj_tools_la_LINK)
	(lib_gnu_awt_xlib_la_LINK, libgcj_bc_la_LINK, jv_convert_LINK)
	(gcj_dbtool_LINK, gc_analyze_LINK, gij_LINK, ecjx_LINK)
	(gappletviewer_LINK, gjarsigner_LINK, gkeytool_LINK)
	(gjar_LINK, gjavah_LINK, gcjh_LINK, gnative2ascii_LINK)
	(gorbd_LINK, grmid_LINK, gserialver_LINK, gtnameserv_LINK)
	(grmic_LINK, grmiregistry_LINK, gjdoc_LINK): Add $(gjdoc_LDFLAGS).
	(GCJLINK, LIBLINK, CXXLINK): Add $(LIBTOOLFLAGS).
	* Makefile.in: Regenerate.

libstdc++-v3/:
	* libsupc++/Makefile.am (LTCOMPILE, LTCXXCOMPILE, CXXLINK): Add
	$(LIBTOOLFLAGS).
	* libsupc++/Makefile.in: Regenerate.
	* src/Makefile.am (LTCXXCOMPILE, CXXLINK): Add $(AM_LIBTOOLFLAGS)
	and $(LIBTOOLFLAGS).
	* src/Makefile.in: Regenerate.

libgomp/:
	* Makefile.am (LINK): Add $(AM_LIBTOOLFLAGS) and $(LIBTOOLFLAGS).
	* Makefile.in: Regenerate.

libobjc/:
	* Makefile.in (LIBTOOL): Add $(LIBTOOLFLAGS).

From-SVN: r151013
2009-08-22 12:43:24 +00:00
Thomas Koenig 41e5ee68bc re PR fortran/40962 (Conversion problem for f-allocatable -> cptr -> fptr -> f-allocatable)
2009-08-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/40962
	* iso_c_binding.c (c_f_pointer_u0):  Multiply stride by
	previous stride.

2009-08-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/40962
	* c_f_pointer_tests_4.f90:  New test.

From-SVN: r150974
2009-08-20 20:16:15 +00:00
Dave Korn 197c68cc97 Makefile.am (libgomp_la_LDFLAGS): Add -bindir flag.
libgomp/ChangeLog:

	* Makefile.am (libgomp_la_LDFLAGS): Add -bindir flag.
	* Makefile.in: Regenerate.

ChangeLog:

	* ltmain.sh (func_normal_abspath): New function.
	(func_relative_path): Likewise.
	(func_mode_help): Document new -bindir option for link mode.
	(func_mode_link): Add new -bindir option, and use it to place
	output DLL if specified.

libgfortran/ChangeLog:

	* Makefile.am (LTLDFLAGS): Add -bindir flag.
	* Makefile.in: Regenerate.

libssp/ChangeLog:

	* Makefile.am (libssp_la_LDFLAGS): Add -bindir flag.
	* Makefile.in: Regenerate.

libjava/libltdl/ChangeLog:

	* Makefile.am (libltdl_la_LDFLAGS): Add -bindir flag.
	* Makefile.in: Regenerate.

libjava/classpath/ChangeLog:

	* ltmain.sh (func_normal_abspath): New function.
	(func_relative_path): Likewise.
	(func_mode_help): Document new -bindir option for link mode.
	(func_mode_link): Add new -bindir option, and use it to place
	output DLL if specified.

From-SVN: r150960
2009-08-20 11:11:34 +00:00
Jerry DeLisle e2cec2c358 re PR fortran/41075 ([F2008] Implement unlimited format item)
2009-08-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/41075
	* io/io.h (enum format_token): Add FMT_STAR.
	* io/format.c (format_lex): Add case for FMT_STAR.
	(parse_format_list): Parse FMT_STAR and check for left paren
	after. (next_format0): Modify helper function to check for
	unimited format and return the repeated format node.  Update
	comments to clarify.

From-SVN: r150844
2009-08-17 14:27:29 +00:00
Jerry DeLisle 37d1bbbc62 re PR libfortran/32784 ([win32] Using 'CONOUT$', 'CONIN$', or 'CONERR$' as assigned file generates Fortran runtime error: Bad file descriptor)
2009-08-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/32784
	io/unix.c (regular_file): Add support for CONIO on mingw.

From-SVN: r150779
2009-08-14 21:10:06 +00:00
Kai Tietz 9d3458531a string_intrinsics_inc.c (string_len_trim): Use __INTPTR_TYPE__ to cast from pointer to scalar integer...
2009-08-15  Kai Tietz  <kai.tietz@onevision.com>

        * intrinsics/string_intrinsics_inc.c (string_len_trim): Use
        __INTPTR_TYPE__ to cast from pointer to scalar integer, if
        __INTPTR_TYPE is defined.

From-SVN: r150774
2009-08-14 21:30:13 +02:00
Janne Blomqvist 0942c722b3 Add comment saying file is deprecated
From-SVN: r150767
2009-08-14 20:54:27 +03:00
Janne Blomqvist 20e0d7f89b PR libfortran/40863 Fix r150107 moving new symbols to C99_1.1 node
From-SVN: r150765
2009-08-14 20:44:50 +03:00
Francois-Xavier Coudert 0a940ddd90 re PR libfortran/40549 (Building libgfortran as a DLL)
PR libfortran/40549
	* Makefile.in (LTLDFLAGS): Add -no-undefined.
	* Makefile.am: Regenerate.
	* libgfortran.h: Remove unused block of code.

From-SVN: r150590
2009-08-09 11:02:08 +00:00
Jerry DeLisle ba286d5696 re PR fortran/40853 (I/O: Namelist read error)
2009-08-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40853
	* io/list_read.c (nml_get_obj_data): Do not set nl
	pointer to first_nl if nl->next is NULL.

From-SVN: r150356
2009-08-02 18:31:07 +00:00
Kaz Kojima 3ce1cf6943 Makefile.am: Don't set SECTION_FLAGS with @SECTION_FLAGS@.
* Makefile.am: Don't set SECTION_FLAGS with @SECTION_FLAGS@.
	Don't set IEEE_FLAGS with @IEEE_FLAGS@.
	* Makefile.in: Regenerate.

From-SVN: r150313
2009-07-31 12:29:33 +00:00
Kaz Kojima 9fc7757408 configure.host: Define ieee_flags and set it to -mieee for sh.
* configure.host: Define ieee_flags and set it to -mieee for sh.
	* configure.ac: Set IEEE_FLAGS with ieee_flags.
	* Makefile.am: Add IEEE_FLAGS to AM_CFLAGS.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

From-SVN: r150280
2009-07-30 22:56:08 +00:00
Ralf Wildenhues 1b3b24c2a6 extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Do not expand for Autoconf 2.62 or newer.
config/
	* extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Do not expand
	for Autoconf 2.62 or newer.
	* tls.m4 (GCC_CHECK_TLS): Fix m4 quotation.
	* no-executables.m4 (_AC_COMPILER_EXEEXT): Fix m4 quotation.
	* override.m4 (m4_copy_force, m4_rename_force): Provide
	macros if not defined.
	(AC_PREREQ): Use m4_copy_force.

boehm-gc/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libada/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libffi/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libgfortran/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libgomp/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libjava/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libmudflap/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libobjc/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libssp/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

zlib/
	* configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.

libstdc++-v3/
	* acinclude.m4 (GLIBCXX_CONFIGURE): Use m4_rename_force.

From-SVN: r150269
2009-07-30 19:41:13 +00:00
Tobias Burnus d08d49885a re PR libfortran/40863 (Build failure in libgfortran)
2009-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40863
        * c99_functions.c: Define complex I, if not defined.
        Create prototypes for C99 functions to silence warnings.
        * gfortran.map: Add missing functions to GFORTRAN_C99_1.0
        and new GFORTRAN_C99_1.1.

From-SVN: r150107
2009-07-27 11:24:41 +02:00
Tobias Burnus 504ed63a1a re PR fortran/33197 (Fortran 2008: math functions)
2009-07-25  Tobias Burnus  <burnus@net-b.de>
            Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

        PR fortran/33197
        * intrinsic.c (add_functions): Support complex arguments for
        acos,acosh,asin,asinh,atan,atanh.
        * invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
        complex arguments.
        * simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
        gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
        gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
        gfc_simplify_acosh,gfc_simplify_atanh): Support
        complex arguments.

2009-07-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * intrinsics/c99_functions.c (cacosf,cacos,cacosl,casinf,
        casin,casind,catanf,catan,catanl,cacoshf,cacosh,cacoshl,
        casinhf,casinh,casinhf,catanhf,catanh,catanhl): New functions.
        * c99_protos.h: Add prototypes for those.

2009-07-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * gfortran.dg/complex_intrinsic_5.f90: New test.
        * gfortran.dg/complex_intrinsic_7.f90: New test.


Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>

From-SVN: r150087
2009-07-25 21:39:07 +02:00
Jakub Jelinek 80927a562e re PR fortran/40643 (maxloc/minloc: Wrong result for NaN at position 1)
PR fortran/40643
	PR fortran/31067
	* trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc,
	gfc_conv_intrinsic_minmaxval): Handle Infinities and NaNs properly,
	optimize.
	* trans-array.c (gfc_trans_scalarized_loop_end): No longer static.
	* trans-array.h (gfc_trans_scalarized_loop_end): New prototype.

	* libgfortran.h (GFC_REAL_4_INFINITY, GFC_REAL_8_INFINITY,
	GFC_REAL_10_INFINITY, GFC_REAL_16_INFINITY, GFC_REAL_4_QUIET_NAN,
	GFC_REAL_8_QUIET_NAN, GFC_REAL_10_QUIET_NAN, GFC_REAL_16_QUIET_NAN):
	Define.
	* m4/iparm.m4 (atype_inf, atype_nan): Define.
	* m4/ifunction.m4: Formatting.
	* m4/iforeach.m4: Likewise.
	(START_FOREACH_FUNCTION): Initialize dest to all 1s, not all 0s.
	(START_FOREACH_BLOCK, FINISH_FOREACH_FUNCTION,
	FINISH_MASKED_FOREACH_FUNCTION): Run foreach block inside a loop
	until count[0] == extent[0].
	* m4/minval.m4: Formatting.  Handle NaNs and infinities.  Optimize.
	* m4/maxval.m4: Likewise.
	* m4/minloc0.m4: Likewise.
	* m4/maxloc0.m4: Likewise.
	* m4/minloc1.m4: Likewise.
	* m4/maxloc1.m4: Likewise.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i1.c: Likewise.
	* generated/maxloc0_16_i2.c: Likewise.
	* generated/maxloc0_16_i4.c: Likewise.
	* generated/maxloc0_16_i8.c: Likewise.
	* generated/maxloc0_16_r10.c: Likewise.
	* generated/maxloc0_16_r16.c: Likewise.
	* generated/maxloc0_16_r4.c: Likewise.
	* generated/maxloc0_16_r8.c: Likewise.
	* generated/maxloc0_4_i16.c: Likewise.
	* generated/maxloc0_4_i1.c: Likewise.
	* generated/maxloc0_4_i2.c: Likewise.
	* generated/maxloc0_4_i4.c: Likewise.
	* generated/maxloc0_4_i8.c: Likewise.
	* generated/maxloc0_4_r10.c: Likewise.
	* generated/maxloc0_4_r16.c: Likewise.
	* generated/maxloc0_4_r4.c: Likewise.
	* generated/maxloc0_4_r8.c: Likewise.
	* generated/maxloc0_8_i16.c: Likewise.
	* generated/maxloc0_8_i1.c: Likewise.
	* generated/maxloc0_8_i2.c: Likewise.
	* generated/maxloc0_8_i4.c: Likewise.
	* generated/maxloc0_8_i8.c: Likewise.
	* generated/maxloc0_8_r10.c: Likewise.
	* generated/maxloc0_8_r16.c: Likewise.
	* generated/maxloc0_8_r4.c: Likewise.
	* generated/maxloc0_8_r8.c: Likewise.
	* generated/maxloc1_16_i16.c: Likewise.
	* generated/maxloc1_16_i1.c: Likewise.
	* generated/maxloc1_16_i2.c: Likewise.
	* generated/maxloc1_16_i4.c: Likewise.
	* generated/maxloc1_16_i8.c: Likewise.
	* generated/maxloc1_16_r10.c: Likewise.
	* generated/maxloc1_16_r16.c: Likewise.
	* generated/maxloc1_16_r4.c: Likewise.
	* generated/maxloc1_16_r8.c: Likewise.
	* generated/maxloc1_4_i16.c: Likewise.
	* generated/maxloc1_4_i1.c: Likewise.
	* generated/maxloc1_4_i2.c: Likewise.
	* generated/maxloc1_4_i4.c: Likewise.
	* generated/maxloc1_4_i8.c: Likewise.
	* generated/maxloc1_4_r10.c: Likewise.
	* generated/maxloc1_4_r16.c: Likewise.
	* generated/maxloc1_4_r4.c: Likewise.
	* generated/maxloc1_4_r8.c: Likewise.
	* generated/maxloc1_8_i16.c: Likewise.
	* generated/maxloc1_8_i1.c: Likewise.
	* generated/maxloc1_8_i2.c: Likewise.
	* generated/maxloc1_8_i4.c: Likewise.
	* generated/maxloc1_8_i8.c: Likewise.
	* generated/maxloc1_8_r10.c: Likewise.
	* generated/maxloc1_8_r16.c: Likewise.
	* generated/maxloc1_8_r4.c: Likewise.
	* generated/maxloc1_8_r8.c: Likewise.
	* generated/maxval_i16.c: Likewise.
	* generated/maxval_i1.c: Likewise.
	* generated/maxval_i2.c: Likewise.
	* generated/maxval_i4.c: Likewise.
	* generated/maxval_i8.c: Likewise.
	* generated/maxval_r10.c: Likewise.
	* generated/maxval_r16.c: Likewise.
	* generated/maxval_r4.c: Likewise.
	* generated/maxval_r8.c: Likewise.
	* generated/minloc0_16_i16.c: Likewise.
	* generated/minloc0_16_i1.c: Likewise.
	* generated/minloc0_16_i2.c: Likewise.
	* generated/minloc0_16_i4.c: Likewise.
	* generated/minloc0_16_i8.c: Likewise.
	* generated/minloc0_16_r10.c: Likewise.
	* generated/minloc0_16_r16.c: Likewise.
	* generated/minloc0_16_r4.c: Likewise.
	* generated/minloc0_16_r8.c: Likewise.
	* generated/minloc0_4_i16.c: Likewise.
	* generated/minloc0_4_i1.c: Likewise.
	* generated/minloc0_4_i2.c: Likewise.
	* generated/minloc0_4_i4.c: Likewise.
	* generated/minloc0_4_i8.c: Likewise.
	* generated/minloc0_4_r10.c: Likewise.
	* generated/minloc0_4_r16.c: Likewise.
	* generated/minloc0_4_r4.c: Likewise.
	* generated/minloc0_4_r8.c: Likewise.
	* generated/minloc0_8_i16.c: Likewise.
	* generated/minloc0_8_i1.c: Likewise.
	* generated/minloc0_8_i2.c: Likewise.
	* generated/minloc0_8_i4.c: Likewise.
	* generated/minloc0_8_i8.c: Likewise.
	* generated/minloc0_8_r10.c: Likewise.
	* generated/minloc0_8_r16.c: Likewise.
	* generated/minloc0_8_r4.c: Likewise.
	* generated/minloc0_8_r8.c: Likewise.
	* generated/minloc1_16_i16.c: Likewise.
	* generated/minloc1_16_i1.c: Likewise.
	* generated/minloc1_16_i2.c: Likewise.
	* generated/minloc1_16_i4.c: Likewise.
	* generated/minloc1_16_i8.c: Likewise.
	* generated/minloc1_16_r10.c: Likewise.
	* generated/minloc1_16_r16.c: Likewise.
	* generated/minloc1_16_r4.c: Likewise.
	* generated/minloc1_16_r8.c: Likewise.
	* generated/minloc1_4_i16.c: Likewise.
	* generated/minloc1_4_i1.c: Likewise.
	* generated/minloc1_4_i2.c: Likewise.
	* generated/minloc1_4_i4.c: Likewise.
	* generated/minloc1_4_i8.c: Likewise.
	* generated/minloc1_4_r10.c: Likewise.
	* generated/minloc1_4_r16.c: Likewise.
	* generated/minloc1_4_r4.c: Likewise.
	* generated/minloc1_4_r8.c: Likewise.
	* generated/minloc1_8_i16.c: Likewise.
	* generated/minloc1_8_i1.c: Likewise.
	* generated/minloc1_8_i2.c: Likewise.
	* generated/minloc1_8_i4.c: Likewise.
	* generated/minloc1_8_i8.c: Likewise.
	* generated/minloc1_8_r10.c: Likewise.
	* generated/minloc1_8_r16.c: Likewise.
	* generated/minloc1_8_r4.c: Likewise.
	* generated/minloc1_8_r8.c: Likewise.
	* generated/minval_i16.c: Likewise.
	* generated/minval_i1.c: Likewise.
	* generated/minval_i2.c: Likewise.
	* generated/minval_i4.c: Likewise.
	* generated/minval_i8.c: Likewise.
	* generated/minval_r10.c: Likewise.
	* generated/minval_r16.c: Likewise.
	* generated/minval_r4.c: Likewise.
	* generated/minval_r8.c: Likewise.
	* generated/product_c10.c: Likewise.
	* generated/product_c16.c: Likewise.
	* generated/product_c4.c: Likewise.
	* generated/product_c8.c: Likewise.
	* generated/product_i16.c: Likewise.
	* generated/product_i1.c: Likewise.
	* generated/product_i2.c: Likewise.
	* generated/product_i4.c: Likewise.
	* generated/product_i8.c: Likewise.
	* generated/product_r10.c: Likewise.
	* generated/product_r16.c: Likewise.
	* generated/product_r4.c: Likewise.
	* generated/product_r8.c: Likewise.
	* generated/sum_c10.c: Likewise.
	* generated/sum_c16.c: Likewise.
	* generated/sum_c4.c: Likewise.
	* generated/sum_c8.c: Likewise.
	* generated/sum_i16.c: Likewise.
	* generated/sum_i1.c: Likewise.
	* generated/sum_i2.c: Likewise.
	* generated/sum_i4.c: Likewise.
	* generated/sum_i8.c: Likewise.
	* generated/sum_r10.c: Likewise.
	* generated/sum_r16.c: Likewise.
	* generated/sum_r4.c: Likewise.
	* generated/sum_r8.c: Likewise.

	* gfortran.dg/maxlocval_2.f90: New test.
	* gfortran.dg/maxlocval_3.f90: New test.
	* gfortran.dg/maxlocval_4.f90: New test.
	* gfortran.dg/minlocval_1.f90: New test.
	* gfortran.dg/minlocval_2.f90: New test.
	* gfortran.dg/minlocval_3.f90: New test.
	* gfortran.dg/minlocval_4.f90: New test.

From-SVN: r150041
2009-07-24 09:57:13 +02:00
Jerry DeLisle d8771b59b7 re PR libfortran/32784 ([win32] Using 'CONOUT$', 'CONIN$', or 'CONERR$' as assigned file generates Fortran runtime error: Bad file descriptor)
2009-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/32784
	* unix.c (regular_file): Check for CONIN$ CONOUT$, and CONERR$ and open
	the respective /dev/conin or /dev/conout devices.  This is Cygwin
	specific.

From-SVN: r149970
2009-07-23 00:58:46 +00:00
Thomas Koenig 16bff92192 [multiple changes]
2009-07-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	PR libfortran/36874
	* Makefile.am:  Add bounds.c
	* libgfortran.h (bounds_equal_extents):  Add prototype.
	(bounds_iforeach_return):  Likewise.
	(bounds_ifunction_return):  Likewise.
	(bounds_reduced_extents):  Likewise.
	* runtime/bounds.c:  New file.
	(bounds_iforeach_return):  New function; correct typo in
	error message.
	(bounds_ifunction_return):  New function.
	(bounds_equal_extents):  New function.
	(bounds_reduced_extents):  Likewise.
	* intrinsics/cshift0.c (cshift0):  Use new functions
	for bounds checking.
	* intrinsics/eoshift0.c (eoshift0):  Likewise.
	* intrinsics/eoshift2.c (eoshift2):  Likewise.
	* m4/iforeach.m4:  Likewise.
	* m4/eoshift1.m4:  Likewise.
	* m4/eoshift3.m4:  Likewise.
	* m4/cshift1.m4:  Likewise.
	* m4/ifunction.m4:  Likewise.
	* Makefile.in:  Regenerated.
	* generated/cshift1_16.c: Regenerated.
	* generated/cshift1_4.c: Regenerated.
	* generated/cshift1_8.c: Regenerated.
	* generated/eoshift1_16.c: Regenerated.
	* generated/eoshift1_4.c: Regenerated.
	* generated/eoshift1_8.c: Regenerated.
	* generated/eoshift3_16.c: Regenerated.
	* generated/eoshift3_4.c: Regenerated.
	* generated/eoshift3_8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

2009-07-19   Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	PR libfortran/36874
	* gfortran.dg/cshift_bounds_1.f90:  New test.
	* gfortran.dg/cshift_bounds_2.f90:  New test.
	* gfortran.dg/cshift_bounds_3.f90:  New test.
	* gfortran.dg/cshift_bounds_4.f90:  New test.
	* gfortran.dg/eoshift_bounds_1.f90:  New test.
	* gfortran.dg/maxloc_bounds_4.f90:  Correct typo in error message.
	* gfortran.dg/maxloc_bounds_5.f90:  Correct typo in error message.
	* gfortran.dg/maxloc_bounds_7.f90:  Correct typo in error message.

From-SVN: r149792
2009-07-19 15:07:21 +00:00
Janne Blomqvist 217c4f5393 When finalizing I/O transfer, set current_record to 0 before returning.
PR libfortran/40714

Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org>

From-SVN: r149757
2009-07-17 22:40:23 +03:00
Tobias Burnus ffa61a5ee8 re PR fortran/40588 (Small bug in match_charkind_name)
2009-07-12  Tobias Burnus  <burnus@net-b.de>
            Philippe Marguinaud <philippe.marguinaud@meteo.fr>

        PR fortran/40588
        * primary.c (match_charkind_name): Fix condition for $ matching.

        PR libfortran/22423
        * libgfortran.h: Typedef the GFC_DTYPE_* enum.

2009-07-12  Tobias Burnus  <burnus@net-b.de>

        PR libfortran/22423
        * io/io.h (namelist_type): Use the proper enum for GFC_DTYPE_*.
        * intrinsics/iso_c_binding.c (c_f_pointer_u0): Make sure
        variable is initialized to silence warning.


Co-Authored-By: Philippe Marguinaud <philippe.marguinaud@meteo.fr>

From-SVN: r149545
2009-07-13 08:26:38 +02:00
Steven G. Kargl 5bde96d27e c99_functions.c (ccoshf, [...]): Fix errant minus.
2009-07-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	* c99_functions.c (ccoshf, ccosh, ccoshl, ctanhf, ctanh, ctanl):
	Fix errant minus.

From-SVN: r149479
2009-07-10 15:25:31 +00:00
Jerry DeLisle 2418d0e0e6 re PR libfortran/40330 (incorrect IO)
2009-07-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40330
	PR libfortran/40662
	* io/io.h (st_parameter_dt): Define format_not_saved bit used to signal
	whether the parsed format data was previously saved. Used to determine
	if the current format data should be freed or not.
	* io/transfer.c (st_read_done): Use the format_not_saved bit.
	(st_write_done): Likewise.
	* io/format.c (parse_format_list): Add boolean pointer to arg list. This
	pointer is used to return status to the caller regarding whether it is
	safe to cache the parsed format data.  Currently, if a FMT_STRING token
	is encounetered, it is not safe to cache. Also, added a local boolean
	variable to hold this information as recursive calls to
	parse_format_list are made.  Remove previous save_format logic.
	(parse_format): Do not use the format caching facility if the current
	unit is an internal unit or if it is not safe to save parsed format
	data.

From-SVN: r149398
2009-07-09 01:20:23 +00:00
Jerry DeLisle 93ab3a3d79 re PR fortran/40576 (Endless loop in internal write)
2009-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40576
	* io/transfer.c (sset): Adjust exit condition for loop.

From-SVN: r149075
2009-06-30 00:46:35 +00:00
Jerry DeLisle 2fc61b4b32 Delete bad entry.
From-SVN: r148826
2009-06-23 00:17:06 +00:00
Jerry DeLisle 573cbcb9c6 re PR fortran/40508 (memory leak in internal write of gfortran)
2009-06-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40508
	* io/format.c: Don't save parsed format data for internal units.

From-SVN: r148823
2009-06-23 00:16:24 +00:00
Thomas Koenig dfb55fdcdb re PR fortran/37577 ([meta-bug] change internal array descriptor format for better syntax, C interop TR, rank 15)
2009-06-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37577
	Port from fortran-dev
	* runtime/in_pack_generic (internal_pack):  Remove unnecessary
	test for stride == 0.
	* runtime/in_unpack_generic.c (internal_unpack):  Likewise.
	* intrinsics/iso_c_binding.c (c_f_pointer_u0):  Take care
	of stride in "shape" argument.  Use array access macros for
	accessing array descriptors.
	* libgfortran.h (struct descriptor_dimension):  Change stride
	to _stride, lbound to _lbound and ubound to _ubound.
	(GFC_DIMENSION_LBOUND):  Use new name(s) in struct
	descriptor_dimension.
	(GFC_DIMENSION_UBOUND):  Likewise.
	(GFC_DIMENSION_STRIDE):  Likewise.
	(GFC_DIMENSION_EXTENT):  Likewise.
	(GFC_DIMENSION_SET):  Likewise.
	(GFC_DESCRIPTOR_LBOUND):  Likewise.
	(GFC_DESCRIPTOR_UBOUND):  Likewise.
	(GFC_DESCRIPTOR_EXTENT):  Likewise.
	(GFC_DESCRIPTOR_STRIDE):  Likewise.
	* io/transfer.c (transfer_array):  Use array access macros.
	Use byte-sized strides.
	* intrinsics/eoshift0.c (eoshift0):  Use array access
	macros everywhere.
	* m4/in_pack.m4 (internal_pack_'rtype_ccode`):  Use
	array access macros for accessing array descriptors.
	* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`):
	Likewise.
	* m4/matmull.m4 (matmul_'rtype_code`):  Likewise.
	* m4/matmul.m4 (matmul_'rtype_code`):  Likewise.
	* m4/unpack.m4 (unpack0_'rtype_code`):  Likewise.
	(unpack1_'rtype_code`):  Likewise.
	* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Likewise.
	* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Use array access
	macros everywhere.
		* intrinsics/dtime.c (dtime_sub):  Use array access macros
	for accessing array descriptors.
	* intrinsics/cshift0 (cshift0):  Likewise.
	* intrinsics/etime.c:  Likewise.  Remove redundant calculation
	of rdim.
	* m4/cshift0.m4 (cshift0_'rtype_code`):  Use array access macros
	for accessing array descriptors.
	* m4/pack.m4 (pack_'rtype_code`):  Likewise.
	* m4/spread.m4 (spread_'rtype_code`):  Likewise.
	(spread_scalar_'rtype_code`):  Likewise.
	* m4/transpose.m4 (transpose_'rtype_code`):  Likewise.
	* m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Likewise.
	* m4/eoshift1.m4 (eoshift1):  Likewise.  Remove size argument,
	calculate within function.
	(eoshift1_'atype_kind`):  Remove size argument from call
	to eoshift1.
	(eoshift1_'atype_kind`_char):  Likewise.
	(eoshift1_'atype_kind`_char4):  Likewise.
	* m4/eoshift3.m4 (eoshift3):  Remove size argument, calculate
	within function. Use array access macros for accessing array
	descriptors.
	(eoshift3_'atype_kind`):  Remove size argument from call
	to eoshift1.
	(eoshift3_'atype_kind`_char):  Likewise.
	(eoshift3_'atype_kind`_char4):  Likewise.
	* m4/shape.m4 (shape_'rtype_kind`):  Use array access macros
	for accessing array descriptors.
	* m4/cshift1.m4 (cshift1): Remove size argument, calculate
	within function. Use array access macros for accessing array
	descriptors.
	(cshift1_'atype_kind`):  Remove size argument from call to
	cshift1.
	(cshift1_'atype_kind`_char):  Remove size argument from call to
	cshift1.
	(cshift1_'atype_kind`_char4):  Remove size argument from call to
	cshift1.
	* m4/reshape.m4 (reshape_'rtype_ccode`):  Use array access macros
	for accessing array descriptors.
	* m4/ifunction.m4 (name`'rtype_qual`_'atype_code):  Likewise.
	* intrinsics/pack_generic.c (pack_internal):  Use array access
	macros for accessing array descriptors.
	(pack_s_internal):  Likewise.
	* intrinsics/transpose_generic.c (transpose_internal):  Remove
	size argument, calculate from array descriptor. Use array
	access macros for accessing array descriptors.
	(transpose):  Remove size argument from call.
	(transpoe_char):  Likewise.
	(transpose_char4):  Likewise.
	* intrinsics/move_alloc.c (move_alloc):  Use array access macros
	for accessing array descriptors.
	* intrinsics/spread_generic.c (spread_internal):  Remove size
	argument, calculate from array descriptor.  Use array access
	macros for accessing array descriptors.
	(spread_internal_scalar):  Likewise.
	(spread):  Remove size argument from call to spread_internal.
	(spread_char):  Mark argument source_length as unused.
	Remove size argument from call to spread_internal.
	(spread_char4):  Likewise.
	(spread_char_scalar):  Likewise.
	(spread_char4_scalar):  Likewise.
	* intrinsics/unpack_generic.c (unpack_internal):  Use array access
	macros for accessing array descriptors.
	* intrinsics/eoshift2.c (eoshift2):  Remove size argument, calculate
	from array descriptor instead.  Use array access macros for
	accessing array descriptors.
	(eoshift2_##N):  Remove size argument from call to eoshift2.
	(eoshift2_##N_##char):  Likewise.
	(eoshift2_##N_##char4):  Likewise.
	* intrinsics/reshape_generic.c (reshape_internal):  Use array
	access macross for accessing array descriptors.
	* libgfortran.h:  Introduce new macros GFC_DIMENSION_LBOUND,
	GFC_DIMENSION_UBOUND,GFC_DIMENSION_STRIDE, GFC_DIMENSION_EXTENT,
	GFC_DIMENSION_SET, GFC_DESCRIPTOR_LBOUND, GFC_DESCRIPTOR_UBOUND,
	GFC_DESCRIPTOR_EXTENT, GFC_DESCRIPTOR_EXTENT_BYTES,
	GFC_DESCRIPTOR_STRIDE, GFC_DESCRIPTOR_STRIDE_BYTES
	* runtime/in_pack_generic.c (internal_pack):  Use new macros
	for array descriptor access.
	* runtime/in_unpack_generic.c (internal_unpack):  Likewise.
	* intrinsics/dtime.c (dtime_sub):  Likewise.
	* intrinsics/cshift0 (cshift0):  Remove argument size,
	calculate directly from the array descriptor.  Use new macros
	for array descriptor access.
	* cshift0_##N:  Remove shift argument in call to cshift0.
	* cshift0_##N_char:  Mark array_length as unused.  Remove
	array_length in call to cshift0.
	* cshift0_##N_char4:  Likewise.
	* intrisics/etime.c:  Use new macros for array descriptor access.
	* intrinsics/stat.c (stat_i4_sub_0):  Likewise.
	(stat_i8_sub_0):  Likewise.
	(fstat_i4_sub):  Likewise.
	(fstat_i8_sub):  Likewise.
	* intrinsics/date_and_time.c (date_and_time):  Likewise.
	(secnds):  Likewise.
	(itime_i4):  Likewise.
	(itime_i8):  Likewise.
	(idate_i4):  Likewise.
	(idate_i8):  Likewise.
	(gmtime_i4):  Likewise.
	(gmtime_i8):  Likewise.
	(ltime_i4):  Likewise.
	(litme_i8):  Likewise.
	* intrinsics/associated.c (associated):  Likewise.
	* intrinsics/eoshift0.c (eoshift0):  Likewise.
	* intriniscs/size.c (size0):  Likewise.
	* intrinsics/random.c (arandom_r4):  Likewise.
	(arandom_r8):  Likewise.
	(arandom_r10):  Likewise.
	(arandom_r16):  Likewise.
	(random_seed_i4):  Likewise.
	(random_seed_i8):  Likewise.
	* io/list_read.c (nml_parse_qualifier):  Likewise.
	(nml_touch_nodes):  Likewise.
	(nml_read_obj):  Likewise.
	(get_name):  Likewise.
	* io/transfer.c (transfer_array):  Likewise.
	(init_loop_spec):  Likewise.
	(st_set_nml_var_dim):  Likewise.
	* io/write.c (nml_write_obj):  Likewise.
	(obj_loop):  Likewise.
	* generated/all_l1.c: Regenerated.
	* generated/all_l16.c: Regenerated.
	* generated/all_l2.c: Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/any_l1.c: Regenerated.
	* generated/any_l16.c: Regenerated.
	* generated/any_l2.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/count_16_l.c: Regenerated.
	* generated/count_1_l.c: Regenerated.
	* generated/count_2_l.c: Regenerated.
	* generated/count_4_l.c: Regenerated.
	* generated/count_8_l.c: Regenerated.
	* generated/cshift0_c10.c: Regenerated.
	* generated/cshift0_c16.c: Regenerated.
	* generated/cshift0_c4.c: Regenerated.
	* generated/cshift0_c8.c: Regenerated.
	* generated/cshift0_i1.c: Regenerated.
	* generated/cshift0_i16.c: Regenerated.
	* generated/cshift0_i2.c: Regenerated.
	* generated/cshift0_i4.c: Regenerated.
	* generated/cshift0_i8.c: Regenerated.
	* generated/cshift0_r10.c: Regenerated.
	* generated/cshift0_r16.c: Regenerated.
	* generated/cshift0_r4.c: Regenerated.
	* generated/cshift0_r8.c: Regenerated.
	* generated/cshift1_16.c: Regenerated.
	* generated/cshift1_4.c: Regenerated.
	* generated/cshift1_8.c: Regenerated.
	* generated/eoshift1_16.c: Regenerated.
	* generated/eoshift1_4.c: Regenerated.
	* generated/eoshift1_8.c: Regenerated.
	* generated/eoshift3_16.c: Regenerated.
	* generated/eoshift3_4.c: Regenerated.
	* generated/eoshift3_8.c: Regenerated.
	* generated/in_pack_c10.c: Regenerated.
	* generated/in_pack_c16.c: Regenerated.
	* generated/in_pack_c4.c: Regenerated.
	* generated/in_pack_c8.c: Regenerated.
	* generated/in_pack_i1.c: Regenerated.
	* generated/in_pack_i16.c: Regenerated.
	* generated/in_pack_i2.c: Regenerated.
	* generated/in_pack_i4.c: Regenerated.
	* generated/in_pack_i8.c: Regenerated.
	* generated/in_pack_r10.c: Regenerated.
	* generated/in_pack_r16.c: Regenerated.
	* generated/in_pack_r4.c: Regenerated.
	* generated/in_pack_r8.c: Regenerated.
	* generated/in_unpack_c10.c: Regenerated.
	* generated/in_unpack_c16.c: Regenerated.
	* generated/in_unpack_c4.c: Regenerated.
	* generated/in_unpack_c8.c: Regenerated.
	* generated/in_unpack_i1.c: Regenerated.
	* generated/in_unpack_i16.c: Regenerated.
	* generated/in_unpack_i2.c: Regenerated.
	* generated/in_unpack_i4.c: Regenerated.
	* generated/in_unpack_i8.c: Regenerated.
	* generated/in_unpack_r10.c: Regenerated.
	* generated/in_unpack_r16.c: Regenerated.
	* generated/in_unpack_r4.c: Regenerated.
	* generated/in_unpack_r8.c: Regenerated.
	* generated/matmul_c10.c: Regenerated.
	* generated/matmul_c16.c: Regenerated.
	* generated/matmul_c4.c: Regenerated.
	* generated/matmul_c8.c: Regenerated.
	* generated/matmul_i1.c: Regenerated.
	* generated/matmul_i16.c: Regenerated.
	* generated/matmul_i2.c: Regenerated.
	* generated/matmul_i4.c: Regenerated.
	* generated/matmul_i8.c: Regenerated.
	* generated/matmul_l16.c: Regenerated.
	* generated/matmul_l4.c: Regenerated.
	* generated/matmul_l8.c: Regenerated.
	* generated/matmul_r10.c: Regenerated.
	* generated/matmul_r16.c: Regenerated.
	* generated/matmul_r4.c: Regenerated.
	* generated/matmul_r8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/pack_c10.c: Regenerated.
	* generated/pack_c16.c: Regenerated.
	* generated/pack_c4.c: Regenerated.
	* generated/pack_c8.c: Regenerated.
	* generated/pack_i1.c: Regenerated.
	* generated/pack_i16.c: Regenerated.
	* generated/pack_i2.c: Regenerated.
	* generated/pack_i4.c: Regenerated.
	* generated/pack_i8.c: Regenerated.
	* generated/pack_r10.c: Regenerated.
	* generated/pack_r16.c: Regenerated.
	* generated/pack_r4.c: Regenerated.
	* generated/pack_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/reshape_c10.c: Regenerated.
	* generated/reshape_c16.c: Regenerated.
	* generated/reshape_c4.c: Regenerated.
	* generated/reshape_c8.c: Regenerated.
	* generated/reshape_i16.c: Regenerated.
	* generated/reshape_i4.c: Regenerated.
	* generated/reshape_i8.c: Regenerated.
	* generated/reshape_r10.c: Regenerated.
	* generated/reshape_r16.c: Regenerated.
	* generated/reshape_r4.c: Regenerated.
	* generated/reshape_r8.c: Regenerated.
	* generated/shape_i16.c: Regenerated.
	* generated/shape_i4.c: Regenerated.
	* generated/shape_i8.c: Regenerated.
	* generated/spread_c10.c: Regenerated.
	* generated/spread_c16.c: Regenerated.
	* generated/spread_c4.c: Regenerated.
	* generated/spread_c8.c: Regenerated.
	* generated/spread_i1.c: Regenerated.
	* generated/spread_i16.c: Regenerated.
	* generated/spread_i2.c: Regenerated.
	* generated/spread_i4.c: Regenerated.
	* generated/spread_i8.c: Regenerated.
	* generated/spread_r10.c: Regenerated.
	* generated/spread_r16.c: Regenerated.
	* generated/spread_r4.c: Regenerated.
	* generated/spread_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.
	* generated/transpose_c10.c: Regenerated.
	* generated/transpose_c16.c: Regenerated.
	* generated/transpose_c4.c: Regenerated.
	* generated/transpose_c8.c: Regenerated.
	* generated/transpose_i16.c: Regenerated.
	* generated/transpose_i4.c: Regenerated.
	* generated/transpose_i8.c: Regenerated.
	* generated/transpose_r10.c: Regenerated.
	* generated/transpose_r16.c: Regenerated.
	* generated/transpose_r4.c: Regenerated.
	* generated/transpose_r8.c: Regenerated.
	* generated/unpack_c10.c: Regenerated.
	* generated/unpack_c16.c: Regenerated.
	* generated/unpack_c4.c: Regenerated.
	* generated/unpack_c8.c: Regenerated.
	* generated/unpack_i1.c: Regenerated.
	* generated/unpack_i16.c: Regenerated.
	* generated/unpack_i2.c: Regenerated.
	* generated/unpack_i4.c: Regenerated.
	* generated/unpack_i8.c: Regenerated.
	* generated/unpack_r10.c: Regenerated.
	* generated/unpack_r16.c: Regenerated.
	* generated/unpack_r4.c: Regenerated.
	* generated/unpack_r8.c: Regenerated.

From-SVN: r148769
2009-06-21 19:24:55 +00:00
Francois-Xavier Coudert fa10ccb275 fmain.c (main): Don't PREFIX set_args.
* fmain.c (main): Don't PREFIX set_args.
        * libgfortran.h (set_args): Use iexport_proto.
        * runtime/main.c (set_args): Use iexport.

From-SVN: r148472
2009-06-14 16:52:49 +00:00
Jerry DeLisle dcfddbd49c re PR fortran/40008 (F2008: Add NEWUNIT= for OPEN statement)
2009-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40008
	* libgfortran.h: Define IOPARM_OPEN_HAS_NEWUNIT.
	* io/open.c (st_open): Don't error on negative unit number if NEWUNIT
	was specified. If NEWUNIT is specified, call new function to get the
	unique unit number and assign it.
	* io/io.h (st_parameter_open): Add pointer to newunit.  Add prototype for
	next_available_newunit. Add prototype for new function,
	get_unique_unit_number.
	* io/unit.c: Declare next_available_newunit. Define the first newunit
	number. (init_units): Initialize next_available_unit.
	(get_unique_unit_number): New function. Fix whitespace and comments.
	* io/transfer.c (data_transfer_init): Update error message to not be
	specific to OPEN statements.

From-SVN: r148253
2009-06-07 19:00:47 +00:00
Jerry DeLisle 690aefeba4 re PR libfortran/40334 (changed BACKSPACE behaviour at end of file.)
2009-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40334
	* io/list_read.c (list_formatted_read_scalar): Set the end file
	conditions after a return from EOF error.

From-SVN: r148251
2009-06-07 17:40:24 +00:00
Janne Blomqvist 0c40d2340a re PR libfortran/40330 (incorrect IO)
PR libfortran/40330

Use heap memory for cached format strings.

From-SVN: r148149
2009-06-04 00:07:19 +03:00
Francois-Xavier Coudert 0a05c536a6 re PR fortran/40019 (LEADZ and TRAILZ give wrong results)
2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

        PR fortran/40019
        * trans-types.c (gfc_build_uint_type): Make nonstatic.
        * trans.h (gfor_fndecl_clz128, gfor_fndecl_ctz128): New
        * prototypes.
        * trans-types.h (gfc_build_uint_type): Add prototype.
        * trans-decl.c (gfc_build_intrinsic_function_decls): Build
        gfor_fndecl_clz128 and gfor_fndecl_ctz128.
        * trans-intrinsic.c (gfc_conv_intrinsic_leadz,
        gfc_conv_intrinsic_trailz): Call the right builtins or library
        functions, and cast arguments to unsigned types first.
        * simplify.c (gfc_simplify_leadz): Deal with negative arguments.

2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

        PR fortran/40019
        * intrinsics/bit_intrinsics.c: New file.
        * gfortran.map (GFORTRAN_1.2): New list.
        * Makefile.am: Add intrinsics/bit_intrinsics.c.
        * Makefile.in: Regenerate.

2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

        PR fortran/40019
        * gfortran.dg/leadz_trailz_1.f90: New test.
        * gfortran.dg/leadz_trailz_2.f90: New test.

From-SVN: r147987
2009-05-29 23:27:54 +02:00
Janne Blomqvist 2017c37012 Fix PR40190; use localtime_r, gmtime_r, add fallback implementations
From-SVN: r147985
2009-05-29 23:56:20 +03:00
Janne Blomqvist c1df0e1ac5 Revert part of r147883 that breaks ABI
From-SVN: r147915
2009-05-27 18:22:34 +03:00
Thomas Koenig 230fa1fc73 re PR libfortran/40187 (c_f_pointer with stride in SHAPE)
2009-05-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/40187
	* intrinsics/iso_c_binding.c (c_f_pointer_u0):  Take care
	of stride in "shape" argument.

2009-05-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/40187
	* gfortran.dg/c_f_pointer_shape_tests_4.f03:  New file.
	* gfortran.dg/c_f_pointer_shape_tests_4_driver.c:  New file.

From-SVN: r147894
2009-05-27 05:27:31 +00:00
Tobias Burnus 092231a8d6 re PR fortran/39178 (Generate main() rather than using a main in libgfortran/fmain.c)
fortran/
2009-05-26  Tobias Burnus  <burnus@net-b.de>

        PR fortran/39178
        * gfortranspec.c (lang_specific_driver): Stop linking
        libgfortranbegin.
        * trans-decl.c (gfc_build_builtin_function_decls): Stop
        making MAIN__ publicly visible.
        (gfc_build_builtin_function_decls): Add
        gfor_fndecl_set_args.
        (create_main_function) New function.
        (gfc_generate_function_code): Use it.

libgfortran/
2009-05-26  Tobias Burnus  <burnus@net-b.de>

        PR fortran/39178
        * runtime/main.c (store_exe_path): Make static
        and multiple-times callable.
        (set_args): Call store_exe_path.
        * libgfortran.h: Remove store_exe_path prototype.
        * fmain.c (main): Remove store_exe_path call.

From-SVN: r147883
2009-05-26 23:19:57 +02:00
Jerry DeLisle 3a546d4d9b re PR libfortran/37754 (READ I/O Performance regression from 4.3 to 4.4/4.5)
2009-05-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37754
	* io/write_float.def: Simplify format calculation.

From-SVN: r147725
2009-05-20 00:16:38 +00:00
François-Xavier Coudert 743460ea82 re PR libfortran/22423 (Warnings when building libgfortran)
PR fortran/22423

	* io/transfer.c (read_block_direct): Avoid warning.
	* runtime/string.c (compare0): Avoid warning.

From-SVN: r147254
2009-05-07 21:42:22 +00:00
Janne Blomqvist ee56ac9def Fix PR libfortran/39667
From-SVN: r147004
2009-04-30 18:12:37 +03:00
Janne Blomqvist 0a629857bc re PR fortran/39782 (IO depends on uninitialised value)
2009-04-18  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/39782
	* io/transfer.c (data_transfer_init): Don't flush before seek.
	(finalize_transfer): Remove extra flush.

From-SVN: r146308
2009-04-18 13:05:34 +03:00
Janne Blomqvist 4e23895d6a io.h (is_preconnected): Remove prototype.
2009-04-17  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/io.h (is_preconnected): Remove prototype.
	* io/unix.c (is_preconnected): Remove function.

From-SVN: r146287
2009-04-17 22:52:02 +03:00
Ulrich Weigand c049309d97 configure.ac: Test for -ffunction-sections -fdata-sections and set SECTION_FLAGS accordingly.
* configure.ac: Test for -ffunction-sections -fdata-sections and
	set SECTION_FLAGS accordingly.
	* configure: Regenerate.

	* Makefile.am: Add SECTION_FLAGS to AM_CFLAGS.
	* Makefile.in: Regenerate.

From-SVN: r146241
2009-04-17 10:36:21 +00:00
Janne Blomqvist 4268e5a550 Fix PR number for r146134
From-SVN: r146135
2009-04-15 22:41:42 +03:00
Janne Blomqvist 6f454a9f7c re PR libfortran/38668 (advance="no": no buffering, truncate and seek)
2009-04-15  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/38688
	* io/transfer.c (finalize_transfer): Don't flush for advance='no'.

From-SVN: r146134
2009-04-15 22:38:32 +03:00
Danny Smith 4ff626092e write.c (itoa): Rename back to gfc_itoa.
* io/write.c (itoa) : Rename back to gfc_itoa.
       (write_i): Adjust call to write_decimal.
       (write_integer):  Use gfc_itoa.

From-SVN: r146079
2009-04-15 04:05:02 +00:00
Janne Blomqvist 4dadda8fb0 io.h (move_pos_offset): Remove prototype.
2009-04-10  Janne Blomqvist  <jb@gcc.gnu.org>

        * io/io.h (move_pos_offset): Remove prototype.
        * io/transfer.c (formatted_transfer_scalar_read): Use sseek
        instead of move_pos_offset.
        * io/unix.c (move_pos_offset): Remove.

From-SVN: r145876
2009-04-10 11:26:56 +03:00
Janne Blomqvist 6b6802109e PR libfortran/39665 libfortran/39702 libfortran/39709
2009-04-10  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/39665 libfortran/39702 libfortran/39709
	* io/io.h (st_parameter_dt): Revert aligned attribute from u.p.value.
        * io/list_read.c (read_complex): Read directly into user pointer.
        (read_real): Likewise.
        (list_formatted_read_scalar): Update read_complex and read_real calls.
        (nml_read_obj): Read directly into user pointer.

From-SVN: r145875
2009-04-10 10:23:25 +03:00
Janne Blomqvist 60c063faab re PR libfortran/39665 (Fortran IO using unaligned accesses to read/write doubles.)
2009-04-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/39665
	* io/io.h (st_parameter_dt): Add aligned attribute to u.p.value.
	* io/read.c (convert_real): Add note about alignment requirements.

From-SVN: r145852
2009-04-09 20:44:23 +03:00
Jakub Jelinek 748086b7b2 Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.
From-SVN: r145841
2009-04-09 17:00:19 +02:00
Janne Blomqvist 2ac7316d99 open.c (already_open): Test for POSIX close return value.
2009-04-08  Janne Blomqvist  <jb@gcc.gnu.org>

        * io/open.c (already_open): Test for POSIX close return value.
        * io/unit.c (close_unit_1): Likewise.
        * io/unix.c (raw_close): Return 0 for success for preconnected units.

From-SVN: r145761
2009-04-08 20:06:34 +03:00
Janne Blomqvist f9bfed2243 string.c (compare0): Use gfc_charlen_type.
2009-04-08  Janne Blomqvist  <jb@gcc.gnu.org>

        * runtime/string.c (compare0): Use gfc_charlen_type.
        * runtime/error.c (gfc_itoa): Move to io/write.c
        (xtoa): Rename to gfc_xtoa.
        * runtime/backtrace.c (show_backtrace): Call gfc_xtoa.
        * intrinsics/cshift0.c (cshift0): Use index_type for shift arg.
        * intrinsics/date_and_time.c (date_and_time): Use index_type.
        (itime_i4): Likewise.
        (itime_i8): Likewise.
        (idate_i4): Likewise.
        (idate_i8): Likewise.
        (gmtime_i4): Likewise.
        (gmtime_i8): Likewise.
        (ltime_i4): Likewise.
        (ltime_i8): Likewise.
        * libgfortran.h (gfc_itoa): Remove prototype.
        (xtoa): Rename prototype to gfc_xtoa.
        * io/list_read.c (nml_read_obj): Use size_t for string length.
        * io/transfer.c (read_block_direct): Change nbytes arg from
        pointer to value.
        (unformatted_read): Minor cleanup, call read_block_directly properly.
        (skip_record): Use ssize_t.
        (next_record_w_unf): Avoid stell() call by calling sseek with SEEK_CUR.
        (iolength_transfer): Make sure to multiply before cast.
        * io/intrinsics.c (fgetc): Remove unnecessary variable.
        * io/format.c (format_hash): Use gfc_charlen_type.
        * io/write.c (itoa): Move from runtime/error.c:gfc_itoa, rename,
        make static.
        (write_i): Call with pointer to itoa.
        (write_z): Call with pointer to gfc_xtoa.
        (write_integer): Pointer to itoa.
        (nml_write_obj): Type cleanup, don't call strlen in loop.

From-SVN: r145758
2009-04-08 19:48:07 +03:00
H.J. Lu 4197c13d08 re PR libfortran/39664 (Revision 145571 breaks stdio)
2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR libgfortran/39664
	* io/unix.c (raw_close): Don't close STDOUT_FILENO,
	STDERR_FILENO nor STDIN_FILENO.

From-SVN: r145636
2009-04-06 16:07:51 -07:00
David Edelsohn d26014d24e io.h (struct stream): Rename truncate to trunc.
* io/io.h (struct stream): Rename truncate to trunc.
        (struncate): Same.
        * io/unix.c (raw_init): Rename truncate to trunc.
        (buf_init): Same.
        (open_internal): Same.

From-SVN: r145608
2009-04-06 11:32:03 -04:00
Jerry DeLisle 7812c78c34 [multiple changes]
2009-04-05  Daniel Kraft  <d@domob.eu>

	PR fortran/38654
	* io/read.c (read_f): Reworked to speed up floating point parsing.
	(convert_real): Use pointer-casting instead of memcpy and temporaries.

2009-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/37754
	* io/io.h (format_hash_entry): New structure for hash table.
	(format_hash_table): The hash table itself.
	(free_format_data): Revise function prototype.
	(free_format_hash_table, init_format_hash,
	free_format_hash): New function prototypes.
	* io/unit.c (close_unit_1): Use free_format_hash_table.
	* io/transfer.c (st_read_done, st_write_done): Free format data if
	internal unit.
	* io/format.c (free_format_hash_table): New function that frees any
	memory allocated previously for cached format data.
	(reset_node): New static helper function to reset the format counters
	for a format node.
	(reset_fnode_counters): New static function recursively calls reset_node
	to traverse the	fnode tree.
	(format_hash): New simple hash function based on XOR, probabalistic,
	tosses collisions.
	(save_parsed_format): New static function to save the parsed format
	data to use again.
	(find_parsed_format): New static function searches the hash table
	looking for a match.
	(free_format_data): Revised to accept pointer to format data rather than
	the dtp pointer so that the function can be used in more places.
	(format_lex): Editorial.
	(parse_format_list): Set flag used to determine of format data hashing
	is to be used.  Internal units are not persistent enough for this.
	(revert): Move to ne location in file.
	(parse_format): Use new functions to look for previously parsed
	format strings and use them rather than re-parse.  If not found, saves
	the parsed format data for later use.
	
2009-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/37754
	* io/transfer.c (formatted_transfer_scalar): Remove this function by
	factoring it into two new functions, one for read and one for write,
	eliminating all the conditionals for read or write mode.
	(formatted transfer_scalar_read): New function.
	(formatted transfer_scalar_write): New function.
	(formatted_transfer): Use new functions.

2009-04-05  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/25561 libfortran/37754
	* io/io.h (struct stream): Define new stream interface function
	pointers, and inline functions for accessing it.
	(struct fbuf): Use int instead of size_t, remove flushed element.
	(mem_alloc_w): New prototype.
	(mem_alloc_r): New prototype.
	(stream_at_bof): Remove prototype.
	(stream_at_eof): Remove prototype.
	(file_position): Remove prototype.
	(flush): Remove prototype.
	(stream_offset): Remove prototype.
	(unit_truncate): New prototype.
	(read_block_form): Change to return pointer, int* argument.
	(hit_eof): New prototype.
	(fbuf_init): Change prototype.
	(fbuf_reset): Change prototype.
	(fbuf_alloc): Change prototype.
	(fbuf_flush): Change prototype.
	(fbuf_seek): Change prototype.
	(fbuf_read): New prototype.
	(fbuf_getc_refill): New prototype.
	(fbuf_getc): New inline function.
        * io/fbuf.c (fbuf_init): Use int, get rid of flushed.
	(fbuf_debug): New function.
	(fbuf_reset): Flush, and return position offset.
	(fbuf_alloc): Simplify, don't flush, just realloc.
	(fbuf_flush): Make usable for read mode, salvage remaining bytes.
	(fbuf_seek): New whence argument.
	(fbuf_read): New function.
	(fbuf_getc_refill): New function.
	* io/file_pos.c (formatted_backspace): Use new stream interface.
	(unformatted_backspace): Likewise.
	(st_backspace): Make sure format buffer is reset, use new stream
	interface, use unit_truncate.
	(st_endfile): Likewise.
	(st_rewind): Likewise.
	* io/intrinsics.c: Use new stream interface.
	* io/list_read.c (push_char): Don't use u.p.scratch, use realloc
	to resize.
	(free_saved): Don't check u.p.scratch.
	(next_char): Use new stream interface, use fbuf_getc() for external files.
	(finish_list_read): flush format buffer.
	(nml_query): Update to use modified interface:s
	* io/open.c (test_endfile): Use new stream interface.
	(edit_modes): Likewise.
	(new_unit): Likewise, set bytes_left to 1 for stream files.
	* io/read.c (read_l): Use new read_block_form interface.
	(read_utf8): Likewise.
	(read_utf8_char1): Likewise.
	(read_default_char1): Likewise.
	(read_utf8_char4): Likewise.
	(read_default_char4): Likewise.
	(read_a): Likewise.
	(read_a_char4): Likewise.
	(read_decimal): Likewise.
	(read_radix): Likewise.
	(read_f): Likewise.
	* io/transfer.c (read_sf): Use fbuf_read and mem_alloc_r, remove
	usage of u.p.line_buffer.
	(read_block_form): Update interface to return pointer, use
	fbuf_read for direct access.
	(read_block_direct): Update to new stream interface.
	(write_block): Use mem_alloc_w for internal I/O.
	(write_buf): Update to new stream interface.
	(formatted_transfer_scalar): Don't use u.p.line_buffer, use
	fbuf_seek for external files.
	(us_read): Update to new stream interface.
	(us_write): Likewise.
	(data_transfer_init): Always check if we switch modes and flush.
	(skip_record): Use new stream interface, fix comparison.
	(next_record_r): Check for and reset u.p.at_eof, use new stream
	interface, use fbuf_getc for spacing.
	(write_us_marker): Update to new stream interface, don't inline.
	(next_record_w_unf): Likewise.
	(sset): New function.
	(next_record_w): Use new stream interface, use fbuf for printing
	newline.
	(next_record): Use new stream interface.
	(finalize_transfer): Remove sfree call, use new stream interface.
	(st_iolength_done): Don't use u.p.scratch.
	(st_read): Don't check for end of file.
	(st_read_done): Don't use u.p.scratch, use unit_truncate.
	(hit_eof): New function.
	* io/unit.c (init_units): Always init fbuf for formatted units.
	(update_position): Use new stream interface.
	(unit_truncate): New function.
	(finish_last_advance_record): Use fbuf to print newline.
	* io/unix.c: Remove unused SSIZE_MAX macro.
	(BUFFER_SIZE): Make static const variable rather than macro.
	(struct unix_stream): Remove dirty_offset, len, method,
	small_buffer. Order elements by decreasing size.
	(struct int_stream): Remove.
	(move_pos_offset): Remove usage of dirty_offset.
	(reset_stream): Remove.
	(do_read): Rename to raw_read, update to match new stream
	interface.
	(do_write): Rename to raw_write, update to new stream interface.
	(raw_seek): New function.
	(raw_tell): New function.
	(raw_truncate): New function.
	(raw_close): New function.
	(raw_flush): New function.
	(raw_init): New function.
	(fd_alloc): Remove.
	(fd_alloc_r_at): Remove.
	(fd_alloc_w_at): Remove.
	(fd_sfree): Remove.
	(fd_seek): Remove.
	(fd_truncate): Remove.
	(fd_sset): Remove.
	(fd_read): Remove.
	(fd_write): Remove.
	(fd_close): Remove.
	(fd_open): Remove.
	(fd_flush): Rename to buf_flush, update to new stream interface
	and unix_stream.
	(buf_read): New function.
	(buf_write): New function.
	(buf_seek): New function.
	(buf_tell): New function.
	(buf_truncate): New function.
	(buf_close): New function.
	(buf_init): New function.
	(mem_alloc_r_at): Rename to mem_alloc_r, change prototype.
	(mem_alloc_w_at): Rename to mem_alloc_w, change prototype.
	(mem_read): Change to match new stream interface.
	(mem_write): Likewise.
	(mem_seek): Likewise.
	(mem_tell): Likewise.
	(mem_truncate): Likewise.
	(mem_close): Likewise.
	(mem_flush): New function.
	(mem_sfree): Remove.
	(empty_internal_buffer): Cast to correct type.
	(open_internal): Use correct type, init function pointers.
	(fd_to_stream): Test whether to open file as buffered or raw.
	(output_stream): Remove mode set.
	(error_stream): Likewise.
	(flush_all_units_1): Use new stream interface.
	(flush_all_units): Likewise.
	(stream_at_bof): Remove.
	(stream_at_eof): Remove.
	(file_position): Remove.
	(file_length): Update logic to use stream interface.
	(flush): Remove.
	(stream_offset): Remove.
	* io/write.c (write_utf8_char4): Use int instead of size_t.
	(write_x): Extra safety check.
	(namelist_write_newline): Use new stream interface.

From-SVN: r145571
2009-04-05 20:13:56 +00:00
John David Anglin 63f90eb7b0 re PR libfortran/33595 (FAIL: gfortran.dg/nint_2.f90 -O0 execution test)
PR fortran/33595
	* intrinsics/c99_functions.c (round): Use floor instead of ceil.
	Revise checks to round up.
	(roundf): Likewise.

From-SVN: r145209
2009-03-28 21:15:45 +00:00
Daniel Kraft bc6600ab2a string_intrinsics.c: #include <assert.h>
2009-03-28  Daniel Kraft  <d@domob.eu>

	* intrinsics/string_intrinsics.c: #include <assert.h>
	* intrinsics/string_intrinsics_inc.c (string_trim): Use string_len_trim
	instead of calculating the length directly.
	(string_len_trim): For KIND=1, speed search up.

2009-03-28  Daniel Kraft  <d@domob.eu>

	* gfortran.dg/trim_1.f90: New test.

From-SVN: r145192
2009-03-28 16:18:59 +01:00
Jerry DeLisle b710b6bc87 re PR fortran/39528 (repeated entries are not read when using list-directed input)
2009-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/39528
	* io/list_read.c (list_formatted_read_scalar): Move check for read
	completion to just after the check for a repeated value.

From-SVN: r145030
2009-03-24 12:24:29 +00:00
Janne Blomqvist f3ed1d0222 Revert part of patch accidentally committed to trunk rather than fortran-dev (I hate svn)
From-SVN: r144994
2009-03-22 13:32:29 +02:00
Janne Blomqvist 9e544d738a PR libfortran/25561 libfortran/37754
2009-03-22  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/25561 libfortran/37754
	* io/io.h (struct stream): Define new stream interface function
	pointers, and inline functions for accessing it.
	(struct fbuf): Use int instead of size_t, remove flushed element.
	(mem_alloc_w): New prototype.
	(mem_alloc_r): New prototype.
	(stream_at_bof): Remove prototype.
	(stream_at_eof): Remove prototype.
	(file_position): Remove prototype.
	(flush): Remove prototype.
	(stream_offset): Remove prototype.
	(unit_truncate): New prototype.
	(read_block_form): Change to return pointer, int* argument.
	(hit_eof): New prototype.
	(fbuf_init): Change prototype.
	(fbuf_reset): Change prototype.
	(fbuf_alloc): Change prototype.
	(fbuf_flush): Change prototype.
	(fbuf_seek): Change prototype.
	(fbuf_read): New prototype.
	(fbuf_getc_refill): New prototype.
	(fbuf_getc): New inline function.
        * io/fbuf.c (fbuf_init): Use int, get rid of flushed.
	(fbuf_debug): New function.
	(fbuf_reset): Flush, and return position offset.
	(fbuf_alloc): Simplify, don't flush, just realloc.
	(fbuf_flush): Make usable for read mode, salvage remaining bytes.
	(fbuf_seek): New whence argument.
	(fbuf_read): New function.
	(fbuf_getc_refill): New function.
	* io/file_pos.c (formatted_backspace): Use new stream interface.
	(unformatted_backspace): Likewise.
	(st_backspace): Make sure format buffer is reset, use new stream
	interface, use unit_truncate.
	(st_endfile): Likewise.
	(st_rewind): Likewise.
	* io/intrinsics.c: Use new stream interface.
	* io/list_read.c (push_char): Don't use u.p.scratch, use realloc
	to resize.
	(free_saved): Don't check u.p.scratch.
	(next_char): Use new stream interface, use fbuf_getc() for external files.
	(finish_list_read): flush format buffer.
	(nml_query): Update to use modified interface:s
	* io/open.c (test_endfile): Use new stream interface.
	(edit_modes): Likewise.
	(new_unit): Likewise, set bytes_left to 1 for stream files.
	* io/read.c (read_l): Use new read_block_form interface.
	(read_utf8): Likewise.
	(read_utf8_char1): Likewise.
	(read_default_char1): Likewise.
	(read_utf8_char4): Likewise.
	(read_default_char4): Likewise.
	(read_a): Likewise.
	(read_a_char4): Likewise.
	(read_decimal): Likewise.
	(read_radix): Likewise.
	(read_f): Likewise.
	* io/transfer.c (read_sf): Use fbuf_read and mem_alloc_r, remove
	usage of u.p.line_buffer.
	(read_block_form): Update interface to return pointer, use
	fbuf_read for direct access.
	(read_block_direct): Update to new stream interface.
	(write_block): Use mem_alloc_w for internal I/O.
	(write_buf): Update to new stream interface.
	(formatted_transfer_scalar): Don't use u.p.line_buffer, use
	fbuf_seek for external files.
	(us_read): Update to new stream interface.
	(us_write): Likewise.
	(data_transfer_init): Always check if we switch modes and flush.
	(skip_record): Use new stream interface, fix comparison.
	(next_record_r): Check for and reset u.p.at_eof, use new stream
	interface, use fbuf_getc for spacing.
	(write_us_marker): Update to new stream interface, don't inline.
	(next_record_w_unf): Likewise.
	(sset): New function.
	(next_record_w): Use new stream interface, use fbuf for printing
	newline.
	(next_record): Use new stream interface.
	(finalize_transfer): Remove sfree call, use new stream interface.
	(st_iolength_done): Don't use u.p.scratch.
	(st_read): Don't check for end of file.
	(st_read_done): Don't use u.p.scratch, use unit_truncate.
	(hit_eof): New function.
	* io/unit.c (init_units): Always init fbuf for formatted units.
	(update_position): Use new stream interface.
	(unit_truncate): New function.
	(finish_last_advance_record): Use fbuf to print newline.
	* io/unix.c: Remove unused SSIZE_MAX macro.
	(BUFFER_SIZE): Make static const variable rather than macro.
	(struct unix_stream): Remove dirty_offset, len, method,
	small_buffer. Order elements by decreasing size.
	(struct int_stream): Remove.
	(move_pos_offset): Remove usage of dirty_offset.
	(reset_stream): Remove.
	(do_read): Rename to raw_read, update to match new stream
	interface.
	(do_write): Rename to raw_write, update to new stream interface.
	(raw_seek): New function.
	(raw_tell): New function.
	(raw_truncate): New function.
	(raw_close): New function.
	(raw_flush): New function.
	(raw_init): New function.
	(fd_alloc): Remove.
	(fd_alloc_r_at): Remove.
	(fd_alloc_w_at): Remove.
	(fd_sfree): Remove.
	(fd_seek): Remove.
	(fd_truncate): Remove.
	(fd_sset): Remove.
	(fd_read): Remove.
	(fd_write): Remove.
	(fd_close): Remove.
	(fd_open): Remove.
	(fd_flush): Rename to buf_flush, update to new stream interface
	and unix_stream.
	(buf_read): New function.
	(buf_write): New function.
	(buf_seek): New function.
	(buf_tell): New function.
	(buf_truncate): New function.
	(buf_close): New function.
	(buf_init): New function.
	(mem_alloc_r_at): Rename to mem_alloc_r, change prototype.
	(mem_alloc_w_at): Rename to mem_alloc_w, change prototype.
	(mem_read): Change to match new stream interface.
	(mem_write): Likewise.
	(mem_seek): Likewise.
	(mem_tell): Likewise.
	(mem_truncate): Likewise.
	(mem_close): Likewise.
	(mem_flush): New function.
	(mem_sfree): Remove.
	(empty_internal_buffer): Cast to correct type.
	(open_internal): Use correct type, init function pointers.
	(fd_to_stream): Test whether to open file as buffered or raw.
	(output_stream): Remove mode set.
	(error_stream): Likewise.
	(flush_all_units_1): Use new stream interface.
	(flush_all_units): Likewise.
	(stream_at_bof): Remove.
	(stream_at_eof): Remove.
	(file_position): Remove.
	(file_length): Update logic to use stream interface.
	(flush): Remove.
	(stream_offset): Remove.
	* io/write.c (write_utf8_char4): Use int instead of size_t.
	(write_x): Extra safety check.
	(namelist_write_newline): Use new stream interface.

[[Split portion of a mixed commit.]]

From-SVN: r144993.2
2009-03-22 12:51:05 +02:00
Jerry DeLisle b958b842c0 Fix PR number reference in ChangeLog from 39409 to 39402.
From-SVN: r144720
2009-03-09 04:57:34 +00:00
Jerry DeLisle d53cb9ea60 re PR libfortran/39402 (gfortran 20090306: internal write of 0.0 with F0.3 gives **)
2009-03-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/39409
	* io/write_float.def (output_float): Handle F0.d formatting correctly
	for any d when value is 0.0.

From-SVN: r144718
2009-03-09 04:47:51 +00:00
Ralf Wildenhues 7a9d3fe886 backport: Support GNU/kOpenSolaris.
Backport from git Libtool:

	2009-01-19  Robert Millan  <rmh@aybabtu.com>
	Support GNU/kOpenSolaris.
	* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
	(_LT_CHECK_MAGIC_METHOD, _LT_COMPILER_PIC, _LT_LINKER_SHLIBS)
	(_LT_LANG_CXX_CONFIG) [kopensolaris*-gnu]: Recognize
	GNU/kOpenSolaris.

libjava/classpath/
	* configure: Regenerate.

libjava/
	* configure: Regenerate.

libssp/
	* configure: Regenerate.

libobjc/
	* configure: Regenerate.

libstdc++-v3/
	* configure: Regenerate.

libgfortran/
	* configure: Regenerate.

boehm-gc/
	* configure: Regenerate.

gcc/
	* configure: Regenerate.

libmudflap/
	* configure: Regenerate.

zlib/
	* configure: Regenerate.

libffi/
	* configure: Regenerate.

libgomp/
	* configure: Regenerate.

From-SVN: r144527
2009-03-01 17:49:31 +00:00
Daniel Kraft 210879b85b re PR fortran/38887 (run-time abort for MVBITS with run-time zero sized array arguments)
2009-01-21  Daniel Kraft  <d@domob.eu>

	* trans-stmt.c (gfc_conv_elemental_dependencies):  Cleaned up comment.

2009-01-21  Daniel Kraft  <d@domob.eu>

	PR fortran/38887
	* runtime/in_unpack_generic.c (internal_unpack):  Return instead of
	abort when called with empty array.
	* m4/in_unpack.m4:  Ditto.
	* generated/in_unpack_i1.c:  Regenerated.
	* generated/in_unpack_i2.c:  Regenerated.
	* generated/in_unpack_i4.c:  Regenerated.
	* generated/in_unpack_i8.c:  Regenerated.
	* generated/in_unpack_i16.c: Regenerated.
	* generated/in_unpack_r4.c:  Regenerated.
	* generated/in_unpack_r8.c:  Regenerated.
	* generated/in_unpack_r10.c: Regenerated.
	* generated/in_unpack_r16.c: Regenerated.
	* generated/in_unpack_c4.c:  Regenerated.
	* generated/in_unpack_c8.c:  Regenerated.
	* generated/in_unpack_c10.c: Regenerated.
	* generated/in_unpack_c16.c: Regenerated.

2009-01-21  Daniel Kraft  <d@domob.eu>

	PR fortran/38887
	* gfortran.dg/mvbits_5.f90:  New test.

From-SVN: r143541
2009-01-21 14:34:55 +01:00
Jerry DeLisle 1a15c900e8 re PR libfortran/38772 (r143102 reveals missed error checking on floating point reads)
2009-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38772
	* io/read.c (read_f): Clean up loop conditions for BZ/BN,
	allowing proper digit testing. White space fix.

From-SVN: r143327
2009-01-13 05:40:36 +00:00
Jerry DeLisle 8217a6359f re PR libfortran/38735 ([4.4 Regresssion] Default BLANK= mode for internal units is wrong)
2009-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38735
	* io/unit.c (get_internal_unit): Set default BLANK= status to NULL for
	internal units.

From-SVN: r143102
2009-01-05 22:55:15 +00:00
John David Anglin c0c3c409a7 re PR fortran/31832 (FAIL: gfortran.dg/integer_exponentiation_2.f90 at -O1 and above)
PR fortran/31832
	* acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_POWF): New autoconf check for
	broken powf.
	* configure.ac (LIBGFOR_CHECK_FOR_BROKEN_POWF): Use it.
	* intrinsics/c99_functions.c: Use internal powf implementation if
	HAVE_BROKEN_POWF is defined.
	* configure: Rebuilt.
	* config.h.in: Rebuilt.

From-SVN: r142952
2008-12-29 20:10:00 +00:00
Jerry DeLisle 82192170e3 re PR fortran/37472 (bad output on default-format write of double in common block with -m64)
2008-12-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37472
	* io/write_float.def (output_float_FMT_G_): Modify calculation of temp
	to avoid sensitivity to round-off.

From-SVN: r142884
2008-12-22 14:53:37 +00:00
Jerry DeLisle 50220190d2 re PR fortran/38398 (g0.w edit descriptor: Update for F2008 Tokyo meeting changes)
2008-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38398
	* io/io.h (st_parameter_dt): Add new bit to keep track of when to
	suppress blanks for g0 formatting.
	* io/transfer.c (formatted_transfer_scalar): Always call write_real_g0
	for g0 formatting.
	* io.c (write.c): Do not use ES formatting and use new bit to suppress
	blanks.
	* io/write_float.def (output_float): Adjust the location of setting the
	width so that it can be adjusted when suppressing blanks.  Set number of
	blanks to zero when dtp->u.p.g0_no_blanks is set. Do some minor code
	clean-up and add some white space for readability.

From-SVN: r142871
2008-12-21 21:23:52 +00:00
Ralf Wildenhues baafc53472 Backport from upstream Libtool:
* libltdl.m4 (_LT_SYS_DYNAMIC_LINKER)
	(_LT_LINKER_SHLIBS): Add cache variables to tests that
	require the linker to work.  For shlibpath_overrides_runpath,
	this also changes the semantics to let the result from the C
	compiler take precedence.

boehm-gc/

	* configure: Regenerate.

fixincludes/

	* configure: Regenerate.

gcc/

	* configure: Regenerate.

libffi/

	* configure: Regenerate.

libgfortran/

	* configure: Regenerate.

libgomp/

	* configure: Regenerate.

libjava/classpath/

	* configure: Regenerate.

libjava/

	* configure: Regenerate.

libmudflap/

	* configure: Regenerate.

libobjc/

	* configure: Regenerate.

libssp/

	* configure: Regenerate.

libstdc++-v3/

	* configure: Regenerate.

zlib/

	* configure: Regenerate.

From-SVN: r142817
2008-12-18 20:04:55 +00:00
Jerry DeLisle 07e9d8beb7 re PR fortran/38504 (double minus sign when printing integer?)
2008-12-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38504
	io/write.c (write_decimal): Skip extra sign '-' at beginning of string
	returned by gfc_itoa.

From-SVN: r142747
2008-12-14 06:50:53 +00:00
Jerry DeLisle 9f309df283 re PR fortran/38430 (gfortran.dg/streamio_1.f90, 10, 14, 2, 6 now fails)
2008-12-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38430
	* io/transfer.c (data_transfer_init): Move constraint check for REC=
	and STREAM access into condition for other REC= constraints to simplify.
	Comment out this constraint to avoid breaking compatibility with 4.3
	until later.  Added a TODO for above comment and this one.
	Fix test for max pos.

From-SVN: r142575
2008-12-09 03:19:09 +00:00
Jerry DeLisle 97b14ba880 re PR fortran/38291 (Rejects I/O with POS= if FMT=*)
2008-12-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38291
	* io/transfer.c (data_transfer_init): Add fbuf_flush inadvertently
	ommitted.  Add check for invalid use of REC= with ACCESS="stream".  Fix
	comment.

From-SVN: r142528
2008-12-06 21:53:11 +00:00
Adam Nemet 8b86bdbc02 * runtime/main.c (store_exe_path): Don't crash if argv0 is NULL.
From-SVN: r142526
2008-12-06 18:07:43 +00:00
Jerry DeLisle 4c934d41d2 re PR fortran/38291 (Rejects I/O with POS= if FMT=*)
2008-12-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/38291
	* io.c (match_dt_element): Use dt->pos in matcher.
	(gfc_free_dt): Free dt->pos after use.
	(gfc_resolve_dt): Use dt->pos in resolution of stream position tag.

2008-12-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38291
	* io/transfer.c (data_transfer_init): Add checks for POS= valid range.
	Add check for unit opened with ACCESS="stream". Flush and seek if
	current stream position does not match. Check ENDFILE on read.

From-SVN: r142515
2008-12-06 04:13:34 +00:00
Jerry DeLisle e318b7602b re PR fortran/38285 (Wrong I/O output: Interaction between F and P for output)
2008-12-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/38285
	* write_float.def (WRITE_FLOAT): Zero the float value for special case
	only if	scale_factor = 0.

From-SVN: r142455
2008-12-05 04:07:45 +00:00
Thomas Koenig bd72cbc822 re PR libfortran/38234 (In Reshape, SOURCE can be bigger than result)
2008-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/38234
	* intrinsics/reshape_generic.c (reshape_internal):
	Source can be larger than shape.
	* m4/reshape.m4:  Likewise.
	* generated/reshape_c10.c Regenerated.
	* generated/reshape_c16.c Regenerated.
	* generated/reshape_c4.c Regenerated.
	* generated/reshape_c8.c Regenerated.
	* generated/reshape_i16.c Regenerated.
	* generated/reshape_i4.c Regenerated.
	* generated/reshape_i8.c Regenerated.
	* generated/reshape_r10.c Regenerated.
	* generated/reshape_r16.c Regenerated.
	* generated/reshape_r4.c Regenerated.
	* generated/reshape_r8.c Regenerated.

2008-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/38234
	* gfortran.dg/reshape_4.f90:  New test.

From-SVN: r142137
2008-11-23 19:25:42 +00:00
Danny Smith 6a21bcbe16 nessage.txt
From-SVN: r142131
2008-11-23 07:02:22 +00:00
Thomas Koenig a388c77976 re PR libfortran/38225 (RESHAPE bounds with multi-dimensional SOURCE)
2008-11-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/38225
	* intrinsics/reshape_generic.c (reshape_internal):
	Use all dimensions of source for bounds checking.
	* m4/reshape.m4:  Likewise.
	* generated/reshape_c10.c Regenerated.
	* generated/reshape_c16.c Regenerated.
	* generated/reshape_c4.c Regenerated.
	* generated/reshape_c8.c Regenerated.
	* generated/reshape_i16.c Regenerated.
	* generated/reshape_i4.c Regenerated.
	* generated/reshape_i8.c Regenerated.
	* generated/reshape_r10.c Regenerated.
	* generated/reshape_r16.c Regenerated.
	* generated/reshape_r4.c Regenerated.
	* generated/reshape_r8.c Regenerated.

2008-11-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/38225
	* gfortran.dg/reshape_3.f90:  New test.

From-SVN: r142125
2008-11-22 21:41:27 +00:00
Jakub Jelinek e14568432a re PR libfortran/37839 (st_parameter_dt has unwanted padding, is out of sync with compiler)
PR libfortran/37839
	* trans-io.c (gfc_build_io_library_fndecls): Decrease pad size back
	to 16 pointers plus 32 integers.  Don't use max integer kind
	alignment, only gfc_intio_kind's alignment.
	(gfc_trans_inquire): Only set flags2 if mask2 is non-zero.
	* ioparm.def: Fix order, bitmasks and types of inquire round, sign
	and pending fields.  Move u in dt before id.
	* io.c (gfc_free_inquire): Free decimal and size exprs.
	(match_inquire_element): Match size instead of matching blank twice.
	(gfc_resolve_inquire): Resolve size.

	* gfortran.dg/f2003_inquire_1.f03: New test.
	* gfortran.dg/f2003_io_1.f03: Remove xfail.
	* gfortran.dg/f2003_io_4.f03: Likewise.
	* gfortran.dg/f2003_io_5.f03: Likewise.
	* gfortran.dg/f2003_io_6.f03: Likewise.
	* gfortran.dg/f2003_io_7.f03: Likewise.

	* io/io.h (IOPARM_INQUIRE_HAS_ROUND, IOPARM_INQUIRE_HAS_SIGN,
	IOPARM_INQUIRE_HAS_PENDING): Adjust values.
	(st_parameter_inquire): Reorder and fix types of round, sign and
	pending fields.
	(st_parameter_43, st_parameter_44): Removed.
	(st_parameter_dt): Put back struct definition directly to u.p
	declaration.  Change type of u.p.size_used from gfc_offset to
	GFC_IO_INT.  Decrease back size of u.pad to 16 pointers and
	32 ints.  Put id, pos, asynchronous, blank, decimal, delim,
	pad, round and sign fields after the union.
	* io/inquire.c (inquire_via_unit, inquire_via_filename): Only read
	flags2 if it is defined.
	* io/transfer.c (read_sf, read_block_form, write_block): Cast
	additions to size_used to GFC_IO_INT instead of gfc_offset.
	(data_transfer_init): Clear whole u.p struct.  Adjust
	for moving id, pos, asynchronous, blank, decimal, delim, pad,
	round and sign fields from u.p directly into st_parameter_dt.
	(finalize_transfer): Don't cast size_used to GFC_IO_INT.
	* io/file_pos.c (st_endfile): Clear whole u.p struct.

From-SVN: r142111
2008-11-22 09:10:41 +01:00
Jerry DeLisle 0f4122ff3d re PR fortran/37472 (bad output on default-format write of double in common block with -m64)
2008-11-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37472
	* io/write_float.def (output_float_FMT_G_): Adjust conversion of
	G format specification to F format.

From-SVN: r142079
2008-11-21 04:29:54 +00:00
Thomas Koenig 042fed7915 re PR fortran/38135 (RESHAPE gives wrong result)
2008-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/38135
	* m4/reshape.m4:  Correct bounds checking when PAD is present.
	Treat PAD as if it were SOURCE when SOURCE is empty.
	* intrinsics/reshape_generic.c:  Likewise.
	* generated/reshape_c10.c Regenerated.
	* generated/reshape_c16.c Regenerated.
	* generated/reshape_c4.c Regenerated.
	* generated/reshape_c8.c Regenerated.
	* generated/reshape_i16.c Regenerated.
	* generated/reshape_i4.c Regenerated.
	* generated/reshape_i8.c Regenerated.
	* generated/reshape_r10.c Regenerated.
	* generated/reshape_r16.c Regenerated.
	* generated/reshape_r4.c Regenerated.
	* generated/reshape_r8.c Regenerated.

2008-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/38135
	* gfortran.dg/reshape_pad_1.f90:  New test case.

From-SVN: r141982
2008-11-18 22:43:05 +00:00
Jerry DeLisle 264a5255d8 re PR libfortran/38097 (I/O with blanks in exponent fails; blank="NULL", BN edit descriptor)
2008-11-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/38097
	* io/read.c (read_f): Initialize exponent. Fix comment. Set loop
	conditions for BZ/BN.
	* io/unit.c (get_internal_unit): Initialize flags.blank.
	* io/transfer.c (data_transfer_init): Fix whitespace.

From-SVN: r141919
2008-11-16 16:12:16 +00:00
Jerry DeLisle 94bc6c1e77 re PR libfortran/37294 (Namelist I/O to array character internal units)
2008-11-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37294
	* io/write.c (namelist_write_newline): Use array loop specification to
	advance to next internal array unit record. (namelist_write): Adjust to
	accomodate the internal array unit behavior.

From-SVN: r141892
2008-11-15 19:25:35 +00:00
Dennis Wassel 1b867ae782 re PR fortran/37159 (RANDOM_SEED: GET= check array size at compile time and respect -fdefault-integer-*)
2008-11-01  Dennis Wassel  <dennis.wassel@gmail.com>

	PR fortran/37159
	* fortran/check.c (gfc_check_random_seed): Check PUT size
	at compile time.

2008-11-01  Dennis Wassel  <dennis.wassel@gmail.com>

	PR fortran/37159
	* intrinsics/random.c: Added comment to adapt check.c, should
	kiss_size change.
	Few cosmetic changes to existing comments.

2008-11-01  Dennis Wassel  <dennis.wassel@gmail.com>

	PR fortran/37159
	* gfortran.dg/random_seed_1.f90: New testcase.

From-SVN: r141511
2008-11-01 10:24:15 +00:00
Jerry DeLisle f7d08a6320 Fix typo.
From-SVN: r141319
2008-10-23 02:43:28 +00:00
Jerry DeLisle a7f5d0542a re PR libfortran/37707 (Namelist read of array of derived type incorrect)
2008-10-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37707
	* io/list_read.c (read_character): Remove code to look ahead in namelist
	reads to descriminate non-delimited strings from namelist objects.
	* io/write.c (namelist_write): Delimit character strings with quote or
	apostrophe, defaulting to quote.

From-SVN: r141317
2008-10-23 02:31:00 +00:00
Thomas Koenig c0c7206d89 re PR libfortran/34670 (bounds checking for array intrinsics)
2008-10-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* intrinsics/transpose_generic.c:  Implement bounds checking.
	* m4/transpose.m4:  Likewise.
	* generated/transpose_c8.c: Regenerated.
	* generated/transpose_c16.c: Regenerated.
	* generated/transpose_r10.c: Regenerated.
	* generated/transpose_i8.c: Regenerated.
	* generated/transpose_c10.c: Regenerated.
	* generated/transpose_r4.c: Regenerated.
	* generated/transpose_c4.c: Regenerated.
	* generated/transpose_i16.c: Regenerated.
	* generated/transpose_i4.c: Regenerated.
	* generated/transpose_r8.c: Regenerated.
	* generated/transpose_r16.c: Regenerated.

2008-10-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* gfortran.dg/transpose_2.f90:  New test.

From-SVN: r141276
2008-10-21 20:12:52 +00:00
Jerry DeLisle f13c001e1a re PR fortran/37834 (write(*,'(f0.0)') 0.0 prints "." instead of "0.")
2008-10-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37834
	* io/write_float.def (output_float): Emit '0.' for special case of
	format specifier 'f0.0' and value of zero. Likewise emit '0' for 'f1.0'.

From-SVN: r141231
2008-10-19 18:36:21 +00:00
Jerry DeLisle 7d5691b40f Fix ChangeLog
2008-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37863
	* io/write_float.def (WRITE_FLOAT): Round to 1.0 correctly.
	* io/io.h (st_parameter_44): Fix id type declaration.

From-SVN: r141208
2008-10-18 05:27:23 +00:00
Jerry DeLisle 80ad19715e re PR fortran/37863 (Display of a value close but less to 1 shows 2 with '(F3.0)')
2008-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37707
	* io/write_float.def (WRITE_FLOAT): Round to 1.0 correctly.
	* io/io.h (st_parameter_44): Fix id type declaration.

From-SVN: r141207
2008-10-18 05:23:47 +00:00
Thomas Koenig afab92d840 file_pos.c (unformatted_backspace): Normal case is GFC_CONVERT_NATIVE.
2008-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* io/file_pos.c (unformatted_backspace): Normal case is
	GFC_CONVERT_NATIVE.
	* io/transfer.c (read_sf):  Mark paths leading to generate_error()
	as unlikely.
	(readl_block_form):  Likewise.
	(read_block_direct):  Likewise.
	(write_block):  Likewise.
	(write_buf):  Likewise.
	(us_read):  Likewise.  Normal case is GFC_CONVERT_NATIVE.
	(next_record_w_unf):  Mark paths leading to generate_error()
	as unlikely.

From-SVN: r141179
2008-10-16 18:23:25 +00:00
Thomas Koenig e311490551 re PR libfortran/34670 (bounds checking for array intrinsics)
2008-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* generated/spread_r4.c: Regenerated.

From-SVN: r141167
2008-10-16 10:16:38 +00:00
Thomas Koenig 21c74256c3 re PR libfortran/34670 (bounds checking for array intrinsics)
2008-10-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* intrinsics/reshape_generic.c:  Add bounds checking.
	* m4/reshape.m4:  Likewise.
        * generated/reshape_c10.c: Regenerated.
        * generated/reshape_c16.c: Regenerated.
        * generated/reshape_c4.c: Regenerated.
        * generated/reshape_c8.c: Regenerated.
        * generated/reshape_i16.c: Regenerated.
        * generated/reshape_i4.c: Regenerated.
        * generated/reshape_i8.c: Regenerated.
        * generated/reshape_r10.c: Regenerated.
        * generated/reshape_r16.c: Regenerated.
        * generated/reshape_r4.c: Regenerated.
        * generated/reshape_r8.c: Regenerated.
        * generated/spread_r4.c: Regenerated.

2008-10-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* gfortran.dg/reshape_3.f90:  New test.
	* gfortran.dg/reshape_4.f90:  New test.
	* gfortran.dg/reshape_order_1.f90:  Use correct shape.
	* gfortran.dg/reshape_order_2.f90:  Likewise.
	* gfortran.dg/reshape_order_3.f90:  Likewise.
	* gfortran.dg/reshape_order_4.f90:  Likewise.

From-SVN: r141144
2008-10-15 16:27:58 +00:00
Jerry DeLisle 724cdffe5c re PR fortran/37083 (Formatted read of line without trailing new-line fails)
2008-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37083
	* io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
	(finish_list_read): Add EOF check.

From-SVN: r141101
2008-10-14 01:49:51 +00:00
Thomas Koenig e81897731e re PR libfortran/37753 (Convert="BIG_ENDIAN" reverses character)
2008-10-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/37753
	* io/transfer.c (unformatted_read):  CONVERT_NATIVE
	is the usual case.  Check for kind==1 for non-byte-reversing
	operation.
	(unformatted_write):  Likewise.

2008-10-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/37753
	* gfortran.dg/convert_2.f90:  New test case.

From-SVN: r141008
2008-10-09 19:28:58 +00:00
Jerry DeLisle af43ff01e1 Fix ChangeLog.
From-SVN: r140996
2008-10-09 04:09:19 +00:00
Jerry DeLisle 22a6009350 re PR libfortran/37707 (Namelist read of array of derived type incorrect)
2008-10-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37707
	* io/list_read.c (nml_get_obj_data): If the first namelist object rank
	is greater than zero, call nml_object_read with the first object rather
	than the sub-object.

From-SVN: r140995
2008-10-09 04:02:35 +00:00
Peter O'Gorman d58dead8c2 configure: Regenerate for new libtool.
* configure: Regenerate for new libtool.
        * Makefile.in: Ditto.

Co-Authored-By: Steve Ellcey <sje@cup.hp.com>

From-SVN: r140704
2008-09-26 16:35:33 +00:00
Jerry DeLisle 105b713696 re PR fortran/37498 (Incorrect array value returned - 4.3 ABI Broken)
2008-09-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37498
	* list_read.c (eat_separator): Revert previous patch and move
	delim_status, decimal_status, and pad_status to gfc_unit.
	(parse_real): Ditto. (read_real): Ditto.
	* read.c (read_a): Likewise. (read_a_char4): Likewise.
	(read_f): Likewise.
	* inquire.c (inquire_via_unit): Add missing check for
	IOPARM_INQUIRE_HAS_FLAGS2. (inquire_via_filename): Likewise.
	* io.h (unit_sign_s): Move delim_status, decimal_status, and pad_status
	to gfc_unit.
	* transfer.c (read_sf): Ditto. (read_block_form): Ditto.
	(formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto.
	* write.c (write_default_char4): Ditto. (write_utf8_char4): Ditto.
	(write_character): Ditto. (write_real_g0): Ditto.
	(list_formatted_write_scalar): Ditto. (nml_write_obj): Ditto.
	(namelist_write): Ditto.
	* write_float.def (calculate_sign): Ditto. (output_float): Ditto.

From-SVN: r140684
2008-09-26 06:19:42 +00:00
Tobias Burnus 5fb41e29c6 options.c (set_default_std_flags,gfc_init_options): Add comment: keep in sync with libgfortran.
2008-09-24  Tobias Burnus  <burnus@net-b.de>

        * options.c (set_default_std_flags,gfc_init_options):
        Add comment: keep in sync with libgfortran.

2008-09-24  Tobias Burnus  <burnus@net-b.de>

        * runtime/compile_options.c (init_compile_options):
        Sync flags with front end.

From-SVN: r140625
2008-09-24 09:08:22 +02:00
Jerry DeLisle d7445152be re PR fortran/37498 (Incorrect array value returned - 4.3 ABI Broken)
2008-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR fortran/37498
	* trans-io.c (gfc_build_io_library_fndecls): Bump pad size.
	(build_dt): Set mask bit for IOPARM_dt_f2003.
	* ioparm.def: Add IOPARM_dt_f2003.

2008-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37498
	* file_pos (st_endfile): Clear memory only for libfortran 4.3 private
	area.
	* list_read.c (eat_separator): Only access F2003 I/O parameters if
	IOPARM_DT_HAS_F2003 bit is set. (parse_real): Ditto.
	(read_real): Ditto.
	* read.c (read_a): Likewise. (read_a_char4): Likewise though not
	strictly necessary. (read_f): Likewise.
	* io.h (unit_sign_s): New enumerator to allow duplication of
	st_parameter structures. (IOPARM_DT_HAS_F2003): New mask bit.
	(st_parameter_43): New structure copied from 4.3 version of 
	st_paramater_dt private section. (st_parameter_44): New structure with
	F2003 items added. (st_parameter_dt): Modified to create union of new
	and old structures to allow correct memory setting for 4.3 ABI
	compatibility. Bumped the pad size.
	* transfer.c (read_sf): Do not use F2003 I/O memory areas unless
	IOPARM_DT_HAS_F2003 bit has been set. (read_block_form): Ditto.
	(formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto and
	add comment, fix formatting.
	* write.c (write_default_char4): Likewise though not strictly necessary.
	(write_utf8_char4): Ditto. (write_character): Ditto.
	(write_real_g0): Ditto. (list_formatted_write_scalar): Ditto.
	(nml_write_obj): Ditto. (namelist_write): Ditto.
	* write_float.def (calculate_sign): Eliminate warning by including all
	cases in switch. (output_float): Output only decimal point of F2003 flag
	is not set.

From-SVN: r140576
2008-09-23 03:52:19 +00:00
Tobias Burnus 7666351c39 mk-sik-inc.sh: Make -Wunused-variable proof.
2008-09-10  Tobias Burnus  <burnus@net-b.de>
            H. J. Lu  <hongjiu.lu@intel.com>

        * mk-sik-inc.sh: Make -Wunused-variable proof.
        * mk-srk-inc.sh: Make -Wunused-variable proof.


Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>

From-SVN: r140239
2008-09-10 19:18:08 +02:00
Tobias Burnus b554826c78 mk-kinds-h.sh: Make -Wunused-variable proof.
2008-09-10  Tobias Burnus  <burnus@net-b.de>

       * mk-kinds-h.sh: Make -Wunused-variable proof.

From-SVN: r140237
2008-09-10 18:39:15 +02:00
Thomas Koenig fd7f975423 re PR fortran/37203 (Check ORDER= of RESHAPE)
2008-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37203
	* intrinsics/reshape_generic.c:  Add checking on
	out-of-bounds and duplicate values of order argument.
	* m4/reshape.m4:  Likewise.
	* generated/reshape_c10.c: Regenerated.
	* generated/reshape_c16.c: Regenerated.
	* generated/reshape_c4.c: Regenerated.
	* generated/reshape_c8.c: Regenerated.
	* generated/reshape_i16.c: Regenerated.
	* generated/reshape_i4.c: Regenerated.
	* generated/reshape_i8.c: Regenerated.
	* generated/reshape_r10.c: Regenerated.
	* generated/reshape_r16.c: Regenerated.
	* generated/reshape_r4.c: Regenerated.
	* generated/reshape_r8.c: Regenerated.

2008-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37203
	* gfortran.d/reshape_order_1.f90:  New test case.
	* gfortran.d/reshape_order_2.f90:  New test case.
	* gfortran.d/reshape_order_3.f90:  New test case.
	* gfortran.d/reshape_order_4.f90:  New test case.

From-SVN: r140086
2008-09-07 13:33:18 +00:00
Tobias Burnus 9731c4a348 libgfortran.h (likely,unlikely): New makros.
2008-09-06  Tobias Burnus  <burnus@net-b.de>

	* libgfortran.h (likely,unlikely): New makros.
	(runtime_warning_at,__mingw_snprintf): Add __attribute__(format()).
	* m4/spread.m4 (spread_'rtype_code`): Use unlikely for bounds_check.
	* m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Ditto.
	* m4/matmull.m4 (matmul_'rtype_code`): Ditto.
	* m4/ifunction_logical.m4 (name`'rtype_qual`_'atype_code): Ditto.
	* m4/ifunction.m4 (name`'rtype_qual`_'atype_code): Ditto.
	* m4/matmul.m4 (matmul_'rtype_code`): Ditto.

	* generated/minval_r8.c: Regenerated.
	* generated/spread_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/any_l16.c: Regenerated.
	* generated/spread_i8.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/any_l2.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/all_l1.c: Regenerated.
	* generated/matmul_r8.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/spread_i1.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/matmul_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/all_l2.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/spread_c10.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/spread_r4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/matmul_c8.c: Regenerated.
	* generated/all_l16.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/spread_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/count_4_l.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/count_8_l.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/matmul_i8.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/spread_c4.c: Regenerated.
	* generated/matmul_c16.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/matmul_r10.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/matmul_l4.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/matmul_i1.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/spread_i16.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/spread_i4.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/matmul_r4.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/count_1_l.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/matmul_i2.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/matmul_c10.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/matmul_l16.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/sum_r8.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/matmul_c4.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/spread_r8.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/spread_r16.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/count_16_l.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/count_2_l.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/matmul_i4.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/spread_c8.c: Regenerated.
	* generated/matmul_i16.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/any_l1.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/matmul_l8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/spread_c16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.

From-SVN: r140060
2008-09-06 16:53:26 +02:00
Jerry DeLisle 900e887f6d re PR fortran/37228 (F2008: Support g0.<d> edit descriptor)
2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/37228
	* io.c (check_format): Allow specifying precision with g0 format.

2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37301
	PR libfortran/37228
	* io/io.h (write_real_g0): Declare new function to handle g0.d format.
	* io/transfer.c (formatted_transfer_scalar): Use new function.
	* io/format.c (parse_format_list): Enable g0.d.
	* io/write.c (write_a_char4): Delete unused var.
	(set_fnode_default): New function to set the default fnode w, d, and e
	factored from write_real. (write_real): Use new factored function.
	(write_real_g0): New function that sets d to that passed by g0.d format
	specifier and set format to ES.  Default values for w and e are used
	from the new function, set_fnode_default.

2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/37228
	* gfortran.dg/fmt_g0_4.f08: Revised test.

From-SVN: r139886
2008-09-02 10:50:13 +02:00
Jerry DeLisle 4e2eb53c13 error.c: Fix cast for printf.
2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* runtime/error.c: Fix cast for printf.

From-SVN: r139880
2008-09-02 01:14:04 +00:00
Jerry DeLisle 8c8627c472 re PR fortran/36895 (Namelist writting to internal files: Control characters wrong?)
2008-08-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/36895
	* io/write.c (namelist_write_newline): New function to correctly mark
	next records in both external and internal units.
	(nml_write_obj): Use new function.
	(namelist_write: Use new function.

From-SVN: r139813
2008-08-31 00:04:33 +00:00
Tobias Burnus cfd648ca23 re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8")
2008-08-19  Tobias Burnus  <burnus@net-b.de>

       PR libfortran/35863
       * io/write.c (write_a_char4): Add missing variable declaration
       in HAVE_CRLF block.

From-SVN: r139223
2008-08-19 08:00:51 +02:00
Jerry DeLisle 3ae86bf4f4 re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8")
2008-08-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35863
	* intrinsics/selected_char_kind.c: Enable iso_10646.
	* io/read.c (typedef uchar): New type.
	(read_utf8): New function to read a single UTF-8 encoded character.
	(read_utf8_char1): New function to read UTF-8 into a KIND=1 string.
	(read_default_char1): New functio to read default into KIND=1 string.
	(read_utf8_char4): New function to read UTF-8 into a KIND=4 string.
	(read_default_char4): New function to read UTF-8 into a KIND=4 string.
	(read_a): Modify to use the new functions.
	(read_a_char4): Modify to use the new functions.
	* io/write.c (error.h): Add include. (typedef uchar): New type.
	(write_default_char4): New function to default write KIND=4 string.
	(write_utf8_char4): New function to UTF-8 write KIND=4 string.
	(write_a_char4): Modify to use new functions.
	(write_character): Modify to use new functions.

From-SVN: r139147
2008-08-16 03:38:31 +00:00
H.J. Lu 6f010296a4 re PR libfortran/37123 (libfortran failed to build)
2008-08-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR libfortran/37123
	* intrinsics/cshift0.c (cshift0): Fix 2 typos.

From-SVN: r139117
2008-08-14 14:36:31 -07:00
Thomas Koenig c2b00cdcaa re PR libfortran/36886 (misaligment for cshift of character)
2008-08-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/36886
	* Makefile.am:  Added $(i_cshift0_c).
	Added $(i_cshift0_c) to gfor_built_specific_src.
	Add rule to build from cshift0.m4.
	* Makefile.in:  Regenerated.
	* libgfortran.h:  Addedd prototypes for cshift0_i1,
	cshift0_i2, cshift0_i4, cshift0_i8, cshift0_i16,
	cshift0_r4, cshift0_r8, cshift0_r10, cshift0_r16,
	cshift0_c4, cshift0_c8, cshift0_c10, cshift0_c16.
	Define Macros GFC_UNALIGNED_C4 and GFC_UNALIGNED_C8.
	* intrinsics/cshift0.c:  Remove helper functions for
	the innter shift loop.
	(cshift0):  Call specific functions depending on type
	of array argument.  Only call specific functions for
	correct alignment for other types.
	* m4/cshift0.m4:  New file.
	* generated/cshift0_i1.c:  New file.
	* generated/cshift0_i2.c:  New file.
	* generated/cshift0_i4.c:  New file.
	* generated/cshift0_i8:.c  New file.
	* generated/cshift0_i16.c:  New file.
	* generated/cshift0_r4.c:  New file.
	* generated/cshift0_r8.c:  New file.
	* generated/cshift0_r10.c:  New file.
	* generated/cshift0_r16.c:  New file.
	* generated/cshift0_c4.c:  New file.
	* generated/cshift0_c8.c:  New file.
	* generated/cshift0_c10.c:  New file.
	* generated/cshift0_c16.c:  New file.

2008-08-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/36886
	* gfortran.dg/cshift_char_3.f90:  New test case.
	* gfortran.dg/cshift_nan_1.f90:  New test case.

From-SVN: r139111
2008-08-14 18:31:32 +00:00
Jerry DeLisle 10347b0b8c re PR fortran/36582 (Namelist I/O error: Bogus "Cannot match namelist object")
2008-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36582
	* io/list_read.c: If variable rank is zero, do not adjust the found
	namelist object pointer. Fix ChangeLog.

From-SVN: r138914
2008-08-09 19:17:24 +00:00
Tobias Burnus 0d52899f78 re PR fortran/36132 (_gfortran_internal_pack on optional arguments)
2008-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36132
        PR fortran/29952
        PR fortran/36909
        * trans.c (gfc_trans_runtime_check): Allow run-time warning
        * besides
        run-time error.
        * trans.h (gfc_trans_runtime_check): Update declaration.
        * trans-array.c
        * (gfc_trans_array_ctor_element,gfc_trans_array_bound_check,
        gfc_conv_array_ref,gfc_conv_ss_startstride,gfc_trans_dummy_array_bias):
        Updated gfc_trans_runtime_check calls.
        (gfc_conv_array_parameter): Implement flag_check_array_temporaries,
        fix packing/unpacking for nonpresent optional actuals to optional
        formals.
        * trans-array.h (gfc_conv_array_parameter): Update declaration.
        * trans-expr.c (gfc_conv_substring,gfc_trans_arrayfunc_assign,
        gfc_conv_function_call): Updated gfc_trans_runtime_check calls.
        (gfc_conv_function_call): Update gfc_conv_array_parameter calls.
        * trans-expr.c (gfc_trans_goto): Updated gfc_trans_runtime_check
        calls.
        * trans-io.c (set_string,gfc_conv_intrinsic_repeat): Ditto.
        (gfc_conv_intrinsic_transfer,gfc_conv_intrinsic_loc): Same for
        gfc_conv_array_parameter.
        * trans-intrinsics.c (gfc_conv_intrinsic_bound): Ditto.
        * trans-decl.c (gfc_build_builtin_function_decls): Add
        gfor_fndecl_runtime_warning_at.
        * lang.opt: New option fcheck-array-temporaries.
        * gfortran.h (gfc_options): New flag_check_array_temporaries.
        * options.c (gfc_init_options, gfc_handle_option): Handle flag.
        * invoke.texi: New option fcheck-array-temporaries.

2008-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36132
        PR fortran/29952
        PR fortran/36909
        * runtime/error.c: New function runtime_error_at.
        * gfortran.map: Ditto.
        * libgfortran.h: Ditto.

2008-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36132
        PR fortran/29952
        PR fortran/36909
        gfortran.dg/internal_pack_4.f90: New.
        gfortran.dg/internal_pack_5.f90: New.
        gfortran.dg/array_temporaries_2.f90: New.

From-SVN: r138186
2008-07-27 12:45:44 +02:00
Jerry DeLisle ac834957b9 re PR fortran/36582 (Namelist I/O error: Bogus "Cannot match namelist object")
2008-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36852
	* io/list_read.c: If variable rank is zero, do not adjust the found
	namelist object pointer.

From-SVN: r138072
2008-07-23 04:29:15 +00:00
Daniel Kraft 9cad01cefb re PR fortran/29835 (Error message of unknown edit descriptor needs improvement)
2008-07-22  Daniel Kraft  <d@domob.eu>

	PR fortran/29835
	* io.c (error_element), (format_locus):  New static globals.
	(unexpected_element):  Spelled out this message fully.
	(next_char):  Keep track of locus when not MODE_STRING.
	(next_char_not_space):  Remember last parsed element in error_element.
	(format_lex):  Fix two indentation errors.
	(check_format):  Use format_locus and possibly error_element for a
	slightly better error message on invalid format.
	(check_format_string):  Set format_locus to start of the string
	expression used as format.

2008-07-22  Daniel Kraft  <d@domob.eu>

	PR fortran/29835
	* io/format.c (struct format_data):  New member error_element.
	(unexpected_element):  Added '%c' to message.
	(next_char):  Keep track of last parsed character in fmt->error_element.
	(format_error):  If the message is unexpected_element, output the
	offending character, too.

2008-07-22  Daniel Kraft  <d@domob.eu>

	PR fortran/29835
	* gfortran.dg/fmt_error_3.f90:  New test.
	* gfortran.dg/fmt_error_4.f90:  New test.
	* gfortran.dg/fmt_error_5.f90:  New test.

From-SVN: r138063
2008-07-22 19:05:55 +02:00
Thomas Koenig 4a799ae7a6 re PR fortran/36890 (libgfortran/io/file_pos.c:55: warning: comparison between signed and unsigned)
2008-07-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/36890
	* io/file_pos.c:  Declare READ_CHUNK as signed to avoid
	signed/unsigned comparison warning in formatted_backspace.

From-SVN: r138050
2008-07-22 10:27:10 +00:00
Thomas Koenig c44109aaf3 re PR libfortran/36773 (zero-sized arrays with cshift and eoshift)
2008-07-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/36773
	* intrinsics/cshift0.c (cshift0):  Return early if size of array
	is zero.
	* intrinsics/eoshift0.c (eoshift0):  Return early if size of
	return array is zero.
	* intrinsics/eoshift2.c (eoshift2):  Likewise.
	* m4/eoshift1.m4 (eoshift1):  Return early if size of array
	is zero.
	* m4/eoshift3.m4 (eoshift3):  Likewise.
	* m4/eoshift2.m4 (eoshift2):  Return early if size of return
	array is zero.
	* m4/eoshift4.m4 (eoshift2):  Return early if size of return
	array is zero.
	* generated/cshift1_16.c: Regenerated.
	* generated/cshift1_4.c: Regenerated.
	* generated/cshift1_8.c: Regenerated.
	* generated/eoshift1_16.c: Regenerated.
	* generated/eoshift1_4.c: Regenerated.
	* generated/eoshift1_8.c: Regenerated.
	* generated/eoshift3_16.c: Regenerated.
	* generated/eoshift3_4.c: Regenerated.
	* generated/eoshift3_8.c: Regenerated.

2008-07-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/36773
	* gfortran.dg/zero_sized_5.f90:  New test case.

From-SVN: r138027
2008-07-21 10:05:32 +00:00
Jerry DeLisle 302b150e73 re PR libfortran/36857 (Non-English locale breaks gfortran float formatting ("printf is broken"))
2008-07-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36857
	* io/write_float.def: Comment out locale dependent code and fix general
	comments.

From-SVN: r138021
2008-07-21 04:44:10 +00:00
Thomas Koenig 9ad13e9169 re PR fortran/36341 (MATMUL: Bounds check missing)
2008-07-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/36341
	PR fortran/34670
	* m4/matmul.m4:  Add bounds checking.
	* m4/matmull.m4:  Likewise.
	* generated/matmul_c10.c: Regenerated.
	* generated/matmul_c16.c: Regenerated.
	* generated/matmul_c4.c: Regenerated.
	* generated/matmul_c8.c: Regenerated.
	* generated/matmul_i1.c: Regenerated.
	* generated/matmul_i16.c: Regenerated.
	* generated/matmul_i2.c: Regenerated.
	* generated/matmul_i4.c: Regenerated.
	* generated/matmul_i8.c: Regenerated.
	* generated/matmul_l16.c: Regenerated.
	* generated/matmul_l4.c: Regenerated.
	* generated/matmul_l8.c: Regenerated.
	* generated/matmul_r10.c: Regenerated.
	* generated/matmul_r16.c: Regenerated.
	* generated/matmul_r4.c: Regenerated.
	* generated/matmul_r8.c: Regenerated.

2008-07-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/36341
	PR fortran/34670
	* gfortran.dg/matmul_bounds_2.f90:  New test.
	* gfortran.dg/matmul_bounds_3.f90:  New test.
	* gfortran.dg/matmul_bounds_4.f90:  New test.
	* gfortran.dg/matmul_bounds_5.f90:  New test.

From-SVN: r137594
2008-07-07 19:43:33 +00:00
Ralf Wildenhues 10465436b5 acinclude.m4 (LIBGFOR_CHECK_GTHR_DEFAULT): Fix configure cache variable name.
libgfortran/
	* acinclude.m4 (LIBGFOR_CHECK_GTHR_DEFAULT): Fix configure cache
	variable name.
	* configure: Regenerate.

From-SVN: r137592
2008-07-07 19:16:18 +00:00
Jerry DeLisle bdd3085e66 re PR fortran/36676 (Namelist Comments Problems)
2008-07-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36676
	* io/list_read.c (find_nml_name): Use eat_separator instead of eat_line.

From-SVN: r137334
2008-07-02 03:58:57 +00:00
Jerry DeLisle 7b063fdc13 re PR libfortran/36657 (Namelist reading bug with string constant immediately followed by comment)
2008-06-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36657
	* io/list_read.c (read_character): Check for '!' along with separators.
	(find_nml_name): Likewise and eat the comment if found.

From-SVN: r137236
2008-06-28 21:46:53 +00:00
Ralf Wildenhues 18c04407bf Makefile.tpl ($(srcdir)/configure): Update dependencies.
* Makefile.tpl ($(srcdir)/configure): Update dependencies.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

config/
	* override.m4: Use m4_version_prereq throughout.
	(_AC_ARG_VAR_VALIDATE, AC_MSG_FAILURE): Backport from git
	Autoconf: output pwd along with fatal errors, so the right
	config.log file is hinted at more prominently.
	(PARSE_ARGS): Push setting of ac_pwd in this diversion.
	(_GCC_AUTOCONF_VERSION): New, define to 2.59 if not defined.
	(_GCC_AUTOCONF_VERSION_CHECK): New macro, require use of Autoconf
	version _GCC_AUTOCONF_VERSION throughout the tree.
	(m4_wrap): New override, fix for Posix semantics of m4wrap.

libgcc/
	* configure.ac: sinclude override.m4.
	* configure: Regenerate.

gnattools/
	* configure.ac: move sinclude of acx.m4 before AC_INIT,
	also sinclude override.m4.
	* Makefile.in ($(srcdir)/configure): Update dependencies.
	* configure: Regenerate.

libada/
	* configure.ac: move sinclude of acx.m4 before AC_INIT,
	also sinclude override.m4.
	* Makefile.in ($(srcdir)/configure): Update dependencies.
	* configure: Regenerate.

intl/
	* configure: Regenerate.

libiberty/
	* configure: Regenerate.

boehm-gc/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* include/gc_config.h.in: Regenerate.

fixincludes/
	* configure: Regenerate.

gcc/
	* configure: Regenerate.

libcpp/
	* Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
	* configure: Regenerate.

libdecnumber/
	* Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
	* configure: Regenerate.

libffi/
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgfortran/
	* configure: Regenerate.

libgomp/
	* configure: Regenerate.

libjava/classpath/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* doc/api/Makefile.in: Regenerate.
	* examples/Makefile.in: Regenerate.
	* external/Makefile.in: Regenerate.
	* external/jsr166/Makefile.in: Regenerate.
	* external/relaxngDatatype/Makefile.in: Regenerate.
	* external/sax/Makefile.in: Regenerate.
	* external/w3c_dom/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* lib/Makefile.in: Regenerate.
	* native/Makefile.in: Regenerate.
	* native/fdlibm/Makefile.in: Regenerate.
	* native/jawt/Makefile.in: Regenerate.
	* native/jni/Makefile.in: Regenerate.
	* native/jni/classpath/Makefile.in: Regenerate.
	* native/jni/gconf-peer/Makefile.in: Regenerate.
	* native/jni/gstreamer-peer/Makefile.in: Regenerate.
	* native/jni/gtk-peer/Makefile.in: Regenerate.
	* native/jni/java-io/Makefile.in: Regenerate.
	* native/jni/java-lang/Makefile.in: Regenerate.
	* native/jni/java-net/Makefile.in: Regenerate.
	* native/jni/java-nio/Makefile.in: Regenerate.
	* native/jni/java-util/Makefile.in: Regenerate.
	* native/jni/midi-alsa/Makefile.in: Regenerate.
	* native/jni/midi-dssi/Makefile.in: Regenerate.
	* native/jni/native-lib/Makefile.in: Regenerate.
	* native/jni/qt-peer/Makefile.in: Regenerate.
	* native/jni/xmlj/Makefile.in: Regenerate.
	* native/plugin/Makefile.in: Regenerate.
	* resource/Makefile.in: Regenerate.
	* scripts/Makefile.in: Regenerate.
	* tools/Makefile.in: Regenerate.

libjava/
	* configure: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libjava/libltdl/
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libmudflap/
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libobjc/
	* configure: Regenerate.

libssp/
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.

libstdc++-v3/
	* configure: Regenerate.

zlib/
	* Makefile.in: Regenerate.
	* configure: Regenerate.

From-SVN: r136876
2008-06-17 23:13:35 +00:00
Jerry DeLisle fb669c2b42 re PR libfortran/36546 (Namelist error with tab following a comma and newline)
2008-06-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36546
	* io/list_read.c (eat_separator): Add tab character to condition
	for looping past whitespace.

From-SVN: r136859
2008-06-17 04:14:07 +00:00
Jerry DeLisle a9608b5743 re PR fortran/36515 (Integer read from stdin yields a value overflow for a valid integer.)
2008-06-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36515
	* libgfortran.h (compile_options_t): Add int range_check to structure.
	* runtime/compile_options.c (set_options): Add range_check option.
	(init_compile_options): Likewise.
	*io/read.c (read_decimal): Change overflow checks to include
	range_check.

From-SVN: r136822
2008-06-15 20:02:58 +00:00
Jerry DeLisle a82094b70d re PR libfortran/36538 (namelist failure with tabs preceding object name)
2008-06-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36538
	* io/list_read.c (namelist_read): Add eat_separator to eliminate leading
	tabs.

From-SVN: r136776
2008-06-14 04:30:48 +00:00
Jerry DeLisle 7f7e76a4ee Add missing entry.
From-SVN: r136767
2008-06-13 20:55:35 +00:00
Jerry DeLisle cea93abbe2 re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8")
2008-06-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/35863
	* libgfortran.h: Change l8_to_l4_offset to big_endian and add endian_off.
	* runtime/main.c: Fix error in comment. Change l8_to_l4_offset to
	big_endian. (determine_endianness): Add endian_off and set its value
	according to big_endian.
	* gfortran.map: Add symbol for new _gfortran_transfer_character_wide.
	* io/io.h: Add prototype declarations for new functions.
	* io/list_read.c (list_formatted_read_scalar): Modify to handle kind=4.
	(list_formatted_read): Calculate stride based on kind for character type
	and use it when calling list_formatted_read_scalar.
	* io/inquire.c (inquire_via_unit): Change l8_to_l4_offset to big_endian.
	* io/open.c (st_open): Change l8_to_l4_offset to big_endian.
	* io/read.c (read_a_char4): New function to handle formatted read.
	* io/write.c: Define GFC_CHAR4(x) to improve readability of code.
	(write_a_char4): New function to handle formatted write.
	(write_character): Modify to accept the kind parameter and adjust for
	endianess of the machine. (list_formatted_write): Calculate the stride
	resulting from the kind and adjust the list_formatted_write_scalar call
	accordingly. (nml_write_obj): Adjust calls to write_character.
	(namelist_write): Likewise.
	* io/transfer.c (formatted_transfer_scaler): Rename 'len' argument to
	'kind' argument to better describe what it is. Add calls to new
	functions for kind == 4. (formatted_transfer): Modify to handle the case
	of type character and kind equals 4 to pass in the kind to the transfer
	routines. (transfer_character_wide): Add this new function.
	(transfer_array): Don't set kind to the character string length. Adjust
	strides bases on character kind.
	(unformatted_read): Adjust size based on kind for character types.
	(unformatted_write): Likewise. (data_transfer_init): Change
	l8_to_l4_offset to big_endian.

From-SVN: r136763
2008-06-13 20:28:08 +00:00
Tobias Burnus c5f4d1cc2f configure.ac (AM_CFLAGS): Remove -Werror again.
2008-06-13  Tobias Burnus  <burnus@net-b.de>

       * configure.ac (AM_CFLAGS): Remove -Werror again.
       * configure: Regenerate.

From-SVN: r136762
2008-06-13 21:29:22 +02:00
Tobias Burnus 60dcf38a00 re PR fortran/36518 (libgfortran: "warning: format '%d' expects type 'int', but")
2008-06-13  Tobias Burnus  <burnus@net-b.de>

        PR libgfortran/36518
        * configure.ac (AM_CFLAGS): Add -Werror.
        * configure: Regenerate.
        * m4/ifunction_logical.m4: Cast "n" to "(int)".
        * generated/any_l16.c: Regenerate.
        * generated/any_l2.c: Regenerate.
        * generated/all_l1.c: Regenerate.
        * generated/all_l2.c: Regenerate.
        * generated/all_l16.c: Regenerate.
        * generated/any_l4.c: Regenerate.
        * generated/count_4_l.c: Regenerate.
        * generated/count_8_l.c: Regenerate.
        * generated/all_l4.c: Regenerate.
        * generated/count_1_l.c: Regenerate.
        * generated/count_16_l.c: Regenerate.
        * generated/any_l8.c: Regenerate.
        * generated/count_2_l.c: Regenerate.
        * generated/any_l1.c: Regenerate.
        * generated/all_l8.c: Regenerate.

From-SVN: r136761
2008-06-13 20:43:25 +02:00
Tobias Burnus c3e9b6abf8 re PR fortran/36495 (libgfortran should be build with FCFLAGS -fimplicit-none)
2008-06-13  Tobias Burnus  <burnus@net-b.de>

       PR fortran/36495
       * configure: Add "-Werror -fimplicit-none" to the AM_FCFLAGS.
       * configure.ac: Ditto.
       * intrinsics/dprod_r8.f90: Add "implicit none".

From-SVN: r136740
2008-06-13 09:10:15 +02:00
Jerry DeLisle 9355110f96 re PR fortran/36420 (Fortran 2008: g0 edit descriptor)
2008-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/36420
	PR libfortran/36421
	PR libfortran/36422
	* io/io.h: Add prototype for write_real.
	* io/transfer.c (formatted_transfer_scalar): For FMT_G and width zero,
	use write_real.
	* io/format.c: Add zero width error message. (parse_format_list): Use
	error message for FMT_A if followed by FMT_ZERO. Use zero width error
	message	for FMT_G if mode is READ or if -std=f95 or f2003. (fmormat0):
	Fix typo in comment.
	* io/write.c (write_a): Set wlen to len if FMT_G and length is zero.
	(write_l): Add wlen variable and use it if FMT_G and width is zero.
	(write_decimal): If FMT_G, set m to -1 to flag processor dependent
	formatting. (write_real): Remove static declaration.

From-SVN: r136545
2008-06-07 23:59:53 +00:00
Francois-Xavier Coudert 691da334bc re PR fortran/36319 (Segfault with wide characters in DATA)
PR fortran/36319

	* intrinsic.c (gfc_convert_chartype): Don't mark conversion
	function as pure.
	* trans-array.c (gfc_trans_array_ctor_element): Divide element
	size by the size of one character to obtain length.
	* iresolve.c (gfc_resolve_cshift): Call the _char4 variant when
	appropriate.
	(gfc_resolve_eoshift): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Minor beautification.
	(gfc_conv_intrinsic_fdate): Minor beautification.
	(gfc_conv_intrinsic_ttynam): Minor beautification.
	(gfc_conv_intrinsic_minmax_char): Allow all character kinds.
	(size_of_string_in_bytes): New function.
	(gfc_conv_intrinsic_size): Call size_of_string_in_bytes for
	character expressions.
	(gfc_conv_intrinsic_sizeof): Likewise.
	(gfc_conv_intrinsic_array_transfer): Likewise.
	(gfc_conv_intrinsic_trim): Allow all character kinds. Minor
	beautification.
	(gfc_conv_intrinsic_repeat): Fix comment typo.
	* simplify.c (gfc_convert_char_constant): Take care of conversion
	of array constructors.

	* intrinsics/string_intrinsics_inc.c (string_index): Return
	correct value for zero-length substring.
	* intrinsics/cshift0.c: Add _char4 variant.
	* intrinsics/eoshift0.c (eoshift0): Allow filler to be a pattern
	wider than a single byte. Add _char4 variant and use above
	functionality.
	* intrinsics/eoshift2.c (eoshift2): Likewise.
	* m4/eoshift1.m4: Likewise.
	* m4/eoshift3.m4: Likewise.
	* m4/cshift1.m4: Add _char4 variants.
	* gfortran.map (GFORTRAN_1.1): Add _gfortran_cshift0_1_char4,
	_gfortran_cshift0_2_char4, _gfortran_cshift0_4_char4,
	_gfortran_cshift0_8_char4, _gfortran_cshift1_16_char4,
	_gfortran_cshift1_4_char4, _gfortran_cshift1_8_char4,
	_gfortran_eoshift0_1_char4, _gfortran_eoshift0_2_char4,
	_gfortran_eoshift0_4_char4, _gfortran_eoshift0_8_char4,
	_gfortran_eoshift1_16_char4, _gfortran_eoshift1_4_char4,
	_gfortran_eoshift1_8_char4, _gfortran_eoshift2_1_char4,
	_gfortran_eoshift2_2_char4, _gfortran_eoshift2_4_char4,
	_gfortran_eoshift2_8_char4, _gfortran_eoshift3_16_char4,
	_gfortran_eoshift3_4_char4 and _gfortran_eoshift3_8_char4.
	* generated/eoshift3_4.c: Regenerate.
	* generated/eoshift1_8.c: Regenerate.
	* generated/eoshift1_16.c: Regenerate.
	* generated/cshift1_4.c: Regenerate.
	* generated/eoshift1_4.c: Regenerate.
	* generated/eoshift3_8.c: Regenerate.
	* generated/eoshift3_16.c: Regenerate.
	* generated/cshift1_8.c: Regenerate.
	* generated/cshift1_16.c: Regenerate.

	* gfortran.dg/widechar_5.f90: New file.
	* gfortran.dg/widechar_6.f90: New file.
	* gfortran.dg/widechar_7.f90: New file.
	* gfortran.dg/widechar_intrinsics_5.f90: Uncomment the lines
	testing the SPREAD intrinsic.
	* gfortran.dg/widechar_intrinsics_6.f90: New file.
	* gfortran.dg/widechar_intrinsics_7.f90: New file.
	* gfortran.dg/widechar_intrinsics_8.f90: New file.
	* gfortran.dg/widechar_intrinsics_9.f90: New file.
	* gfortran.dg/widechar_intrinsics_10.f90: New file.

From-SVN: r136129
2008-05-28 21:11:39 +00:00
Tobias Burnus 5ec81069e5 re PR fortran/32600 ([ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function)
2008-05-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/32600
        * trans-expr.c (gfc_conv_function_call): Remove library
        call for c_f_pointer with scalar Fortran pointers and for
        c_f_procpointer.

2008-05-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/32600
        * intrinsics/iso_c_binding.c (c_f_procpointer): Remove.
        * intrinsics/iso_c_binding.h (c_f_procpointer): Remove.
        * gfortran.map (c_f_procpointer): Remove.

2008-05-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/32600
        * gfortran.dg/c_f_pointer_tests_3.f90: New.

From-SVN: r135877
2008-05-25 19:52:03 +02:00
Thomas Koenig 143350a8e2 re PR libfortran/36302 (cshift and eoshift missing some kind=16 functions)
2008-05-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libgfortran/36302
	* gfortran.map (GFORTRAN_1.1): Add _gfortran_eoshift0_16,
	_gfortran_eoshift0_16_char, _gfortran_eoshift2_16,
	_gfortran_eoshift2_16_char,_gfortran_cshift0_16,
	_gfortran_cshift0_16_char.  Sort alphabetically.
	* intrinsics/eoshift0.c:  Add function for kind=16 integer.
	* intrinsics/eoshift2.c:  Likewise.
	* intrinsics/cshift0.c:  Likewise.

2008-05-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libgfortran/36302
	* gfortran.dg/cshift_large_1.f90:  New test.
	* gfortran.dg/eoshift_large_1.f90:  New test.

From-SVN: r135777
2008-05-22 21:55:43 +00:00
Tobias Burnus f762576608 Update ChangeLog which was forgotten in the check in:
> r135512 | tkoenig | 2008-05-18 22:39:04 +0200 (Sun, 18 May 2008) | 158 lines

From-SVN: r135513
2008-05-18 23:44:42 +02:00
Thomas Koenig 5863aacf5b in_pack.m4 (internal_pack_'rtype_code`): Destination pointer is restrict.
2008-05-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* m4/in_pack.m4 (internal_pack_'rtype_code`):  Destination
	pointer is restrict.
	* m4/transpose.m4 (transpose_'rtype_code`):  Likewise.
	* m4/pack.m4 (pack_'rtype_code`):  Likewise.
	* m4/spread.m4 (spread_'rtype_code`):  Likewise.
	(spread_scalar_'rtype_code`): Likewise.
	* m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Likewise.
	* m4/eoshift1.m4 (eoshift1):  Likewise.
	* m4/eoshift3.m4 (eoshift3):  Likewise.
	* m4/in_unpack.m4 (internal_unpack_'rtype_ccode`):  Likewise.
	* m4/unpack.m4 (unpack0_'rtype_code`):  Likewise.
	(unpack1_'rtype_code`):  Likewise.
	* intrinsics/pack_generic.c (pack_generic.c):  Likewise.
	* intrinsics/unpack_generic.c (unpack_internal):  Likewise.
	* intrinsics/eoshift0.c (eoshift0):  Likewise.
	* intrinsics/eoshift2.c (eoshift2):  Likewise.
	* intrinsics/reshape_generic.c (reshape_internal):  Likewise.
	* intrinsics/reshape_packed.c (reshape_packed):  Likewise.
	* generated/eoshift1_16.c: Regenerated.
	* generated/eoshift1_4.c: Regenerated.
	* generated/eoshift1_8.c: Regenerated.
	* generated/eoshift3_16.c: Regenerated.
	* generated/eoshift3_4.c: Regenerated.
	* generated/eoshift3_8.c: Regenerated.
	* generated/in_pack_c10.c: Regenerated.
	* generated/in_pack_c16.c: Regenerated.
	* generated/in_pack_c4.c: Regenerated.
	* generated/in_pack_c8.c: Regenerated.
	* generated/in_pack_i1.c: Regenerated.
	* generated/in_pack_i16.c: Regenerated.
	* generated/in_pack_i2.c: Regenerated.
	* generated/in_pack_i4.c: Regenerated.
	* generated/in_pack_i8.c: Regenerated.
	* generated/in_pack_r10.c: Regenerated.
	* generated/in_pack_r16.c: Regenerated.
	* generated/in_pack_r4.c: Regenerated.
	* generated/in_pack_r8.c: Regenerated.
	* generated/in_unpack_c10.c: Regenerated.
	* generated/in_unpack_c16.c: Regenerated.
	* generated/in_unpack_c4.c: Regenerated.
	* generated/in_unpack_c8.c: Regenerated.
	* generated/in_unpack_i1.c: Regenerated.
	* generated/in_unpack_i16.c: Regenerated.
	* generated/in_unpack_i2.c: Regenerated.
	* generated/in_unpack_i4.c: Regenerated.
	* generated/in_unpack_i8.c: Regenerated.
	* generated/in_unpack_r10.c: Regenerated.
	* generated/in_unpack_r16.c: Regenerated.
	* generated/in_unpack_r4.c: Regenerated.
	* generated/in_unpack_r8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/pack_c10.c: Regenerated.
	* generated/pack_c16.c: Regenerated.
	* generated/pack_c4.c: Regenerated.
	* generated/pack_c8.c: Regenerated.
	* generated/pack_i1.c: Regenerated.
	* generated/pack_i16.c: Regenerated.
	* generated/pack_i2.c: Regenerated.
	* generated/pack_i4.c: Regenerated.
	* generated/pack_i8.c: Regenerated.
	* generated/pack_r10.c: Regenerated.
	* generated/pack_r16.c: Regenerated.
	* generated/pack_r4.c: Regenerated.
	* generated/pack_r8.c: Regenerated.
	* generated/spread_c10.c: Regenerated.
	* generated/spread_c16.c: Regenerated.
	* generated/spread_c4.c: Regenerated.
	* generated/spread_c8.c: Regenerated.
	* generated/spread_i1.c: Regenerated.
	* generated/spread_i16.c: Regenerated.
	* generated/spread_i2.c: Regenerated.
	* generated/spread_i4.c: Regenerated.
	* generated/spread_i8.c: Regenerated.
	* generated/spread_r10.c: Regenerated.
	* generated/spread_r16.c: Regenerated.
	* generated/spread_r4.c: Regenerated.
	* generated/spread_r8.c: Regenerated.
	* generated/transpose_c10.c: Regenerated.
	* generated/transpose_c16.c: Regenerated.
	* generated/transpose_c4.c: Regenerated.
	* generated/transpose_c8.c: Regenerated.
	* generated/transpose_i16.c: Regenerated.
	* generated/transpose_i4.c: Regenerated.
	* generated/transpose_i8.c: Regenerated.
	* generated/transpose_r10.c: Regenerated.
	* generated/transpose_r16.c: Regenerated.
	* generated/transpose_r4.c: Regenerated.
	* generated/transpose_r8.c: Regenerated.
	* generated/unpack_c10.c: Regenerated.
	* generated/unpack_c16.c: Regenerated.
	* generated/unpack_c4.c: Regenerated.
	* generated/unpack_c8.c: Regenerated.
	* generated/unpack_i1.c: Regenerated.
	* generated/unpack_i16.c: Regenerated.
	* generated/unpack_i2.c: Regenerated.
	* generated/unpack_i4.c: Regenerated.
	* generated/unpack_i8.c: Regenerated.
	* generated/unpack_r10.c: Regenerated.
	* generated/unpack_r16.c: Regenerated.
	* generated/unpack_r4.c: Regenerated.
	* generated/unpack_r8.c: Regenerated.

From-SVN: r135512
2008-05-18 20:39:04 +00:00
Francois-Xavier Coudert 3571925eb5 select.c: Moved content to select_inc.c.
* runtime/select.c: Moved content to select_inc.c. Include it. 
        Add macros for different character types.
        * runtime/select_inc.c: New file.
        * runtime/convert_char.c: New file.
        * intrinsics/pack_generic.c (pack_char4, pack_s_char4): New
        functions.
        * intrinsics/transpose_generic.c (transpose_char4): New function.
        * intrinsics/spread_generic.c (spread_char4, spread_char4_scalar):
        New functions.
        * intrinsics/unpack_generic.c (unpack1_char4, unpack0_char4): 
        New functions.
        * intrinsics/reshape_generic.c (reshape_char): Use
        gfc_charlen_type as type for length variables.
        (reshape_char4): New function.
        * gfortran.map (GFORTRAN_1.1): Add _gfortran_select_string_char4,
        _gfortran_convert_char1_to_char4, _gfortran_convert_char4_to_char1,
        _gfortran_transpose_char4, _gfortran_spread_char4,
        _gfortran_spread_char4_scalar, _gfortran_reshape_char4,
        _gfortran_pack_char4, _gfortran_pack_s_char4,
        _gfortran_unpack0_char4 and _gfortran_unpack1_char4.
        * Makefile.am: Add runtime/convert_char.c.
        * Makefile.in: Regenerate.

From-SVN: r135496
2008-05-18 12:00:20 +00:00
Thomas Koenig 51407486c4 list_read.c (list_formatted_read_scalar): Declare type as volatile to shut up compiler warning.
2008-05-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* io/list_read.c (list_formatted_read_scalar):  Declare
	type as volatile to shut up compiler warning.

From-SVN: r135480
2008-05-17 22:24:06 +00:00
Janne Blomqvist 8947fd62fa Part 1.1 of PR25561.
2008-05-15  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/25561
	* io/io.h (struct fbuf): Change pointer to position offset.
	* io/fbuf.c (fbuf_init): Reduce default size of buffer, ptr=>pos
	changes.
	(fbuf_reset): ptr=>pos changes.
	(fbuf_alloc): If the request doesn't fit, don't waste memory by
	keeping flushed bytes. ptr=>pos changes.
	(fbuf_flush): ptr=>pos changes.
	(fbuf_seek): Don't seek past the left tab limit, don't update active
	byte count.
	* io/open.c (new_unit): If RECL has been specified, used that as
	initial buffer size.

From-SVN: r135433
2008-05-16 20:42:44 +03:00
Janne Blomqvist 65686652e4 Fix fallout from part 1 of PR25561 patch.
2008-05-16  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/35632
        * io/open.c (new_unit): Set stream position to correct value.

From-SVN: r135432
2008-05-16 20:37:30 +03:00
Janne Blomqvist 3044d36951 Part 1 of PR25561, fix compile warnings forgotten in actual commit.
From-SVN: r135379
2008-05-15 19:32:00 +03:00
Janne Blomqvist 7c1b4aba72 Add fbuf.c
From-SVN: r135376
2008-05-15 18:58:20 +03:00
Janne Blomqvist f6f9ac3159 Forgot ChangeLog of part1 pr25561.
From-SVN: r135374
2008-05-15 18:55:32 +03:00
Janne Blomqvist 15877a88eb Part 1 of PR 25561.
2008-05-15  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/25561
	* Makefile.am: Add fbuf.c to gfor_io_src.
	* Makefile.in: Regenerate.
	* io/io.h (read_block): Remove.
	(struct stream): Remove alloc_r_at function pointer.
	(salloc_r): Remove.
	(salloc_r_at): Remove.
	(salloc_w_at): Remove.
	(salloc_w): Remove offset argument.
	(struct fbuf): New struct for format buffer.
	(struct gfc_unit): Add fbuf.
	(read_block_form): New prototype.
	(fbuf_init): Likewise.
	(fbuf_destroy): Likewise.
	(fbuf_reset): Likewise.
	(fbuf_alloc): Likewise.
	(fbuf_flush): Likewise.
	(fbuf_seek): Likewise.
	* io/file_pos.c (formatted_backspace): Change to use sread.
	(unformatted_backspace): Likewise.
	(st_backspace): Flush format buffer.
	(st_rewind): Likewise.
	* io/list_read.c (next_char): Likewise.
	(nml_query): Tidying, flush format buffer.
	* io/open.c (new_unit): Init format buffer.
	* io/read.c (read_l): Change to use read_block_form.
	(read_a): Likewise.
	(read_decimal): Likewise.
	(read_radix): Likewise.
	(read_f): Likewise.
	(read_x): Empty reads also for stream I/O.
	* io/transfer.c (read_sf): Change to use sread.
	(read_block): Rename to read_block_form, change prototype, use sread.
	(read_block_direct): Don't seek stream files.
	(write_block): Change to use fbuf if external file, don't seek stream
	files.
	(write_buf): Don't seek stream files.
	(formatted_transfer_scalar): Use fbuf for external files.
	(us_read): Change to use sread.
	(pre_position): Do nothing for stream I/O.
	(data_transfer_init): Flush fbuf when switching from write to read, if
	POS is specified, seek stream file to correct offset.
	(skip_record): Change to use sread.
	(min_off): New function.
	(next_record_r): Change to use sread.
	(next_record_w): Change to use sset/sseek, flush fbuf.
	(finalize_transfer): Flush fbuf.
	* io/unit.c (init_units): Init fbuf for stdout, stderr.
	(close_unit_1): Destroy fbuf.
	(finish_last_advance_record): Flush fbuf, no need to seek.
	* io/unix.c (fd_alloc_r_at): Remove unused where argument.
	(fd_alloc_w_at): Likewise.
	(fd_read): Remove third argument to fd_alloc_r_at.
	(fd_write): Remove third argument to fd_alloc_w_at.
	(fd_sset): Likewise.
	(fd_open): Don't set alloc_r_at.
	(mem_alloc_r_at): Remove unused where argument.
	(mem_alloc_w_at): Likewise.
	(mem_read): Don't incorrectly return previous errno, remove unused
	third argument to alloc function.
	(mem_write): Likewise.
	(mem_set): Likewise.
	(open_internal): Don't set alloc_r_at pointer.
	* io/fbuf.c: New file.

From-SVN: r135373
2008-05-15 18:53:34 +03:00
Francois-Xavier Coudert 4b267817ff libgfortran.h (gfc_char4_t): New type.
2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	* libgfortran.h (gfc_char4_t): New type.
	(GFC_SIZE_OF_CHAR_KIND): New macro.
	(compare_string): Adjust prototype.
	(compare_string_char4): New prototype.
	* gfortran.map (GFORTRAN_1.1): Add _gfortran_adjustl_char4,
	_gfortran_adjustr_char4, _gfortran_compare_string_char4,
	_gfortran_concat_string_char4, _gfortran_string_index_char4,
	_gfortran_string_len_trim_char4, _gfortran_string_minmax_char4,
	_gfortran_string_scan_char4, _gfortran_string_trim_char4 and
	_gfortran_string_verify_char4.
	* intrinsics/string_intrinsics_inc.c: New file from content of
	string_intrinsics.c with types replaced by macros.
	* intrinsics/string_intrinsics.c: Move content to
	string_intrinsics_inc.c.

From-SVN: r135313
2008-05-14 21:51:27 +00:00
Jerry DeLisle 36afed5a79 re PR libfortran/36202 ([mingw] Namelist read fails with CRLF)
2008-05-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/36202
	* io/list_read (eat_separator): Handle the CR-LF case correctly.

From-SVN: r135177
2008-05-11 15:02:41 +00:00
Julian Brown 7afa92c5a2 Makefile.am (LTLDFLAGS): New.
libgfortran/
    * Makefile.am (LTLDFLAGS): New.
    (libgfortran_la_LDFLAGS): Use above.
    * Makefile.in: Regenerate.

    libffi/
    * Makefile.am (LTLDFLAGS): New.
    (libffi_la_LDFLAGS): Use above.
    * Makefile.in: Regenerate.

    libobjc/
    * Makefile.in (LTLDFLAGS): New.
    (libobjc$(libsuffix).la, libobjc_gc$(libsuffix).la): Use above.

From-SVN: r135112
2008-05-09 10:10:53 +00:00
Jerry DeLisle d0d51277e2 re PR libfortran/36131 (wrong IO)
2008-05-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/36131
	* io/transfer.c (formatted_transfer_scalar): Revert patch for PR34974.
	(next_record_w): Likewise.

From-SVN: r134973
2008-05-06 04:00:38 +00:00
Thomas Koenig da96f5ab49 re PR fortran/35995 (ANY, ALL, and COUNT errors for zero sized sections)
2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35995
	* m4/ifunction_logical.m4:  If the extent of "array"
	is less than zero, set it to zero.  Use an explicit
	flag for breaking out of the main loop to avoid, because
	the data pointer for "array" may be NULL for an empty
	array.
	* m4/ifunction.m4:  Likewise.
	* generated/all_l1.c: Regenerated.
	* generated/all_l16.c: Regenerated.
	* generated/all_l2.c: Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/any_l1.c: Regenerated.
	* generated/any_l16.c: Regenerated.
	* generated/any_l2.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/count_16_l.c: Regenerated.
	* generated/count_1_l.c: Regenerated.
	* generated/count_2_l.c: Regenerated.
	* generated/count_4_l.c: Regenerated.
	* generated/count_8_l.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35995
	* gfortran.dg/intrinsic_ifunction_1.f90:  New test case.

From-SVN: r134934
2008-05-04 19:07:28 +00:00
Thomas Koenig 9e6dca7594 re PR fortran/35990 (run-time abort for PACK of run-time zero sized array)
2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35990
	* intrinsics/pack_generic.c:  Really commit.

From-SVN: r134928
2008-05-04 10:14:49 +00:00
Thomas Koenig 7ad99d60f4 re PR fortran/35990 (run-time abort for PACK of run-time zero sized array)
2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35990
	* intrinsics/pack_generic.c:  If an extent of the source
	array is less then zero, set it to zero.  Set the source
	pointer to NULL if the source size is zero.  Set the total
	number of elements to zero if the vector has an extent
	less or equal to zero.
	* m4/pack.m4:  Set the source pointer to NULL if the
	source array is zero-sized.  Set the total number of
	elemements to zero if the vector has an extent less or
	equal to zero.
	* generated/pack_i1.c:  Regenerated.
	* generated/pack_i2.c:  Regenerated.
	* generated/pack_i4.c:  Regenerated.
	* generated/pack_i8.c:  Regenerated.
	* generated/pack_i16.c:  Regenerated.
	* generated/pack_r4.c:  Regenerated.
	* generated/pack_r8.c:  Regenerated.
	* generated/pack_r10.c:  Regenerated.
	* generated/pack_r16.c:  Regenerated.
	* generated/pack_c4.c:  Regenerated.
	* generated/pack_c8.c:  Regenerated.
	* generated/pack_c10.c:  Regenerated.
	* generated/pack_c16.c:  Regenerated.

2008-05-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35990
	* gfortran.dg/intrinsic_pack_4.f90:  New test case.

From-SVN: r134927
2008-05-04 08:06:02 +00:00
Jerry DeLisle c26cc9a6a6 re PR libfortran/36094 (Runtime error show_locus not working correctly)
2008-05-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/36094
	* runtime/error.c (show_locus): Provide modified error message when
	filename has not yet been associated with a unit number.
	* io/open.c (encoding_opt[]): Comment out "utf-8" option and add TODO.

From-SVN: r134876
2008-05-02 01:33:16 +00:00
François-Xavier Coudert a39faface6 intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
* intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
	* intrinsic.h (gfc_check_selected_char_kind,
	gfc_simplify_selected_char_kind): New prototypes.
	* gfortran.h (gfc_isym_id): Add GFC_ISYM_SC_KIND.
	* trans.h (gfor_fndecl_sc_kind): New function decl.
	* trans-decl.c (gfor_fndecl_sc_kind): Build new decl.
	* arith.c (gfc_compare_with_Cstring): New function.
	* arith.h (gfc_compare_with_Cstring): New prototype.
	* check.c (gfc_check_selected_char_kind): New function.
	* primary.c (match_string_constant, match_kind_param): Mark
	symbols used as literal constant kind param as referenced.
	* trans-intrinsic.c (gfc_conv_intrinsic_sc_kind): New function.
	(gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_sc_kind.
	* intrinsic.texi (SELECTED_CHAR_KIND): Document new intrinsic.
	* simplify.c (gfc_simplify_selected_char_kind): New function.

	* intrinsics/selected_char_kind.c: New file.
	* Makefile.am: Add intrinsics/selected_char_kind.c.
	* Makefile.in: Regenerate.

	* gfortran.dg/selected_char_kind_1.f90: New test.
	* gfortran.dg/selected_char_kind_2.f90: New test.
	* gfortran.dg/selected_char_kind_3.f90: New test.

From-SVN: r134839
2008-04-30 21:45:02 +00:00
Thomas Koenig 802367d7c9 re PR fortran/35993 (wrong answer for all array intrinsics with scalar mask)
2008-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35993
	* ifunction.m4 (SCALAR_ARRAY_FUNCTION):  Use correct
	implementation for multi-dimensional return arrays when
	the mask is .false.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

2008-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35993
	* gfortran.dg/intrinsic_product_1.f90:  New test case.

From-SVN: r134830
2008-04-30 16:56:01 +00:00
Thomas Koenig e94471bae0 re PR fortran/35960 (run time abort with assignment of RESHAPEd zero sized array)
2008-04-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35960
	* m4/reshape.m4:  Fix typo in last commit.
	* generated/reshape_i4.c:  Regererated.
	* generated/reshape_i8.c:  Regenerated.
	* generated/reshape_i16.c:  Regenerated.
	* generated/reshape_r4.c:  Regenerated.
	* generated/reshape_r8.c:  Regenerated.
	* generated/reshape_r10.c:  Regenerated.
	* generated/reshape_r16.c:  Regenerated.
	* generated/reshape_c4.c:  Regenerated.
	* generated/reshape_c8.c:  Regenerated.
	* generated/reshape_c10.c:  Regenerated.
	* generated/reshape_c16.c:  Regenerated.

From-SVN: r134677
2008-04-25 20:11:19 +00:00
Francois-Xavier Coudert 601e33320a * intrinsics/time_1.h (__time_1): Remove unused variable.
From-SVN: r134630
2008-04-24 14:54:32 +00:00
Thomas Koenig 7edc89d4c1 re PR fortran/35988 (run-time abort for MATMUL of run-time zero sized array)
2008-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35988
	* m4/matmul.m4:  Only issue a runtime error if extents are
	non-zero.
	* generated/matmul_i1.c:  Regenerated.
	* generated/matmul_i2.c:  Regenerated.
	* generated/matmul_i4.c:  Regenerated.
	* generated/matmul_i8.c:  Regenerated.
	* generated/matmul_i16.c:  Regenerated.
	* generated/matmul_r4.c:  Regenerated.
	* generated/matmul_r8.c:  Regenerated.
	* generated/matmul_r10.c:  Regenerated.
	* generated/matmul_r16.c:  Regenerated.
	* generated/matmul_c4.c:  Regenerated.
	* generated/matmul_c8.c:  Regenerated.
	* generated/matmul_c10.c:  Regenerated.
	* generated/matmul_c16.c:  Regenerated.

2008-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35988
	* gfortran.dg/matmul_7.f90:  New test.

From-SVN: r134579
2008-04-23 05:50:54 +00:00
Ralf Wildenhues 6d26724a16 libgomp/
* acinclude.m4 (LIBGOMP_CHECK_SYNC_BUILTINS)
	(LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY)
	(LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT)
	(LIBGOMP_CHECK_ATTRIBUTE_ALIAS): Fix cache variable names.
	* configure: Regenerate.
	* Makefile.in, testsuite/Makefile.in: Likewise.

libstdc++-v3/
	* acinclude.m4 (GLIBCXX_CHECK_SETRLIMIT, GLIBCXX_ENABLE_C99)
	(GLIBCXX_CHECK_C99_TR1, GLIBCXX_CHECK_RANDOM_TR1)
	(GLIBCXX_ENABLE_VISIBILITY): Fix cache variable names.
	(GLIBCXX_CHECK_SYSTEM_ERROR): Likewise.  Factorize.
	* configure: Regenerate.

libgfortran/
	* acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY)
	(LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT)
	(LIBGFOR_CHECK_ATTRIBUTE_ALIAS, LIBGFOR_CHECK_SYNC_FETCH_AND_ADD)
	(LIBGFOR_GTHREAD_WEAK, LIBGFOR_CHECK_UNLINK_OPEN_FILE)
	(LIBGFOR_CHECK_CRLF, LIBGFOR_CHECK_FOR_BROKEN_ISFINITE)
	(LIBGFOR_CHECK_FOR_BROKEN_ISNAN)
	(LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY, LIBGFOR_CHECK_WORKING_STAT)
	(LIBGFOR_CHECK_FPSETMASK, LIBGFOR_CHECK_MINGW_SNPRINTF):
	Fix cache variable names.
	* configure, Makefile.in: Regenerate.

From-SVN: r134531
2008-04-21 20:55:19 +00:00
Jerry DeLisle 49339fa475 re PR fortran/35991 (run-time abort for CSHIFT of zero sized array)
2008-04-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/35991
	* intrinsics/cshift0.c (cshift0): Avoid divide by zero.

From-SVN: r134491
2008-04-20 21:06:16 +00:00
Thomas Koenig 8c154b6557 re PR fortran/35960 (run time abort with assignment of RESHAPEd zero sized array)
2008-04-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35960
	* intrinsics/reshape_generic.c (reshape_internal): If the size
	of the resized array is zero, as determined by the SHAPE
	argument, return early.
	* m4/reshape.m4:  Likewise.
	* generated/reshape_i4.c:  Regererated.
	* generated/reshape_i8.c:  Regenerated.
	* generated/reshape_i16.c:  Regenerated.
	* generated/reshape_r4.c:  Regenerated.
	* generated/reshape_r8.c:  Regenerated.
	* generated/reshape_r10.c:  Regenerated.
	* generated/reshape_r16.c:  Regenerated.
	* generated/reshape_c4.c:  Regenerated.
	* generated/reshape_c8.c:  Regenerated.
	* generated/reshape_c10.c:  Regenerated.
	* generated/reshape_c16.c:  Regenerated.

2008-04-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35960
	* gfortran.dg/reshape_zerosize_1.f90:  New file.

From-SVN: r134490
2008-04-20 19:56:07 +00:00
Paolo Bonzini deb984e6de re PR other/35457 (Error building GCC trunk on CELL SPU)
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* configure.ac: Include override.m4.
	* configure: Regenerate.

libgomp:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libdecnumber:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

gcc:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libstdc++-v3:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libobjc:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

intl:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgfortran:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libmudflap:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

boehm-gc:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libiberty:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Add override.m4.
	* configure: Regenerate.

libffi:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libssp:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

config:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457

	* confsubdir.m4: Rename to...
	* override.m4: ... this.  Make sure aclocal always picks it.
	Add more lenient precious variable check, backported from
	autoconf trunk.

libjava/libltdl:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libjava/classpath:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libjava:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libcpp:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

fixincludes:
2008-04-18  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/35457
	* Makefile.in: Rewrite aclocal.m4 rule.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

From-SVN: r134434
2008-04-18 10:28:53 +00:00
Thomas Koenig 3a5a8be120 re PR libfortran/32972 (performance of pack/unpack)
2008-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* intrinsics/spread_generic.c (spread):  Use spread_i2()
	for GFC_DTYPE_DERIVED_2 (fix typo from previous commit).

From-SVN: r134286
2008-04-14 18:50:57 +00:00
Thomas Koenig c7d0f4d5fa re PR libfortran/32972 (performance of pack/unpack)
2008-04-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR libfortran/32972
	PR libfortran/32512
	configure.ac:  Add test for uintptr_t.
	configure:  Regenerated.
	config.h.in:  Regenerated.
	* libgfortran.h: GFC_DTYPE_DERIVED_1:  New macro.
	GFC_DTYPE_DERIVED_2:  New macro.
	GFC_DTYPE_DERIVED_4:  New macro.
	GFC_DTYPE_DERIVED_8:  New macro.
	GFC_DTYPE_DERIVED_16:  New macro.
	GFC_UNALIGNED_2:  New macro.
	GFC_UNALIGNED_4:  New macro.
	GFC_UNALIGNED_8:  New macro.
	GFC_UNALIGNED_16:  New macro.
	intptr_t:  Define if we don't have it.
	uintptr_t:  Likewise.
	* runtime/backtrace.c (show_backtrace):  Use intptr_t.
	* intrinsics/signal.c (signal_sub):  Likewise.
	(signal_sub_int):  Likewise.
	(alarm_sub_int_i4):  Likewise.
	* intrinsics/spread_generic.c (spread):  Use the integer
	routines for handling derived types of sizes 1, 2, 4, 8 and 16
	if the alignment of all pointers is correct.
	(spread_scalar):  Likewise.
	* intrinsics/pack_generic.c (pack):  Likewise.
	Use GFD_DTYPE_TYPE_SIZE to avoid nested switch statements.
	* intrinsics/unpack_generic.c (unpack1):  Likewise.
	(unpack0):  Likewise.
	* runtime/in_pack_generic.c (internal_pack):  Likewise.
	* runtime/in_unpack_generic.c (internal_unpack):  Likewise.

2008-04-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	PR libfortran/32512
	* gfortran.dg/internal_pack_1.f90:  Add test for derived type.
	* gfortran.dg/intrinsic_spread_1.f90:  Likewise.
	* gfortran.dg/intrinsic_pack_1.f90:  Likewise.
	* gfortran.dg/intrinsic_unpack_1.f90:  Likewise.


Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>

From-SVN: r134245
2008-04-13 20:15:58 +00:00
Jakub Jelinek 24722ea98e list_read.c (snprintf): Define if HAVE_SNPRINTF isn't defined.
* io/list_read.c (snprintf): Define if HAVE_SNPRINTF isn't defined.
	(nml_read_obj): Add nml_err_msg_size argument.  Pass it down to
	recursive call.  Use snprintf instead of sprintf when %s nl->var_name
	is used.
	(nml_get_obj_data): Add nml_err_msg_size argument.  Pass it down to
	nml_read_obj call.  Use snprintf instead of sprintf when %s
	nl->var_name is used.  Pass nml_err_msg to nml_parse_qualifier instead
	of parse_err_msg array.  Append " for namelist variable " and
	nl->var_name to it.
	(namelist_read): Increase size of nml_err_msg array to 200.  Pass
	sizeof nml_err_msg as extra argument to nml_get_obj_data.

	* gfortran.dg/namelist_47.f90: New test.

From-SVN: r134132
2008-04-09 11:00:31 +02:00
Jerry DeLisle 931149a6b7 PR fortran/25829 28655
2008-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/25829 28655
	* io/open.c (edit_modes): Set flags.async. (new_unit) Set flags.async
	and flags.status. (st_open): Initialize flags.async.
	* io/list_read.c (read_charactor): Use delim_status instead of
	flags.delim.
	* io/read.c (read_x): Use pad_status instead of flags.pad.
	* io/inquire.c (inquire_via_unit): Add new checks.
	(inquire_via_filename): Likewise.
	* io/io.h (st_parameter_inquire): Add new flags.
	(st_parameter_dt): Likewise.
	* io/unit.c (get_internal_unit): Set flags.async. (init_units): Set
	flags.async.
	* io/transfer.c: Add delim and pad option arrays. (read_sf): Use
	pad_status instead of flags.pad. (read_block): Likewise.
	(data_transfer_init): Set flags.async and add checks.
	* io/write.c (write_character): Use delim_status.
	(list_formatted_write_scalar): Likewise. (nml_write_obj): Likewise.
	(namelist_write): Likewise.

From-SVN: r133988
2008-04-07 22:05:52 +00:00
Jerry DeLisle 10256cbe95 PR fortran/25829 28655
2008-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/25829 28655
	* gfortran.map: Add new symbol, _gfortran_st_wait.
	* libgfortran.h (st_paramter_common): Add new I/O parameters.
	* open.c (st_option decimal_opt[], st_option encoding_opt[],
	st_option round_opt[], st_option sign_opt[], st_option async_opt[]): New
	parameter option arrays. (edit_modes): Add checks for new parameters.
	(new_unit): Likewise. (st_open): Likewise.
	* list_read.c (CASE_SEPERATORS): Add ';' as a valid separator.
	(eat_separator): Handle deimal comma. (read_logical): Fix whitespace.
	(parse_real): Handle decimal comma. (read_real): Handle decimal comma.
	* read.c (read_a): Use decimal status flag to allow comma in place of a
	decimal point. (read_f): Allow comma as acceptable character in float.
	According to decimal flag, substitute a period for a comma.
	(read_x): If decimal status flag is comma, disable the read_comma flag,
	not allowing comma as a delimiter, an extension otherwise.
	* io.h: (unit_decimal, unit_encoding, unit_round, unit_sign,
	unit_async): New enumerators. Add all new I/O parameters.
	* unix.c (unix_stream, int_stream): Add io_mode	asychronous I/O	control.
	(move_pos_offset, fd_alloc_w_at): Fix some whitespace.
	(fd_sfree): Use new enumerator. (fd_read): Likewise.
	(fd_write): Likewise. (fd_close): Fix whitespace.
	(fd_open): Use new enumertors. (tempfile, regular_file,
	open_external): Fix whitespace. (output_stream, error_stream): Set
	method. (stream_offset): Fix whitespace.
	* transfer.c: (st_option decimal_opt[], sign_opt[], blank_opt[]): New
	option arrays. 	(formatted_transfer_scalar): Set sf_read_comma flag
	based on new decimal_status flag. (data_transfer_init): Initialize new
	parameters. Add checks for decimal, sign, and blank. (st_wait): New stub.
	* format.c: (format_lex): Add format specifiers DP, DC, and D.
	(parse_format_list): Parse the new specifiers.
	* write.c (write_decimal): Use new sign enumerators to set the sign.
	(write_complex): Handle decimal comma and semi-colon separator.
	(nml_write_obj): Likewise.
	* write_float.def: Revise sign enumerators. (calculate_sign): Use new
	sign enumerators. (output_float): Likewise. Use new decimal_status flag
	to set the decimal character to a point or a comma.

From-SVN: r133943
2008-04-05 22:18:03 +00:00
Thomas Koenig 75f2543f2e re PR libfortran/32972 (performance of pack/unpack)
2008-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	PR libfortran/32512
	* Makefile.am:  Add new variable, i_spread_c, containing
	pack_i1.c, pack_i2.c, pack_i4.c, pack_i8.c, spread_i16.c,
	spread_r4.c, spread_r8.c, spread_r10.c, spread_r16.c,
	spread_c4.c, spread_c8.c, spread_c10.c, spread_c16.c.
	* Makefile.in:  Regenerated.
	* libgfortran.h:  Add prototypes for spread_i1, spread_i2,
	spread_i4, spread_i8, spread_i16, spread_r4, spread_r8,
	spread_c4, spread_c8, spread_c10, spread_c16,
	spread_scalar_i1, spread_scalar_i2, spread_scalar_i4,
	spread_scalar_i8, spread_scalar_i16, spread_scalar_r4
	spread_scalar_r8, spread_scalar_c4, spread_scalar_c8,
	spread_scalar_c10 and spread_scalar_c16.
	Add macros to isolate both type and size information
	from array descriptors with a single mask operation.
	* intrinsics/spread_generic.c:  Add calls to specific
	spread functions.
	* m4/spread.m4:  New file.
	* generated/spread_i1.c:  New file.
	* generated/spread_i2.c:  New file.
	* generated/spread_i4.c:  New file.
	* generated/spread_i8.c:  New file.
	* generated/spread_i16.c:  New file.
	* generated/spread_r4.c:  New file.
	* generated/spread_r8.c:  New file.
	* generated/spread_r10.c:  New file.
	* generated/spread_r16.c:  New file.
	* generated/spread_c4.c:  New file.
	* generated/spread_c8.c:  New file.
	* generated/spread_c10.c:  New file.
	* generated/spread_c16.c:  New file.

2008-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	PR libfortran/32512
	* intrinsic_spread_1.f90:  New file.
	* intrinsic_spread_2.f90:  New file.
	* intrinsic_spread_3.f90:  New file.

From-SVN: r133702
2008-03-28 23:22:49 +00:00
Jerry DeLisle fc8bc1753d re PR fortran/35699 (run-time abort writing zero sized section to direct access file)
2008-03-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35699
	* io/transfer.c (write_buf):  Don't pad the record, just return if the
	data is NULL.  (next_record_w): If there are bytes left in the record
	for unformatted direct I/O, pad out the record with zero bytes.

From-SVN: r133699
2008-03-28 22:13:17 +00:00
Tobias Burnus 3e08bbcfe8 re PR fortran/35721 (ASSOCIATED returns false when strides confusing)
2008-03-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/35721
        * intrinsics/associated.c (associated): Ignore different
        stride of pointer vs. target if only one element is referred.

2008-03-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/35721
        * gfortran.dg/associated_target_2.f90: New.

From-SVN: r133684
2008-03-28 14:47:06 +01:00
Jerry DeLisle 40e43495ce unix.c (fd_close): Do not close STDIN.
2008-03-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/unix.c (fd_close):  Do not close STDIN.

From-SVN: r133630
2008-03-27 05:30:18 +00:00
Thomas Koenig 3478bba466 re PR libfortran/32972 (performance of pack/unpack)
2007-03-23  Thomas Koenig  <tkoenig@gcc.gnu.org

	PR libfortran/32972
	* Makefile.am:  Add new variable, i_unpack_c, containing
	unpack_i1.c, unpack_i2.c, unpack_i4.c, unpack_i8.c,
	unpack_i16.c, unpack_r4.c, unpack_r8.c, unpack_r10.c,
	unpack_r16.c, unpack_c4.c, unpack_c8.c, unpack_c10.c
	and unpack_c16.c
	Add i_unpack_c to gfor_built_src.
	Add rule to generate i_unpack_c from m4/unpack.m4.
	* Makefile.in:  Regenerated.
	* libgfortran.h: Add prototypes for unpack0_i1, unpack0_i2,
	unpack0_i4, unpack0_i8, unpack0_i16, unpack0_r4, unpack0_r8,
	unpack0_r10, unpack0_r16, unpack0_c4, unpack0_c8, unpack0_c10,
	unpack0_c16, unpack1_i1, unpack1_i2, unpack1_i4, unpack1_i8,
	unpack1_i16, unpack1_r4, unpack1_r8, unpack1_r10, unpack1_r16,
	unpack1_c4, unpack1_c8, unpack1_c10 and unpack1_c16.
	* intrinsics/pack_generic.c (unpack1):  Add calls to specific
	unpack1 functions.
	(unpack0):  Add calls to specific unpack0 functions.
	* m4/unpack.m4:  New file.
	* generated/unpack_i1.c:  New file.
	* generated/unpack_i2.c:  New file.
	* generated/unpack_i4.c:  New file.
	* generated/unpack_i8.c:  New file.
	* generated/unpack_i16.c:  New file.
	* generated/unpack_r4.c:  New file.
	* generated/unpack_r8.c:  New file.
	* generated/unpack_r10.c:  New file.
	* generated/unpack_r16.c:  New file.
	* generated/unpack_c4.c:  New file.
	* generated/unpack_c8.c:  New file.
	* generated/unpack_c10.c:  New file.
	* generated/unpack_c16.c:  New file.

2007-03-23  Thomas Koenig  <tkoenig@gcc.gnu.org

	PR libfortran/32972
	* gfortran.dg/intrinsic_unpack_1.f90:  New test case.
	* gfortran.dg/intrinsic_unpack_2.f90:  New test case.
	* gfortran.dg/intrinsic_unpack_3.f90:  New test case.

From-SVN: r133469
2008-03-23 22:19:19 +00:00
Jerry DeLisle 35077d5aed re PR fortran/35632 (stream io broken on FreeBSD due to ftruncate changes.)
2008-03-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35632
	* io/transfer.c (data_transfer_init):  Fix whitespace.
	(next_record_w): Truncate the file only if the stream
	position is short of the file end.

From-SVN: r133454
2008-03-22 22:03:13 +00:00
Jerry DeLisle 042a12f4e8 pack_generic.c: Fix typo.
2008-03-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* intrinsics/pack_generic.c:  Fix typo.

From-SVN: r133437
2008-03-21 21:00:17 +00:00
Janne Blomqvist fc34570cc1 gfortran.map: Move erfc_scaled symbols to new symbol node GFORTRAN_1.1...
2008-03-21  Janne Blomqvist  <jb@gcc.gnu.org>

        * gfortran.map: Move erfc_scaled symbols to new symbol node
        GFORTRAN_1.1, thereby fixing ABI bug introduced in r132846.

From-SVN: r133432
2008-03-21 19:36:00 +02:00
Thomas Koenig 36240d3d4b re PR libfortran/32972 (performance of pack/unpack)
2008-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* runtime/in_pack_generic.c (internal_pack):  Call correct
	function, pack_i16, for GFC_INTEGER_16.

From-SVN: r133428
2008-03-21 15:33:13 +00:00
Thomas Koenig 3ef2513a1d re PR libfortran/32972 (performance of pack/unpack)
2008-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* Makefile.am:  Add new variable, i_pack_c, containing
	pack_i1.c, pack_i2.c, pack_i4.c, pack_i8.c, pack_i16.c,
	pack_r4.c, pack_r8.c, pack_r10.c, pack_r16.c, pack_c4.c,
	pack_c8.c, pack_c10.c, pack_c16.c.
	Add m4/pack.m4 to m4_files.
	Add i_pack_c to gfor_built_src.
	Add rule to generate i_pack_c from m4/pack.m4.
	* Makefile.in:  Regenerated.
	* libgfortran.h: Add prototypes for pack_i1, pack_i2, pack_i4,
	pack_i8, pack_i16, pack_r4, pack_r8, pack_c4, pack_c8,
	pack_c10, pack_c16.
	* intrinsics/pack_generic.c:  Add calls to specific
	pack functions.
	* m4/pack.m4:  New file.
	* generated/pack_i1.c:  New file.
	* generated/pack_i2.c:  New file.
	* generated/pack_i4.c:  New file.
	* generated/pack_i8.c:  New file.
	* generated/pack_i16.c:  New file.
	* generated/pack_r4.c:  New file.
	* generated/pack_r8.c:  New file.
	* generated/pack_r10.c:  New file.
	* generated/pack_r16.c:  New file.
	* generated/pack_c4.c:  New file.
	* generated/pack_c8.c:  New file.
	* generated/pack_c10.c:  New file.
	* generated/pack_c16.c:  New file.

2008-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* internal_pack_1.f90:  New test case.
	* internal_pack_2.f90:  New test case.
	* internal_pack_3.f90:  New test case.

From-SVN: r133427
2008-03-21 14:37:03 +00:00
Jerry DeLisle 17f46ec355 re PR fortran/35627 (namelist read error)
2008-03-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35627
	* io/list_read.c (free_line): Clear the line buffer enable flag and
	reset the index into line_buffer, aka item_count.
	(next_char): Cleanup whitespace.
	(read_logical): Use unget_char to assure that the first character of the
	bad logical is saved in case it is part of an object name. Remove the
	clearing of index and flag that is now in free_line.
	(read_real): Likewise.

From-SVN: r133360
2008-03-20 02:05:05 +00:00
Thomas Koenig 2f3b8279bf re PR libfortran/32972 (performance of pack/unpack)
2008-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* runtime/in_pack_generic.c (internal_pack):  Fix typo in
	last commit.

From-SVN: r133345
2008-03-19 16:56:22 +00:00
Thomas Koenig 8e1d7686de re PR libfortran/32972 (performance of pack/unpack)
2008-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* Makefile.am (in_pack_c): Add in_pack_i1.c, in_pack_i2.c,
	in_pack_r4.c, in_pack_r8.c, in_pack_r10.c and in_pack_r16.c.
	(in_unpack_c): Add in_unpack_i1.c, in_unpack_i2.c,
	in_unpack_r4.c, in_unpack_r8.c, in_unpack_r10.c and
	in_unpack_r16.c.
	* Makefile.in: Regenerate.
	* libgfortran.h:  Add prototypes for internal_pack_1,
	internal_pack_2, internal_pack_16, internal_pack_r4,
	internal_pack_r8, internal_pack_r10, internal_pack_r16,
	internal_pack_c10 and internal_pack_c16.  Add prototypes for
	internal_unpack_1, internal_unpack_2, internal_unpack_16,
	internal_unpack_r4, internal_unpack_r8, internal_unpack_r10,
	internal_unpack_r16, internal_unpack_c10 and
	internal_unpack_c16.
	* runtime/in_pack_generic.c (internal_pack): Use sizeof instead
	of hardwired sizes.
	Add calls to internal_pack_1, internal_pack_2,
	internal_pack_16, internal_pack_r4, internal_pack_r8,
	internal_pack_r10, internal_pack_r16, internal_pack_c10 and
	internal_pack_c16.
	* runtime/in_unpack_generic.c (internal_unpack):  Use sizeof
	instead of hardwired sizes.
	Add calls to internal_unpack_1, internal_unpack_2,
	internal_unpack_16, internal_unpack_r4, internal_unpack_r8,
	internal_unpack_r10, internal_unpack_r16, internal_unpack_c10
	and internal_unpack_c16.
	* generated/in_pack_r4.c:  New file.
	* generated/in_pack_i2.c:  New file.
	* generated/in_unpack_i1.c:  New file.
	* generated/in_pack_r10.c:  New file.
	* generated/in_unpack_r4.c:  New file.
	* generated/in_unpack_i2.c:  New file.
	* generated/in_unpack_r16.c:  New file.
	* generated/in_pack_r8.c:  New file.
	* generated/in_unpack_r10.c:  New file.
	* generated/in_unpack_r8.c:  New file.
	* generated/in_pack_r16.c:  New file.
	* generated/in_pack_i1.c:  New file.

2008-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32972
	* gfortran.dg/internal_pack_1.f90:  New test case.
	* gfortran.dg/internal_pack_2.f90:  New test case.
	* gfortran.dg/internal_pack_3.f90:  New test case.

From-SVN: r133344
2008-03-19 15:42:55 +00:00
Jerry DeLisle 5a79ae8432 re PR fortran/35617 (read namelist error)
2008-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35617
	* io/list_read.c (eat_separator): If next character after eatline is '!'
	then eatline again.

From-SVN: r133302
2008-03-18 04:27:56 +00:00
Ralf Wildenhues 38d24731e9 configure.ac: m4_include config/proginstall.m4.
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * configure.ac: m4_include config/proginstall.m4.
        * configure: Regenerate.

config/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * proginstall.m4: New file, with fixed AC_PROG_INSTALL.

libjava/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * Makefile.am (install-data-local): Rewrite to be more efficient,
        using awk, and `install' with multiple files at once.  Do not gather
        more than 50 files in one go to avoid hitting command line limits.
        (install_data_local_split): New variable.
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * gcj/Makefile.in: Likewise.
        * include/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.

boehm-gc/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * include/Makefile.in: Likewise.

libffi/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * include/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.

libgfortran/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.

libgomp/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.

libmudflap/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.

libssp/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
libssp/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.

libstdc++-v3/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * doc/Makefile.in: Likewise.
        * include/Makefile.in: Likewise.
        * libmath/Makefile.in: Likewise.
        * libsupc++/Makefile.in: Likewise.
        * po/Makefile.in: Likewise.
        * src/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.

zlib/
2008-03-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.

From-SVN: r133269
2008-03-16 08:19:08 +00:00
Francois-Xavier Coudert cb31c4bcc5 re PR libfortran/35524 (Unconditional use of expl() in libgfortran)
PR libfortran/35524
	* intrinsics/erfc_scaled_inc.c: Only define the long double
	variant of erfc_scaled if expl is available.

From-SVN: r133138
2008-03-12 10:24:29 +00:00
Francois-Xavier Coudert 2d3ca8b721 re PR libfortran/32812 (random_seed and date_and_time)
PR libfortran/32812
	* intrinsics/random.c (scramble_seed, unscramble_seed): New
	functions.
	(random_seed_i4): Scramble the seed the user gives us before
	storing it, and unscramble it when we return it back later.

From-SVN: r133104
2008-03-11 10:49:13 +00:00
Hans-Peter Nilsson 25abf44844 re PR libfortran/35293 (truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.)
PR libfortran/35293
	* io/unix.c (fd_truncate): Fold s->special_file case into
	success case of ftruncate/chsize call instead of the failure case.
	Make failure case actually return failure.  Properly update stream
	pointers on failure.  Call runtime_error for targets without
	neither ftruncate nor chsize where such a call would be needed.

From-SVN: r132888
2008-03-05 01:50:33 +00:00
François-Xavier Coudert f489fba128 re PR fortran/33197 (Fortran 2008: math functions)
PR fortran/33197

gcc/fortran/
	* intrinsic.c (add_functions): Modify intrinsics ACOSH, ASINH,
	ATANH, ERF, ERFC and GAMMA. Add intrinsics BESSEL_{J,Y}{0,1,N},
	ERFC_SCALED, LOG_GAMMA and HYPOT.
	* intrinsic.h (gfc_check_hypot, gfc_simplify_hypot,
	gfc_resolve_hypot): New prototypes.
	* mathbuiltins.def: Add HYPOT builtin. Make complex versions of
	ACOSH, ASINH and ATANH available.
	* gfortran.h (GFC_ISYM_ERFC_SCALED, GFC_ISYM_HYPOT): New values.
	* lang.opt: Add -std=f2008 option.
	* libgfortran.h: Define GFC_STD_F2008.
	* lang-specs.h: Add .f08 and .F08 file suffixes.
	* iresolve.c (gfc_resolve_hypot): New function.
	* parse.c (parse_contained): Allow empty CONTAINS for Fortran 2008.
	* check.c (gfc_check_hypot): New function.
	* trans-intrinsic.c (gfc_intrinsic_map): Define ERFC_SCALE builtin.
	* options.c (set_default_std_flags): Allow Fortran 2008 by default.
	(form_from_filename): Add .f08 suffix.
	(gfc_handle_option): Handle -std=f2008 option.
	* simplify.c (gfc_simplify_hypot): New function.
	* gfortran.texi: Document Fortran 2008 status and file extensions.
	* intrinsic.texi: Document new BESSEL_{J,Y}{0,1,N} intrinsics,
	as well as HYPOT and ERFC_SCALED. Update documentation of ERF,
	ERFC, GAMMA, LGAMMA, ASINH, ACOSH and ATANH.
	* invoke.texi: Document the new -std=f2008 option.

libgomp/
	* testsuite/libgomp.fortran/fortran.exp: Add .f08 and
	.F08 file suffixes.

gcc/testsuite/
	* gfortran.dg/gomp/gomp.exp: Add .f08 and .F08 file suffixes.
	* gfortran.dg/dg.exp: Likewise.
	* gfortran.dg/vect/vect.exp: Likewise.
	* gfortran.fortran-torture/execute/execute.exp: Likewise.
	* gfortran.fortran-torture/compile/compile.exp: Likewise.
	* gfortran.dg/gamma_1.f90: Also check log_gamma.
	* gfortran.dg/invalid_contains_1.f90: Remove warning about
	empty CONTAINS.
	* gfortran.dg/gamma_2.f90: Add a few error messages.
	* gfortran.dg/invalid_contains_2.f90: Remove warning about
	empty CONTAINS.
	* gfortran.dg/gamma_3.f90: Adjust error message.
	* gfortran.dg/gamma_4.f90: Test for log_gamma instead of lgamma.
	* gfortran.dg/bind_c_usage_9.f03: Adjust error messages.
	* gfortran.dg/bessel_1.f90: New test.
	* gfortran.dg/recursive_check_3.f90: Remove warnings.
	* gfortran.dg/besxy.f90: Also check for new F2008 intrinsics.
	* gfortran.dg/derived_function_interface_1.f90: Remove warning.
	* gfortran.dg/contains_empty_1.f03: New test.
	* gfortran.dg/erfc_scaled_1.f90: New test.
	* gfortran.dg/hypot_1.f90: New test.
	* gfortran.dg/contains_empty_2.f03: New test.

libgfortran/
	* intrinsics/erfc_scaled_inc.c: New file.
	* intrinsics/erfc_scaled.c: New file.
	* gfortran.map (GFORTRAN_1.0): Add _gfortran_erfc_scaled_r*.
	* Makefile.am: Add intrinsics/erfc_scaled.c.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

From-SVN: r132846
2008-03-03 23:46:20 +00:00
Francois-Xavier Coudert 9bd97567c9 re PR libfortran/35355 (CPU_TIME gives wrong values on mingw)
2008-03-01  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR libfortran/35355
	* intrinsics/time_1.h (__time_1): Fix calculation of user_usec
	for mingw.

From-SVN: r132808
2008-03-01 22:15:31 +00:00
Janne Blomqvist 4dabf73695 re PR libfortran/35063 (Clean up use of destroy_unit_mutex())
gcc:

2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>

	PR gcc/35063
	* gthr.h: Add __gthread_mutex_destroy as a function that must be
	implemented.
	* gthr-vxworks.h (__gthread_mutex_destroy): Null implementation.
	* gthr-single.h (__gthread_mutex_destroy): Likewise.
	* gthr-rtems.h (__gthread_mutex_destroy): Likewise.
	* gthr-mipssde.h (__gthread_mutex_destroy): Likewise.
	* gthr-nks.h (__gthread_mutex_destroy): Likewise.
	* gthr-solaris.h (__gthread_mutex_destroy): Call mutex_destroy.
	* gthr-win32.h (__GTHREAD_MUTEX_DESTROY_FUNCTION): Remove.
	(__gthread_mutex_destroy_function): Rename to
	__gthread_mutex_destroy.
	* gthr-dce.h (__gthread_mutex_destroy): Call
	pthread_mutex_destroy.
	* gthr-tpf.h (__gthread_mutex_destroy): Likewise.
	* gthr-posix.h (__gthread_mutex_destroy): Likewise.
	* gthr-posix95.h (__gthread_mutex_destroy): Likewise.


libgfortran:

2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/35063
	* io/unit.c (destroy_unit_mutex): Call __gthread_mutex_destroy
	instead of macro kludge.

From-SVN: r132800
2008-03-01 12:46:31 +02:00
Janne Blomqvist cc4947e65d re PR fortran/29549 (matmul slow for complex matrices)
2008-02-25  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/29549
        * Makefile.am: Add -fcx-fortran-rules to AM_CFLAGS for all of
        libgfortran.
        * Makefile.in: Regenerated.

From-SVN: r132638
2008-02-25 21:27:28 +02:00
Francois-Xavier Coudert 5095283b2f ifunction_logical.m4: Add casts to get rid of warnings.
* m4/ifunction_logical.m4: Add casts to get rid of warnings.
	* generated/all_l1.c: Regenerate.
	* generated/all_l2.c: Regenerate.
	* generated/all_l4.c: Regenerate.
	* generated/all_l8.c: Regenerate.
	* generated/all_l16.c: Regenerate.
	* generated/any_l1.c: Regenerate.
	* generated/any_l2.c: Regenerate.
	* generated/any_l4.c: Regenerate.
	* generated/any_l8.c: Regenerate.
	* generated/any_l16.c: Regenerate.
	* generated/count_1_l.c: Regenerate.
	* generated/count_2_l.c: Regenerate.
	* generated/count_4_l.c: Regenerate.
	* generated/count_8_l.c: Regenerate.
	* generated/count_16_l.c: Regenerate.

From-SVN: r132619
2008-02-25 12:02:56 +00:00
Francois-Xavier Coudert a94caabf5a re PR libfortran/32841 (HUGE(1.0_16) output as +Infinity on ppc-darwin8 (gfortran.dg/large_real_kind_2.F90))
PR libfortran/32841
	* acinclude.m4: Don't use HAVE_MATH_H.
	* configure: Regenerate.

From-SVN: r132587
2008-02-24 11:59:09 +00:00
Jerry DeLisle e32883d1a2 re PR libfortran/35132 (Formatted stream I/O write should truncate)
2008-02-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35132
	* io/transfer.c (next_record_w): Truncate after the last record for
	STREAM I/O.

	PR libfortran/34954
	* io/transfer.c (data_transfer_init): Initialize dtp->rec if writing.

	PR libfortran/34974
	* io/transfer.c (formatted_transfer_scalar): Flush the buffer if skips
	is less than zero. (next_record_w): Use sseek to position the file to
	the max position reached.

From-SVN: r132512
2008-02-21 02:27:07 +00:00
Jerry DeLisle 50a932e0cb re PR fortran/35036 (illegal E format descriptor produces wrong output)
2008-02-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35036
	* write_float.def (output_float):  Add error checks for zero digits
	after decimal point in E and D format specifiers.

From-SVN: r132510
2008-02-21 02:20:27 +00:00
Jerry DeLisle ef4195d63d [multiple changes]
2008-02-10  Danny Smith  <dannysmith@users.sourceforge.net>

	PR gcc/35063
	* gthr-win32.h (__gthread_mutex_destroy_function): New function
	to CloseHandle after unlocking to prevent accumulation of handle
	count. 

2008-02-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/35063
	* io/unit.c (destroy_unit_mutex): New function that uses
	__gthread_mutex_destroy_function or pthread_mutex_destroy after
	unlocking and before free_mem for final closure of I/O unit.
	(delete_root): Use new function.
	(free_internal_unit): Likewise.
	(close_unit_1): Likewise.

From-SVN: r132217
2008-02-10 18:06:34 +00:00
Thomas Koenig ee440dd05d re PR libfortran/35001 (shape for negative sizes)
2008-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35001
	* m4/shape.m4:  Return 0 for extents <= 0.
	* generated/shape_i4.c:  Regenerated.
	* generated/shape_i8.c:  Regenerated.
	* generated/shape_i16.c:  Regenerated.

2008-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/35001
	* gfortran.dg/shape_4.f90:  New test.

Fixed in regression-only mode by special dispense (see the PR).

From-SVN: r132070
2008-02-02 13:50:55 +00:00
Thomas Koenig bc81405676 re PR libfortran/34980 (Segfault in shape given a scalar)
2008-01-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34980
	* m4/shape.m4:  If return array is empty, return early.
	* generated/shape_i4.c:  Regenerated.
	* generated/shape_i8.c:  Regenerated.
	* generated/shape_i16.c:  Regenerated.

From-SVN: r131915
2008-01-28 19:02:47 +00:00
Thomas Koenig 6cac36304e re PR libfortran/34887 (reverse tabbing before slash descriptor (regression vs. g77))
2008-01-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfofortran/34887
	* io/transfer.c (next_record_w): Always move to the farthest
	position when completing the record (also when we are
	processing a slash edit descriptor).

2008-01-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfofortran/34887
	* gfortran.dg/x_slash_2.f:  New test.

From-SVN: r131864
2008-01-26 15:22:59 +00:00
Jerry DeLisle 12d9e9beff Fix date.
From-SVN: r131849
2008-01-25 23:36:39 +00:00
Jerry DeLisle 4152bc263e re PR fortran/34876 (Can't read/write array sections with negative stride not specified)
2008-01-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/34876
	* io/transfer.c (write_buf): Handle case of zero sized array.
	(transfer_array): Set data pointer to NULL and size to zero.  Then
	make a data transfer and return.

From-SVN: r131848
2008-01-25 23:34:53 +00:00
David Edelsohn 4f6bebc326 * configure: Regenerate.
From-SVN: r131789
2008-01-24 11:29:16 -05:00
Jerry DeLisle 2045a99abb Fix it.
From-SVN: r131674
2008-01-20 06:55:46 +00:00
Jerry DeLisle 17c2c96cdc inquire.c (inquire_via_unit): If a unit is opened...
2008-01-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/inquire.c (inquire_via_unit): If a unit is opened, return values
	according to the open action for DIRECT, FORMATTED, and	UNFORMATTED.
	(inquire_via_filename): Return "UNKNOWN" for SEQUENTIAL, DIRECT,
	FORAMATTED, and UNFORMATTED inquiries.
	* io/unix.c (inquire_sequential): Return "UNKNOWN" when appropriate
	for files that are not opened. (inquire_direct): Same.
	(inquire_formatted): Same.

From-SVN: r131672
2008-01-20 06:33:49 +00:00
Jerry DeLisle 6c540522ba transfer.c (formatted_transfer_scalar): Set max_pos to the greater of the current max_pos or the newly calculated position.
2008-01-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (formatted_transfer_scalar): Set max_pos to the greater
	of the current max_pos or the newly calculated position.

From-SVN: r131640
2008-01-18 22:19:15 +00:00
Tobias Burnus 810143349d write.c (write_real): Increase default precision for
2008-01-18  Tobias Burnus  <burnus@net-b.de>

        * io/write.c (write_real): Increase default precision for
        * REAL(16) by one.

2008-01-18  Tobias Burnus  <burnus@net-b.de>

        * gfortran.dg/large_real_kind_form_io_1.f90: Enlarge string for
        * internal I/O.

From-SVN: r131639
2008-01-18 22:43:08 +01:00
Steven Bosscher 4349e29287 re PR libfortran/34669 (libgfortran doesn't build with -pipe)
2008-01-16  Steven Bosscher  <steven@gcc.gnu.org>

        PR libfortran/34669
        * mk-kinds-h.sh: Compile with -S to avoid calling the assembler,
        to avoid piping the -fdump-parse-tree output to the assembler
        when configuring with -pipe.
        * mk-sik-inc.sh: Likewise.
        * mk-srk-inc.sh: Likewise.

From-SVN: r131567
2008-01-16 10:13:39 +01:00
Thomas Koenig 90469382c0 re PR libfortran/34671 (any(kind=1) and all(kind=1))
2008-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34671
	* gfortran.am: Added _gfortran_all_l1, _gfortran_all_l2,
	_gfortran_any_l1, _gfortran_any_l2, -28,15 _gfortran_count_1_l,
	_gfortran_count_16_l, _gfortran_count_2_l, _gfortran_count_4_l and
	_gfortran_count_8_l Removed _gfortran_count_16_l16,
	_gfortran_count_16_l4, _gfortran_count_16_l8,
	_gfortran_count_4_l16, _gfortran_count_4_l4, _gfortran_count_4_l8,
	_gfortran_count_8_l16, _gfortran_count_8_l4 and
	_gfortran_count_8_l8.
	* Makefile.am: Added generated/any_l1.c and generated/any_l2.c to
	i_any_c.  Added generated/all_l1. and generated/all_l2.c to
	i_all_c.  Removed generated/count_4_l4.c, generated/count_8_l4.c,
	generated/count_16_l4.c, generated/count_4_l8.c,
	generated/count_8_l8.c, generated/count_16_l8.c,
	generated/count_4_l16.c, generated/count_8_l16.c, and
	generated/count_16_l16.c from i_count_c.  Added count_1_l.c,
	count_2_l.c, count_4_l.c, count_8_l.c and count_16_l.c to
	i_count_c.  I_M4_DEPS2 depends on ifunction_logical.m4, for
	any of the files generated from all.m4, any.m4 and count.m4.
	* Makefile.in:  Regenerated.
	* m4/ifunction_logical.m4:  New file.  Use
	GFC_LOGICAL_1 pointer for access to source arrays.
	* m4/any.m4:  Include ifunction_logical.m4 instead of
	ifunction.m4.  Don't check atype_name.
	* m4/all.m4:  Likewise.
	* m4/count.m4:  Likewise.
	* generated/any_l1.c:  New file.
	* generated/any_l2.c:  New file.
	* generated/all_l1.c:  New file.
	* generated/count_1_l.c:  New file.
	* generated/count_2_l.c:  New file.
	* generated/count_4_l.c:  New file.
	* generated/count_8_l.c:  New file.
	* generated/count_16_l.c:  New file.
	* generated/any_l4.c:  Regenerated.
	* generated/any_l8.c:  Regenerated.
	* generated/any_l16.c:  Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/all_l16.c: Regenerated.
	* generated/count_4_l4.c:  Removed.
	* generated/count_4_l8.c:  Removed.
	* generated/count_4_l16.c:  Removed.
	* generated/count_8_l4.c:  Removed.
	* generated/count_8_l8.c:  Removed.
	* generated/count_8_l16.c:  Removed.
	* generated/count_16_l4.c:  Removed.
	* generated/count_16_l8.c:  Removed.
	* generated/count_16_l16.c:  Removed.

2008-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34671
	* iresolve.c (gfc_resolve_all):  Call resolve_mask_arg.
	(gfc_resolve_any):  Likewise.
	(gfc_resolve_count):  Likewise.  Don't append kind of
	argument to function name.

2008-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
	
	PR libfortran/34671
	* gfortran.dg/anyallcount_1.f90:  New test.

From-SVN: r131553
2008-01-15 21:22:07 +00:00
Thomas Koenig ccacefc7a6 re PR libfortran/34746 (wrong formats in libgfortran's runtime_error)
2008-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34746
	* m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Use %ld
	in printf format for all bounds checking; cast all
	integer-like arguments to runtime_error() to long int.
	(`m'name`'rtype_qual`_'atype_code):  Likewise.
	(`s'name`'rtype_qual`_'atype_code):  Likewise.
	* m4/ifunction.m4 (name`'rtype_qual`_'atype_code):  Likewise.
	(`m'name`'rtype_qual`_'atype_code):  Likewise.
	(`s'name`'rtype_qual`_'atype_code):  Likewise.
	* generated/all_l16.c: Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/any_l16.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/count_16_l16.c: Regenerated.
	* generated/count_16_l4.c: Regenerated.
	* generated/count_16_l8.c: Regenerated.
	* generated/count_4_l16.c: Regenerated.
	* generated/count_4_l4.c: Regenerated.
	* generated/count_4_l8.c: Regenerated.
	* generated/count_8_l16.c: Regenerated.
	* generated/count_8_l4.c: Regenerated.
	* generated/count_8_l8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

From-SVN: r131514
2008-01-13 22:13:52 +00:00
Thomas Koenig fd6590f8c8 re PR libfortran/34670 (bounds checking for array intrinsics)
2008-01-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* m4/iparm.m4 (upcase):  New macro (copied from the m4 manual).
	(u_name):  New macro for the upper case name of the intrinsic.
	* m4/iforeach.m4 (name`'rtype_qual`_'atype_code):  Add
	bounds checking and rank check, depending on
	compile_options.bounds_check.
	(`m'name`'rtype_qual`_'atype_code):  Likewise.
	(`s'name`'rtype_qual`_'atype_code):  Likewise.
	* m4/ifunction.m4 (name`'rtype_qual`_'atype_code):  Add
	bounds checking and rank check, depending on
	compile_options.bounds_check.
	(`m'name`'rtype_qual`_'atype_code):  Likewise.
	(`s'name`'rtype_qual`_'atype_code):  Likewise.
	* generated/all_l16.c: Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/any_l16.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/count_16_l16.c: Regenerated.
	* generated/count_16_l4.c: Regenerated.
	* generated/count_16_l8.c: Regenerated.
	* generated/count_4_l16.c: Regenerated.
	* generated/count_4_l4.c: Regenerated.
	* generated/count_4_l8.c: Regenerated.
	* generated/count_8_l16.c: Regenerated.
	* generated/count_8_l4.c: Regenerated.
	* generated/count_8_l8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

2008-01-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* all_bounds_1.f90: New test case.
	* maxloc_bounds_1.f90: New test case.
	* maxloc_bounds_2.f90: New test case.
	* maxloc_bounds_3.f90: New test case.
	* maxloc_bounds_4.f90: New test case.
	* maxloc_bounds_5.f90: New test case.
	* maxloc_bounds_6.f90: New test case.
	* maxloc_bounds_7.f90: New test case.
	* maxloc_bounds_8.f90: New test case.

From-SVN: r131473
2008-01-11 20:21:05 +00:00
Jerry DeLisle fa347f2232 re PR fortran/34676 (IO error delayed)
2008-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/34676
	* io/list_read.c (next_char): Only save the EOF condition for later if
	advance="no".

From-SVN: r131337
2008-01-05 16:00:40 +00:00
Thomas Koenig 9370b3c0f9 re PR fortran/34565 (internal write to string array fails)
2008-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34565
	* io/io.h:  Adjust protoypes for open_internal(),
	next_array_record() and init_loop_spec().
	* io/list_read.c (next_char):  Use argument "finished"
	of next_array_record to check for end on internal file.
	* io/unit.c:  Calculate the offset for an array
	internal file and supply this informatin to open_internal().
	* io/unix.c (open_internal):  Set the offset for the internal
	file on open.
	* io/transfer.c (init_loop_spec):  Calculate the starting
	record in case of negative strides.  Return size of 0 for
	an empty array.
	(next_array_record):  Use an extra flag to signal that the
	array is finished.
	(next_record_r):  Use the new flag to next_array_record().
	(next_record_w):  Likewise.

2008-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34565
	* gfortran.dg/internal_readwrite_1.f90:  New test.
	* gfortran.dg/internal_readwrite_2.f90:  New test.

From-SVN: r131305
2008-01-03 19:49:38 +00:00
Tobias Schlüter caf3856072 Rotate Fortran ChangeLogs.
From-SVN: r131261
2008-01-02 18:54:50 +01:00
Thomas Koenig e608204146 re PR libfortran/22423 (Warnings when building libgfortran)
2007-12-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/22423
	* intrinsics/pack_generic.c (pack): Change type of mask argument
	to gfc_array_l1 * in prototype and function.
	(pack_char):  Likewise.
	* intrinsics/unpack_generic.c (unpack1):  Likewise.
	(unpack1_char):  Likewise.
	(unpack0):  Likewise.
	(unpack0_char):  Likewise.

From-SVN: r131204
2007-12-27 15:00:10 +00:00
Thomas Koenig ceac3d59ad re PR fortran/34594 (On error and END, no jump to ERR=<label>)
2007-12-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34594
	* runtime/error.c: If there was a previous error, don't
	mask it with another error mesage, EOF or EOR condition.

2007-12-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34594
	* gfortran.dg/direct_io_8.f90:  New test case.

From-SVN: r131199
2007-12-27 12:33:52 +00:00
Jerry DeLisle 0283e1ed80 Fix change log, missing PR reference.
From-SVN: r131179
2007-12-26 03:43:00 +00:00
Jerry DeLisle f15db427e1 transfer.c (read_sf): Check if readlen was less than the requested number of bytes to read and if so...
2007-12-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (read_sf): Check if readlen was less than the requested
	number of bytes to read and if so, generate error.

From-SVN: r131177
2007-12-26 03:37:01 +00:00
Daniel Franke a1ba31ced9 re PR fortran/34533 (DTIME returns total process time and not since last invocation)
gcc/fortran:
2007-12-25  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/34533
	* intrinsic.h (gfc_check_etime): Renamed to ...
	(gfc_check_dtime_etime): ... this.
	(gfc_check_etime_sub): Renamed to ...
	(gfc_check_dtime_etime_sub): ... this.
	(gfc_resolve_dtime_sub): New prototype.
	* check.c (gfc_check_etime): Renamed to ...
	(gfc_check_dtime_etime): ... this.
	(gfc_check_etime_sub): Renamed to ...
	(gfc_check_dtime_etime_sub): ... this.
	* iresolve.c (gfc_resolve_dtime_sub): New implementation.
	* intrinsic.c (add_functions): Removed alias from ETIME to DTIME,
	added stand-alone intrinsic DTIME.
	(add_subroutines): Adjusted check and resolve function names for
	DTIME and ETIME.
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Added DTIME
	to known functions in switch.
	* intrinsic.texi (DTIME): Added paragraph about thread-safety,
	fixed return value section.
	(CPU_TIME): Clarified intent and added implementation notes.


libgfortran:
2007-12-25  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/34533
	* intrinsics/cpu_time.c: Moved code commonly usable for CPU_TIME,
	DTIME and ETIME to ...
	* intrinsics/time_1.h: ... here.
	* intrinsics/dtime.c: New file.
	* intrinsics/etime.c: Newly implemented using the common 
	time-aquisition function from time_1.h.
	* gfortran.map (_gfortran_dtime, _gfortran_dtime_sub): New.
	* Makefile.am: Added new file.
	* Makefile.in: Regenerated.
	* configure: Regenerated.

From-SVN: r131168
2007-12-25 05:41:44 -05:00
Thomas Koenig 54a838424e re PR fortran/34566 (Matmul of logical values)
2007-12-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34566
	* m4/matmull.m4:  Multiply xstride and ystride by correct kind.
	* generated/matmul_l4.c:  Regenerated.
	* generated/matmul_l8.c:  Regenerated.
	* generated/matmul_l16.c:  Regenerated.

2007-12-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34566
	* gfortran.dg/matmul_6.f90:  New test.

From-SVN: r131167
2007-12-25 10:12:41 +00:00
Tobias Burnus 667e20459d re PR libfortran/34530 (namelist read broken when whitespace after &namelist)
2007-12-20  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34530
        * io/list_read.c (eat_line): Move up in the file.
        (eat_separator): In namelist mode, skip over comment lines.

2007-12-20  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34530
        * gfortran.dg/namelist_44.f90: New.

From-SVN: r131099
2007-12-20 09:16:48 +01:00
Jerry DeLisle 78a15b1f3f re PR libfortran/34427 (Revision 130708 breaks namelist input)
2007-12-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/34427
	* io/list_read.c (read_real): Handle intervening line ends and spaces.
	(get_name): Don't push separators to saved_string.
	(eat_separator): If in namelist mode eat spaces and line ends as well.

From-SVN: r131003
2007-12-17 00:47:14 +00:00
Thomas Koenig 108bc19009 re PR libfortran/34370 (file positioning after nonadvancing i/o)
2007-12-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34370
	PR libfortran/34323
	PR libfortran/34405
	* io/io.h:  Add previous_nonadvancing_write to gfc_unit.
	Add prototype for finish_last_advance_record.
	* io/file_pos.c (st_backspace):  Generate error if backspace is
	attempted for direct access or unformatted stream.
	If there are bytes left from a previous ADVANCE="no", write
	them out before performing the backspace.
	(st_endfile):  Generate error if endfile is attempted for
	direct access.
	If there are bytes left from a previous ADVANCE="no", write
	them out before performing the endfile.
	(st_rewind):  Generate error if rewind is attempted for
	direct access.
	* unit.c (close_unit_1):  Move functionality to write
	previously written bytes to...
	(finish_last_advance_record):  ... here.
	* transfer.c (data_transfer_init):  If reading, reset
	previous_nonadvancing_write.
	(finalize_transfer):  Set the previous_noadvancing_write
	flag if we are writing and ADVANCE="no" was specified.
	Only call next_record() if advance="no" wasn't specified.

2007-12-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34370
	PR libfortran/34323
	PR libfortran/34405
	* gfortran.dg/advance_6.f90:  New test case.
	* gfortran.dg/direct_io_7.f90:  New test case.
	* gfortran.dg/streamio_13.f90:  New test case.

From-SVN: r130912
2007-12-13 19:35:09 +00:00
Tobias Burnus b446725a8a re PR libfortran/34427 (Revision 130708 breaks namelist input)
2007-12-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34427
        * io/list_read.c (read_real): Fix unwinding for namelists.

2007-12-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34427
        * gfortran.dg/namelist_42.f90: New.

From-SVN: r130889
2007-12-13 12:01:00 +01:00
Jerry DeLisle 5f026f90f0 re PR fortran/34411 (hang-up during read of non-expected input)
2007-12-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/34411
	* io/read.c (convert_real, read_l, read_decimal, read_radix, read_f):
	Call next_record after bad read or overflow error.

From-SVN: r130767
2007-12-11 03:49:52 +00:00
Tobias Burnus de80e4f820 [multiple changes]
2007-12-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34404
        * io/list_read.c (parse_real): Remove superfluous "goto bad;".

2007-12-09  H.J. Lu  <hjl@lucon.org>
             Tobias Burnus  <burnus@net-b.de>

        PR fortran/34404
        * gfortran.dg/read_2.f90: New.

From-SVN: r130723
2007-12-09 13:58:25 +01:00
Tobias Burnus c9f7e8258a re PR fortran/34319 (I/O: Support "NaN", "Infinity" and "INF" as input)
2007-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34319
        * io/list_read.c (parse_real, read_real): Support NaN/Infinity.

2007-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34319
        * gfortran.dg/nan_3.f90: New.

From-SVN: r130708
2007-12-08 16:51:52 +01:00
Jerry DeLisle 2ea7440786 re PR libfortran/33985 (access="stream",form="unformatted" doesn't buffer)
2007-12-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/33985
	* io/transfer.c (read_block, read_block_direct, write_block, write_buf):
	Don't seek if file position is already there for STREAM I/O.
	(finalize_transfer): For STREAM I/O don't flush unless the file position
	has moved past the start position before the transfer.

Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org>

From-SVN: r130574
2007-12-02 23:17:16 +00:00
Francois-Xavier Coudert 101eebdb8a stat.c (stat_i4_sub_0, [...]): Mark parameter with unused attribute.
* intrinsic/stat.c (stat_i4_sub_0, stat_i8_sub_0): Mark parameter
	with unused attribute.
	* intrinsics/system_clock.c (system_clock_4, system_clock_8):
	Remove unused variable.
	* intrinsics/umask.c: Include unistd.h.

From-SVN: r130561
2007-12-01 21:16:26 +00:00
Jerry DeLisle 3c55599b1f re PR libfortran/34291 (Segfault in io/list_read.c handling of end conditions)
2007-11-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/34291
	* io/list_read.c (read_character): When reading an unquoted string,
	return if special characters that could signify the end of the namelist
	read are encountered.

From-SVN: r130548
2007-11-30 23:19:34 +00:00
Steven G. Kargl 786a435680 re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
2007-11-29  Steven G. Kargl  <kargls@comcast.net>

	PR libfortran/33583
	* libgfortran/gfortran.map: Add tgammaf, tgamma, lgamma, and lgammaf.
	* gfortran.dg/gamma_5.f90: Remove xfail.

From-SVN: r130531
2007-11-30 04:14:01 +00:00
Francois-Xavier Coudert fb0a0e1591 re PR libfortran/33583 (FAIL: gfortran.dg/gamma_1.f90)
PR libfortran/33583
	PR libfortran/33698

	* intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf):
	New fallback functions.
	* c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes.
	* configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma,
	lgammaf and lgammal.
	* config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r130245
2007-11-16 22:31:28 +00:00
Francois-Xavier Coudert 66ec5f8742 * mk-kinds-h.sh: Change sed syntax.
From-SVN: r130015
2007-11-08 19:17:19 +00:00
Jerry DeLisle 31de5c748d re PR libfortran/33985 (access="stream",form="unformatted" doesn't buffer)
2007-11-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33985
	* io/transfer.c (finalize_transfer): Revert previous patch.

From-SVN: r129955
2007-11-07 02:43:44 +00:00
Jerry DeLisle 0c70ecbea2 re PR libfortran/33985 (access="stream",form="unformatted" doesn't buffer)
2007-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33985
	* io/transfer.c (finalize_transfer): Do not flush for
	unformatted STREAM I/O.

From-SVN: r129870
2007-11-03 14:57:13 +00:00
Tobias Burnus 094817b070 mk-kinds-h.sh: Change LANG=C to LC_ALL=C.
2007-10-27  Tobias Burnus  <burnus@net-b.de>

       * mk-kinds-h.sh: Change LANG=C to LC_ALL=C.

From-SVN: r129679
2007-10-27 16:07:14 +02:00
Tobias Burnus 84f2b1d168 mk-kinds-h.sh: Add "LANG=C".
2007-10-26  Tobias Burnus  <burnus@net-b.de>

       * mk-kinds-h.sh: Add "LANG=C".

From-SVN: r129658
2007-10-26 21:01:42 +02:00
Francois-Xavier Coudert 1fa6df85b1 libgfortran.h (GFC_REAL_*_HUGE, [...]): Remove.
* libgfortran.h (GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS,
	GFC_REAL_*_RADIX): Remove.
	* mk-kinds-h.sh: Define GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS and
	GFC_REAL_*_RADIX. Don't define GFC_REAL_LARGEST_FORMAT and
	GFC_REAL_LARGEST.

From-SVN: r129636
2007-10-25 23:32:07 +00:00
Ben Elliston 6525c3f01e signal.c (alarm_sub_i4): Mark conditionally unused parameters with __attribute__ ((unused)).
* intrinsics/signal.c (alarm_sub_i4): Mark conditionally unused
	parameters with __attribute__ ((unused)).
	(alarm_sub_i8): Likewise.
	(alarm_sub_int_i4): Likewise.
	(alarm_sub_int_i8): Likewise.

From-SVN: r129486
2007-10-19 22:24:39 +10:00
Francois-Xavier Coudert 1f94e1d88e re PR fortran/33795 (Environment variable GFORTRAN_UNBUFFERED_<number> not working)
2007-10-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
	    Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33795
	* libgfortran.h: Add unbuffered_preconnected.
	* io/unix.c (output_stream): Set stream unbuffered flag if
	options.unbuffered_preconnected has been set.
	(error_stream): Ditto.
	* runtime/environ.c (variable_table): Add to environment variable table
	the entry: GFORTRAN_UNBUFFERED_PRECONNECTED. 

Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org>

From-SVN: r129470
2007-10-19 04:10:58 +00:00
Francois-Xavier Coudert 1cc0507d4c re PR fortran/32021 (Fix,document,remove GFORTRAN_* environment variables)
PR libfortran/32021
	* runtime/backtrace.c (local_strcasestr): Protect by appropriate
	macros.
	* runtime/main.c (cleanup): Cast argument to free.
	* intrinsics/spread_generic.c (spread_internal): Match runtime_error
	arguments and format.
	* intrinsics/signal.c (alarm_sub_int_i4, alarm_sub_int_i8): Cast
	pointers to avoid warnings.

From-SVN: r129463
2007-10-18 21:25:21 +00:00
Ben Elliston 9651c2ed93 environ.c (init_choice): Remove unused function.
* runtime/environ.c (init_choice): Remove unused function.
	(show_choice): Likewise.
	(choice): Remove.
	(FP_ROUND_NEAREST, FP_ROUND_UP, FP_ROUND_DOWN, FP_ROUND_ZERO):
	Remove.
	(precision, signal_choices): Remove.

From-SVN: r129423
2007-10-18 09:28:37 +10:00
Christopher D. Rickett 9fd25b5cd5 re PR fortran/32600 ([ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function)
2007-10-15 Christopher D. Rickett <crickett@lanl.gov>

        PR fortran/32600
        * trans-expr.c (gfc_conv_function_call): Generate code to inline
        c_associated.
        * symbol.c (get_iso_c_sym): Preserve from_intmod and
        * intmod_sym_id
        attributes in the resolved symbol.
        * resolve.c (gfc_iso_c_sub_interface): Remove dead code.


2007-10-15 Christopher D. Rickett <crickett@lanl.gov>

        PR fortran/32600
        * libgfortran/intrinsics/iso_c_binding.c: Remove c_associated_1
        and c_associated_2.
        * libgfortran/intrinsics/iso_c_binding.h: Ditto.
        * libgfortran/gfortran.map: Ditto.

From-SVN: r129367
2007-10-15 21:58:55 +02:00
Jerry DeLisle 6ae786d29d re PR libfortran/33055 (Runtime error in INQUIRE unit existance with -fdefault-integer-8)
2007-10-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33055
	* io/inquire.c (inquire_via_unit):  If inquiring by unit, check for
	an error condition from the IOSTAT variable and set EXIST to false if
	there was a bad unit number.

From-SVN: r129344
2007-10-15 13:59:02 +00:00
Jerry DeLisle 45dfbe77d2 re PR libfortran/33672 (Additional runtime checks needed for namelist reads)
2007-10-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33672
	* io/list_read.c (nml_parse_qualifier): Add character specific error
	messages.  Check for proper form of sub-string qualifiers.  Return the
	parsed_rank flag indicating a non-zero rank qualifier.
	(nml_get_obj_data):  Count the instances of non-zero rank qualifiers.
	Issue an error if more that one non-zero rank qualifier is found.

From-SVN: r129309
2007-10-15 01:33:16 +00:00
Jerry DeLisle fed2a4733b Fix ChangeLog.
From-SVN: r129017
2007-10-04 15:59:54 +00:00
Jerry DeLisle 808a2225f9 re PR libfortran/33253 (namelist: reading back a string with apostrophe)
2007-10-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33253
	* io/list_read.c (read_character): Use line_buffer to scan ahead for
	object name or string when no delimiter is found.

From-SVN: r129016
2007-10-04 15:57:28 +00:00
François-Xavier Coudert 34e366b39c re PR fortran/32021 (Fix,document,remove GFORTRAN_* environment variables)
PR libfortran/32021

	* runtime/environ.c (init_mem, show_mem, init_round, show_round,
	init_precision, show_precision, init_signal, show_signal): Remove.
	(variable_table): Remove GFORTRAN_MEM_INIT, GFORTRAN_MEM_CHECK,
	GFORTRAN_SIGHUP, GFORTRAN_SIGINT, GFORTRAN_FPU_ROUND and
	GFORTRAN_FPU_PRECISION.
	* libgfortran.h (options_t): Remove mem_check, fpu_round,
	fpu_precision, sighup, sigint, allocate_init_flag and
	allocate_init_value.

From-SVN: r129014
2007-10-04 15:18:48 +00:00
Jerry DeLisle af2778d32e re PR libfortran/33253 (namelist: reading back a string with apostrophe)
2007-10-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33253
	* io/list_read.c (read_character): Use DELIM_APOSTROPHE and DELIM_QUOTE
        and quote value in check of first character in string.

From-SVN: r128973
2007-10-03 00:33:09 +00:00
Francois-Xavier Coudert e900e0ca88 re PR libfortran/33469 (Default formats for real input are not precise enough)
PR libfortran/33469

	* io/write.c (write_real): Widen the default formats.

	* gfortran.dg/default_format_1.f90: New test.
	* gfortran.dg/default_format_2.f90: New test.
	* gfortran.dg/namelist_print_1.f: Adjust expected output.
	* gfortran.dg/real_const_3.f90: Adjust expected output.

From-SVN: r128967
2007-10-02 23:27:51 +00:00
Jerry DeLisle 04b6b884cd re PR fortran/33400 (Formatted read fails if line ends without line break)
2007-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33400
	* io/list_read.c (next_char): Interpret encountering the end of file the
	first time as an end of line.  Subsequent reads give EOF error.

From-SVN: r128868
2007-09-28 16:55:07 +00:00
Jerry DeLisle 9a1e025540 re PR libfortran/33421 (Weird quotation of namelist output of character arrays)
2007-09-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33421
	* io/list_read.c (read_character): Revert r128057.

From-SVN: r128857
2007-09-28 02:57:41 +00:00
Bernhard Fischer b808ac33a9 re PR libfortran/31546 (add --enable-intermodule)
PR fortran/31546
	* (configure.ac): Add --enable-intermodule for onestep build.
	* (Makefile.am): Handle onestep build.
	* (configure, Makefile.in): Regenerate.

From-SVN: r128654
2007-09-21 19:49:34 +00:00
Francois-Xavier Coudert b65d72ab86 re PR libfortran/26253 (fallback scalbn doesn't handle denormals correctly)
PR libfortran/26253
	* intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate.

From-SVN: r128648
2007-09-21 10:54:20 +00:00
Francois-Xavier Coudert fe046210e2 re PR libfortran/23272 ([mingw32] inquire via filename fails)
PR libfortran/23272

	* io/unix.c (id_from_handle, id_from_path, id_from_fd): New
	functions.
	(compare_file_filename, find_file, find_file0): Use the new
	functions above.

	* gfortran.dg/inquire_10.f90: New test.

From-SVN: r128636
2007-09-20 22:56:48 +00:00
Francois-Xavier Coudert d36ff2b46b acinclude.m4 (LIBGFOR_TARGET_ILP32): Remove test.
* acinclude.m4 (LIBGFOR_TARGET_ILP32): Remove test.
	* configure.ac: Don't call LIBGFOR_TARGET_ILP32.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r128635
2007-09-20 22:43:39 +00:00
Francois-Xavier Coudert 2515e5a7a0 re PR libfortran/21185 (Improve testsuite results on newlib targets)
PR libfortran/21185
	* runtime/compile_options.c (set_options): Fix typo.
	* runtime/main.c (store_exe_path): If getcwd is not available,
	don't use it.
	* intrinsics/getcwd.c: Same thing here.
	* io/unix.c (fallback_access): New fallback function for access.
	(fix_fd): Don't use dup if it's not available.
	* configure.ac: Check for dup and getcwd.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r128512
2007-09-15 14:52:46 +00:00
Francois-Xavier Coudert a01246247e * io/io.h: Include libgfortran.h first.
From-SVN: r128442
2007-09-12 16:20:27 +00:00
Francois-Xavier Coudert 257fafe0c9 re PR libfortran/33386 (Fortran SELECT statement miscompiles)
PR libfortran/33386
	* runtime/select.c (select_string): Initialize default_jump.

From-SVN: r128379
2007-09-11 14:53:02 +00:00
Jerry DeLisle 3a6666054e re PR fortran/33307 (I/O read/positioning problem)
2007-09-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33307
	* io/filepos.c (st_backspace): Don't truncate when already at the end
	of the file.

From-SVN: r128253
2007-09-07 20:16:05 +00:00
Uros Bizjak c664bb1b46 fpu-387.h: Include cpuid.h.
* config/fpu-387.h: Include cpuid.h.
	(set_fpu): Use __get_cpuid to check for SSE.

From-SVN: r128234
2007-09-07 11:34:36 +02:00
Thomas Koenig 3cc50edcc0 re PR libfortran/33298 (Wrong code for SPREAD on zero-sized arrays)
2007-09-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/33298
	* intrinsics/spread_generic.c(spread_internal): Enable
	bounds checking by comparing extents if the bounds_check
	option has been set.  If any extent is <=0, return early.

2007-09-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/33298
	* spread_zerosize_1.f90:  New test case.
	* spread_bounds_1.f90:  New test case.

From-SVN: r128206
2007-09-06 19:25:30 +00:00
David Edelsohn 200809cbbf libgfortran.h: Include config.h first.
* libgfortran.h: Include config.h first.
        * io/io.h (struct stream): Rename truncate to trunc.
        * io/unix.c (fd_open): Same.
        (open_internal): Same.

From-SVN: r128182
2007-09-06 08:40:50 -04:00
Jerry DeLisle 0be72e3a5e re PR libfortran/33253 (namelist: reading back a string with apostrophe)
2007-09-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33253
	* io/write.c (nml_write_obj): Set the delimiter correctly before calling
	write_character. (namelist_write): Clean up the code a little and add
	comments to clarify what its doing.

From-SVN: r128170
2007-09-06 01:20:02 +00:00
Jerry DeLisle 7b71bedf40 re PR libfortran/33225 (Missing last digit in some formatted output (on 32bit targets), per kind write_float)
2007-03-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33225
	* io/write.c (stdbool.h): Add include. (sign_t): Move typedef to
	new file write_float.def. Include write_float.def.
	(extract_real): Delete. (calculate_sign): Delete.
	(calculate_exp): Delete. (calculate_G_format): Delete.
	(output_float): Delete. (write_float): Delete.
	* io/write_float.def (calculate_sign): Added.
	(output_float): Refactored to be independent of kind and added to this
	file for inclusion. (write_infnan): New function to write "Infinite" or
	"NaN" depending on flags passed, independent of kind.
	(CALCULATE_EXP): New macro to build kind specific functions. Use it.
	(OUTPUT_FLOAT_FMT_G): New macro, likewise. Use it.
	(DTOA, DTOAL): Macros to implement "decimal to ascii".
	(WRITE_FLOAT): New macro for kind specific write_float functions.
	(write_float): Revised function to determine kind and use WRITE_FLOAT
	to implement kind specific output.

From-SVN: r128114
2007-09-05 00:51:18 +00:00
Jerry DeLisle b356020960 re PR libfortran/33253 (namelist: reading back a string with apostrophe)
2007-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33253
	* io/list_read.c (read_character): Use DELIM_APOSTROPHE and DELIM_QUOTE
	in check of first character in string.

From-SVN: r128057
2007-09-03 19:29:17 +00:00
Francois-Xavier Coudert d74b97cc7e re PR fortran/31675 (Fortran front-end and libgfortran should have a common header file)
PR fortran/31675

	* libgfortran.h: New file.
	* iso-fortran-env.def: Use macros in the new header instead of
	hardcoded integer constants.
	* Make-lang.in (F95_PARSER_OBJS, GFORTRAN_TRANS_DEPS): Add
	fortran/libgfortran.h.
	* gfortran.h (GFC_STD_*, GFC_FPE_*, options_convert,
	ioerror_codes): Remove.
	* trans.c (ERROR_ALLOCATION): Remove.
	(gfc_call_malloc, gfc_allocate_with_status,
	gfc_allocate_array_with_status): Use LIBERROR_ALLOCATION.
	* trans-types.h (GFC_DTYPE_*): Remove.
	* trans-decl.c (gfc_generate_function_code): Use
	GFC_CONVERT_NATIVE instead of CONVERT_NATIVE.
	* trans-io.c (set_parameter_value, set_parameter_ref): Use
	LIBERROR_* macros instead of IOERROR_ macros.
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Use
	LIBERROR_END and LIBERROR_EOR instead of hardcoded constants.
	* options.c (gfc_init_options): Use GFC_CONVERT_NATIVE instead of
	CONVERT_NATIVE.
	(gfc_handle_option): Use GFC_CONVERT_* macros instead of CONVERT_*.

	* libgfortran.h: Include gcc/fortran/libgfortran.h.
	Remove M_PI, GFC_MAX_DIMENSIONS, GFC_DTYPE_*, GFC_NUM_RANK_BITS,
	error_codes, GFC_STD_*, GFC_FPE_* and unit_convert.
	* runtime/environ.c (variable_table): Use GFC_*_UNIT_NUMBER instead
	of hardcoded constants.
	(do_parse, init_unformatted): Use GFC_CONVERT_* macros instead of
	CONVERT_*.
	* runtime/string.c (find_option): Use LIBERROR_BAD_OPTION instead
	of ERROR_BAD_OPTION.
	* runtime/error.c (translate_error, generate_error): Use
	LIBERROR_* macros instead of ERROR_*.
	* io/file_pos.c (formatted_backspace, unformatted_backspace,
	st_backspace, st_rewind, st_flush): Rename macros.
	* io/open.c (convert_opt, edit_modes, new_unit, already_open,
	st_open): Likewise.
	* io/close.c (st_close): Likewise.
	* io/list_read.c (next_char, convert_integer, parse_repeat,
	read_logical, read_integer, read_character, parse_real,
	check_type, list_formatted_read_scalar, namelist_read,
	nml_err_ret): Likewise.
	* io/read.c (convert_real, read_l, read_decimal, read_radix,
	read_f): Likewise.
	* io/inquire.c (inquire_via_unit): Likewise.
	* io/unit.c (get_internal_unit): Likewise.
	* io/transfer.c (read_sf, read_block, read_block_direct,
	write_block, write_buf, unformatted_read, unformatted_write,
	formatted_transfer_scalar, us_read, us_write, data_transfer_init,
	skip_record, next_record_r, write_us_marker, next_record_w_unf,
	next_record_w, finalize_transfer, st_read, st_write_done):
	Likewise.
	* io/format.c (format_error): Likewise.

From-SVN: r128050
2007-09-03 16:44:15 +00:00
Francois-Xavier Coudert 36ae8a61ad minloc1.m4: Update copyright year and ajust headers order.
* m4/minloc1.m4: Update copyright year and ajust headers order.
	* m4/maxloc1.m4: Likewise.
	* m4/in_pack.m4: Likewise.
	* m4/sum.m4: Likewise.
	* m4/fraction.m4: Likewise.
	* m4/all.m4: Likewise.
	* m4/set_exponent.m4: Likewise.
	* m4/transpose.m4: Likewise.
	* m4/eoshift1.m4: Likewise.
	* m4/spacing.m4: Likewise.
	* m4/eoshift3.m4: Likewise.
	* m4/minval.m4: Likewise.
	* m4/count.m4: Likewise.
	* m4/maxval.m4: Likewise.
	* m4/exponent.m4: Likewise.
	* m4/shape.m4: Likewise.
	* m4/head.m4: Likewise.
	* m4/cshift1.m4: Likewise.
	* m4/minloc0.m4: Likewise.
	* m4/nearest.m4: Likewise.
	* m4/maxloc0.m4: Likewise.
	* m4/pow.m4: Likewise.
	* m4/in_unpack.m4: Likewise.
	* m4/matmull.m4: Likewise.
	* m4/product.m4: Likewise.
	* m4/reshape.m4: Likewise.
	* m4/any.m4: Likewise.
	* m4/rrspacing.m4: Likewise.
	* m4/matmul.m4: Likewise.
	* runtime/backtrace.c: Likewise.
	* runtime/environ.c: Likewise.
	* runtime/in_pack_generic.c: Likewise.
	* runtime/compile_options.c: Likewise.
	* runtime/in_unpack_generic.c: Likewise.
	* runtime/main.c: Likewise.
	* runtime/stop.c: Likewise.
	* runtime/string.c: Likewise.
	* runtime/memory.c: Likewise.
	* runtime/error.c: Likewise.
	* runtime/pause.c: Likewise.
	* intrinsics/ierrno.c: Likewise.
	* intrinsics/system_clock.c: Likewise.
	* intrinsics/cshift0.c: Likewise.
	* intrinsics/unlink.c: Likewise.
	* intrinsics/ctime.c: Likewise.
	* intrinsics/etime.c: Likewise.
	* intrinsics/cpu_time.c: Likewise.
	* intrinsics/malloc.c: Likewise.
	* intrinsics/hostnm.c: Likewise.
	* intrinsics/sleep.c: Likewise.
	* intrinsics/exit.c: Likewise.
	* intrinsics/perror.c: Likewise.
	* intrinsics/transpose_generic.c: Likewise.
	* intrinsics/pack_generic.c: Likewise.
	* intrinsics/spread_generic.c: Likewise.
	* intrinsics/stat.c: Likewise.
	* intrinsics/string_intrinsics.c: Likewise.
	* intrinsics/getcwd.c: Likewise.
	* intrinsics/date_and_time.c: Likewise.
	* intrinsics/unpack_generic.c: Likewise.
	* intrinsics/move_alloc.c: Likewise.
	* intrinsics/getlog.c: Likewise.
	* intrinsics/eoshift0.c: Likewise.
	* intrinsics/eoshift2.c: Likewise.
	* intrinsics/reshape_generic.c: Likewise.
	* intrinsics/system.c: Likewise.
	* intrinsics/iso_c_binding.c: Likewise.
	* intrinsics/env.c: Likewise.
	* intrinsics/kill.c: Likewise.
	* intrinsics/reshape_packed.c: Likewise.
	* intrinsics/time.c: Likewise.
	* intrinsics/gerror.c: Likewise.
	* intrinsics/access.c: Likewise.
	* intrinsics/fnum.c: Likewise.
	* intrinsics/abort.c: Likewise.
	* intrinsics/rename.c: Likewise.
	* intrinsics/signal.c: Likewise.
	* intrinsics/symlnk.c: Likewise.
	* intrinsics/random.c: Likewise.
	* intrinsics/umask.c: Likewise.
	* intrinsics/getXid.c: Likewise.
	* intrinsics/rand.c: Likewise.
	* intrinsics/chdir.c: Likewise.
	* intrinsics/chmod.c: Likewise.
	* intrinsics/clock.c: Likewise.
	* intrinsics/args.c: Likewise.
	* intrinsics/link.c: Likewise.
	* c99_protos.h: Likewise.
	* config/fpu-387.h: Likewise.
	* config/fpu-aix.h: Likewise.
	* config/fpu-sysv.h: Likewise.
	* config/fpu-generic.h: Likewise.
	* config/fpu-glibc.h: Likewise.
	* io/file_pos.c: Likewise.
	* io/open.c: Likewise.
	* io/size_from_kind.c: Likewise.
	* io/close.c: Likewise.
	* io/list_read.c: Likewise.
	* io/read.c: Likewise.
	* io/inquire.c: Likewise.
	* io/unit.c: Likewise.
	* io/unix.c: Likewise.
	* io/transfer.c: Likewise.
	* io/intrinsics.c: Likewise.
	* io/format.c: Likewise.
	* io/lock.c: Likewise.
	* io/write.c: Likewise.
	* io/write_float.def: Likewise.
	* fmain.c: Likewise.
	* generated/minval_r8.c: Regenerate.
	* generated/minloc1_16_r16.c: Regenerate.
	* generated/maxloc1_4_r8.c: Regenerate.
	* generated/sum_i8.c: Regenerate.
	* generated/eoshift3_4.c: Regenerate.
	* generated/transpose_c8.c: Regenerate.
	* generated/any_l16.c: Regenerate.
	* generated/eoshift1_8.c: Regenerate.
	* generated/pow_r8_i8.c: Regenerate.
	* generated/reshape_r16.c: Regenerate.
	* generated/pow_i4_i16.c: Regenerate.
	* generated/maxval_i2.c: Regenerate.
	* generated/product_r4.c: Regenerate.
	* generated/maxloc1_8_i4.c: Regenerate.
	* generated/exponent_r16.c: Regenerate.
	* generated/maxloc0_4_r4.c: Regenerate.
	* generated/fraction_r16.c: Regenerate.
	* generated/in_unpack_i8.c: Regenerate.
	* generated/matmul_r8.c: Regenerate.
	* generated/product_i2.c: Regenerate.
	* generated/fraction_r4.c: Regenerate.
	* generated/minloc0_4_r16.c: Regenerate.
	* generated/reshape_c4.c: Regenerate.
	* generated/minloc0_4_i1.c: Regenerate.
	* generated/maxloc0_4_r16.c: Regenerate.
	* generated/maxloc0_4_i2.c: Regenerate.
	* generated/minloc1_8_r16.c: Regenerate.
	* generated/maxloc1_8_r16.c: Regenerate.
	* generated/set_exponent_r8.c: Regenerate.
	* generated/in_unpack_i16.c: Regenerate.
	* generated/transpose_c16.c: Regenerate.
	* generated/maxloc0_8_i8.c: Regenerate.
	* generated/pow_c4_i8.c: Regenerate.
	* generated/sum_r16.c: Regenerate.
	* generated/sum_i1.c: Regenerate.
	* generated/minloc1_4_r8.c: Regenerate.
	* generated/transpose_r10.c: Regenerate.
	* generated/pow_i8_i4.c: Regenerate.
	* generated/maxloc1_16_r16.c: Regenerate.
	* generated/minloc1_16_i4.c: Regenerate.
	* generated/maxloc1_16_i4.c: Regenerate.
	* generated/minloc0_16_i8.c: Regenerate.
	* generated/maxloc0_16_i8.c: Regenerate.
	* generated/nearest_r8.c: Regenerate.
	* generated/spacing_r16.c: Regenerate.
	* generated/transpose_i8.c: Regenerate.
	* generated/count_16_l16.c: Regenerate.
	* generated/maxval_r16.c: Regenerate.
	* generated/count_8_l8.c: Regenerate.
	* generated/product_c10.c: Regenerate.
	* generated/minloc1_8_i4.c: Regenerate.
	* generated/minloc0_16_i16.c: Regenerate.
	* generated/matmul_r16.c: Regenerate.
	* generated/eoshift1_16.c: Regenerate.
	* generated/minloc0_4_r4.c: Regenerate.
	* generated/pow_c16_i16.c: Regenerate.
	* generated/set_exponent_r10.c: Regenerate.
	* generated/pow_i16_i16.c: Regenerate.
	* generated/product_c4.c: Regenerate.
	* generated/sum_r4.c: Regenerate.
	* generated/pow_c16_i4.c: Regenerate.
	* generated/rrspacing_r10.c: Regenerate.
	* generated/in_pack_c16.c: Regenerate.
	* generated/minloc0_4_i2.c: Regenerate.
	* generated/maxloc0_8_i1.c: Regenerate.
	* generated/reshape_i4.c: Regenerate.
	* generated/minloc0_8_i8.c: Regenerate.
	* generated/matmul_c8.c: Regenerate.
	* generated/spacing_r4.c: Regenerate.
	* generated/in_pack_c4.c: Regenerate.
	* generated/all_l16.c: Regenerate.
	* generated/minloc1_16_r10.c: Regenerate.
	* generated/sum_i2.c: Regenerate.
	* generated/minloc0_16_i1.c: Regenerate.
	* generated/reshape_c16.c: Regenerate.
	* generated/maxloc0_16_i1.c: Regenerate.
	* generated/maxloc1_8_r8.c: Regenerate.
	* generated/minval_i16.c: Regenerate.
	* generated/reshape_r10.c: Regenerate.
	* generated/exponent_r10.c: Regenerate.
	* generated/maxval_i4.c: Regenerate.
	* generated/any_l4.c: Regenerate.
	* generated/minval_i8.c: Regenerate.
	* generated/maxloc1_4_i8.c: Regenerate.
	* generated/fraction_r10.c: Regenerate.
	* generated/maxloc0_16_i16.c: Regenerate.
	* generated/shape_i4.c: Regenerate.
	* generated/pow_r16_i8.c: Regenerate.
	* generated/maxloc0_8_r4.c: Regenerate.
	* generated/rrspacing_r8.c: Regenerate.
	* generated/pow_c10_i4.c: Regenerate.
	* generated/minloc1_4_i16.c: Regenerate.
	* generated/minloc0_4_r10.c: Regenerate.
	* generated/maxloc1_4_i16.c: Regenerate.
	* generated/minloc0_8_i16.c: Regenerate.
	* generated/maxloc0_4_r10.c: Regenerate.
	* generated/maxloc0_8_i16.c: Regenerate.
	* generated/minloc1_8_r10.c: Regenerate.
	* generated/product_i4.c: Regenerate.
	* generated/minloc0_16_r4.c: Regenerate.
	* generated/sum_c16.c: Regenerate.
	* generated/maxloc1_8_r10.c: Regenerate.
	* generated/maxloc0_16_r4.c: Regenerate.
	* generated/transpose_c10.c: Regenerate.
	* generated/minloc1_16_r8.c: Regenerate.
	* generated/minloc0_8_i1.c: Regenerate.
	* generated/maxloc0_4_i4.c: Regenerate.
	* generated/transpose_r4.c: Regenerate.
	* generated/maxloc1_16_r8.c: Regenerate.
	* generated/pow_i16_i8.c: Regenerate.
	* generated/cshift1_4.c: Regenerate.
	* generated/maxloc0_8_i2.c: Regenerate.
	* generated/sum_r10.c: Regenerate.
	* generated/nearest_r16.c: Regenerate.
	* generated/sum_c4.c: Regenerate.
	* generated/maxloc1_16_r10.c: Regenerate.
	* generated/count_4_l16.c: Regenerate.
	* generated/pow_c8_i8.c: Regenerate.
	* generated/matmul_i8.c: Regenerate.
	* generated/in_pack_i4.c: Regenerate.
	* generated/pow_i4_i8.c: Regenerate.
	* generated/minloc0_16_i2.c: Regenerate.
	* generated/minloc1_8_r8.c: Regenerate.
	* generated/maxloc0_16_i2.c: Regenerate.
	* generated/exponent_r4.c: Regenerate.
	* generated/spacing_r10.c: Regenerate.
	* generated/matmul_c16.c: Regenerate.
	* generated/pow_c4_i16.c: Regenerate.
	* generated/maxval_r10.c: Regenerate.
	* generated/count_4_l4.c: Regenerate.
	* generated/shape_i16.c: Regenerate.
	* generated/minval_i1.c: Regenerate.
	* generated/maxloc1_4_i1.c: Regenerate.
	* generated/matmul_r10.c: Regenerate.
	* generated/minloc1_4_i8.c: Regenerate.
	* generated/pow_r10_i8.c: Regenerate.
	* generated/minloc0_8_r4.c: Regenerate.
	* generated/in_unpack_c4.c: Regenerate.
	* generated/matmul_l4.c: Regenerate.
	* generated/product_i16.c: Regenerate.
	* generated/minloc0_16_r16.c: Regenerate.
	* generated/reshape_r8.c: Regenerate.
	* generated/pow_r10_i16.c: Regenerate.
	* generated/all_l4.c: Regenerate.
	* generated/in_pack_c10.c: Regenerate.
	* generated/minloc0_4_i4.c: Regenerate.
	* generated/minloc0_8_i2.c: Regenerate.
	* generated/matmul_i1.c: Regenerate.
	* generated/reshape_c10.c: Regenerate.
	* generated/minval_r4.c: Regenerate.
	* generated/maxloc1_4_r4.c: Regenerate.
	* generated/pow_r8_i16.c: Regenerate.
	* generated/sum_i4.c: Regenerate.
	* generated/maxval_r8.c: Regenerate.
	* generated/count_16_l8.c: Regenerate.
	* generated/transpose_c4.c: Regenerate.
	* generated/eoshift1_4.c: Regenerate.
	* generated/eoshift3_8.c: Regenerate.
	* generated/minval_r16.c: Regenerate.
	* generated/minloc1_4_i1.c: Regenerate.
	* generated/minval_i2.c: Regenerate.
	* generated/maxloc1_4_i2.c: Regenerate.
	* generated/pow_i8_i16.c: Regenerate.
	* generated/product_r8.c: Regenerate.
	* generated/maxloc1_8_i8.c: Regenerate.
	* generated/maxloc0_4_r8.c: Regenerate.
	* generated/maxloc0_16_r16.c: Regenerate.
	* generated/in_unpack_i4.c: Regenerate.
	* generated/matmul_r4.c: Regenerate.
	* generated/sum_c10.c: Regenerate.
	* generated/minloc1_4_r16.c: Regenerate.
	* generated/fraction_r8.c: Regenerate.
	* generated/maxloc1_4_r16.c: Regenerate.
	* generated/set_exponent_r4.c: Regenerate.
	* generated/minloc0_8_r16.c: Regenerate.
	* generated/in_unpack_c16.c: Regenerate.
	* generated/reshape_c8.c: Regenerate.
	* generated/maxloc0_8_r16.c: Regenerate.
	* generated/nearest_r10.c: Regenerate.
	* generated/maxloc0_8_i4.c: Regenerate.
	* generated/pow_c4_i4.c: Regenerate.
	* generated/matmul_i2.c: Regenerate.
	* generated/minloc1_4_r4.c: Regenerate.
	* generated/transpose_i16.c: Regenerate.
	* generated/matmul_c10.c: Regenerate.
	* generated/minloc0_16_i4.c: Regenerate.
	* generated/maxloc0_16_i4.c: Regenerate.
	* generated/pow_i8_i8.c: Regenerate.
	* generated/nearest_r4.c: Regenerate.
	* generated/minloc1_16_i8.c: Regenerate.
	* generated/maxloc1_16_i8.c: Regenerate.
	* generated/transpose_i4.c: Regenerate.
	* generated/count_8_l4.c: Regenerate.
	* generated/minloc1_4_i2.c: Regenerate.
	* generated/matmul_l16.c: Regenerate.
	* generated/maxloc1_8_i1.c: Regenerate.
	* generated/minloc0_16_r10.c: Regenerate.
	* generated/minloc1_8_i8.c: Regenerate.
	* generated/minloc0_4_r8.c: Regenerate.
	* generated/product_r16.c: Regenerate.
	* generated/product_c8.c: Regenerate.
	* generated/pow_r16_i16.c: Regenerate.
	* generated/sum_r8.c: Regenerate.
	* generated/pow_c16_i8.c: Regenerate.
	* generated/in_pack_i16.c: Regenerate.
	* generated/minloc0_8_i4.c: Regenerate.
	* generated/matmul_c4.c: Regenerate.
	* generated/minloc1_16_i16.c: Regenerate.
	* generated/reshape_i8.c: Regenerate.
	* generated/spacing_r8.c: Regenerate.
	* generated/in_pack_c8.c: Regenerate.
	* generated/maxloc1_8_r4.c: Regenerate.
	* generated/minloc1_16_i1.c: Regenerate.
	* generated/maxloc1_16_i1.c: Regenerate.
	* generated/reshape_i16.c: Regenerate.
	* generated/minval_r10.c: Regenerate.
	* generated/pow_r4_i8.c: Regenerate.
	* generated/minloc1_8_i1.c: Regenerate.
	* generated/minval_i4.c: Regenerate.
	* generated/maxloc1_4_i4.c: Regenerate.
	* generated/maxloc1_8_i2.c: Regenerate.
	* generated/maxval_i8.c: Regenerate.
	* generated/eoshift3_16.c: Regenerate.
	* generated/any_l8.c: Regenerate.
	* generated/maxloc0_16_r10.c: Regenerate.
	* generated/rrspacing_r4.c: Regenerate.
	* generated/shape_i8.c: Regenerate.
	* generated/maxloc0_8_r8.c: Regenerate.
	* generated/minloc0_4_i16.c: Regenerate.
	* generated/maxloc0_4_i16.c: Regenerate.
	* generated/minloc1_4_r10.c: Regenerate.
	* generated/minloc1_8_i16.c: Regenerate.
	* generated/pow_c10_i8.c: Regenerate.
	* generated/maxloc1_4_r10.c: Regenerate.
	* generated/maxloc1_8_i16.c: Regenerate.
	* generated/in_unpack_c10.c: Regenerate.
	* generated/minloc0_8_r10.c: Regenerate.
	* generated/maxloc0_8_r10.c: Regenerate.
	* generated/minloc1_16_r4.c: Regenerate.
	* generated/maxloc1_16_r4.c: Regenerate.
	* generated/minloc0_16_r8.c: Regenerate.
	* generated/pow_i16_i4.c: Regenerate.
	* generated/product_i8.c: Regenerate.
	* generated/maxloc0_16_r8.c: Regenerate.
	* generated/sum_i16.c: Regenerate.
	* generated/maxloc0_4_i8.c: Regenerate.
	* generated/transpose_r8.c: Regenerate.
	* generated/cshift1_8.c: Regenerate.
	* generated/maxloc1_16_i16.c: Regenerate.
	* generated/matmul_i4.c: Regenerate.
	* generated/pow_c8_i4.c: Regenerate.
	* generated/pow_i4_i4.c: Regenerate.
	* generated/minloc1_8_r4.c: Regenerate.
	* generated/sum_c8.c: Regenerate.
	* generated/count_8_l16.c: Regenerate.
	* generated/minloc1_16_i2.c: Regenerate.
	* generated/maxloc1_16_i2.c: Regenerate.
	* generated/in_pack_i8.c: Regenerate.
	* generated/transpose_r16.c: Regenerate.
	* generated/maxval_i16.c: Regenerate.
	* generated/exponent_r8.c: Regenerate.
	* generated/matmul_i16.c: Regenerate.
	* generated/count_4_l8.c: Regenerate.
	* generated/pow_c8_i16.c: Regenerate.
	* generated/maxval_i1.c: Regenerate.
	* generated/minloc1_4_i4.c: Regenerate.
	* generated/minloc1_8_i2.c: Regenerate.
	* generated/pow_c10_i16.c: Regenerate.
	* generated/product_c16.c: Regenerate.
	* generated/reshape_r4.c: Regenerate.
	* generated/in_unpack_c8.c: Regenerate.
	* generated/minloc0_8_r8.c: Regenerate.
	* generated/matmul_l8.c: Regenerate.
	* generated/product_r10.c: Regenerate.
	* generated/set_exponent_r16.c: Regenerate.
	* generated/cshift1_16.c: Regenerate.
	* generated/product_i1.c: Regenerate.
	* generated/all_l8.c: Regenerate.
	* generated/maxloc0_4_i1.c: Regenerate.
	* generated/rrspacing_r16.c: Regenerate.
	* generated/minloc0_4_i8.c: Regenerate.
	* generated/pow_r4_i16.c: Regenerate.
	* generated/count_16_l4.c: Regenerate.
	* generated/maxval_r4.c: Regenerate.

From-SVN: r127990
2007-08-31 14:01:34 +00:00
Jerry DeLisle 828fa4991b re PR libfortran/33225 (Missing last digit in some formatted output (on 32bit targets), per kind write_float)
2007-08-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33225
	* io/write.c: Revert changes from patch of 2007-08-27.
	* io/write_float.def: Remove file, reverting addition.

From-SVN: r127950
2007-08-31 01:37:31 +00:00
Francois-Xavier Coudert 4376b7cf2b builtin-types.def (BT_FN_PTR_PTR_SIZE): New type.
* builtin-types.def (BT_FN_PTR_PTR_SIZE): New type.
	* builtins.def (BUILT_IN_REALLOC): New builtin.

	* trans-array.c (gfc_grow_array): Use gfc_call_realloc.
	(gfc_array_allocate): Use gfc_allocate_with_status and
	gfc_allocate_array_with_status.
	(gfc_array_deallocate): Use gfc_deallocate_with_status.
	(gfc_trans_dealloc_allocated): Use gfc_deallocate_with_status.
	* trans-stmt.c (gfc_trans_allocate): Use gfc_allocate_with_status.
	(gfc_trans_deallocate): Use gfc_deallocate_with_status.
	* trans.c (gfc_allocate_with_status, gfc_allocate_array_with_status,
	gfc_deallocate_with_status, gfc_call_realloc): New functions.
	* trans.h (gfc_allocate_with_status, gfc_allocate_array_with_status,
	gfc_deallocate_with_status, gfc_call_realloc): New prototypes.
	(gfor_fndecl_internal_realloc, gfor_fndecl_allocate,
	gfor_fndecl_allocate_array, gfor_fndecl_deallocate): Remove.
	* f95-lang.c (gfc_init_builtin_functions): Create decl for
	BUILT_IN_REALLOC.
	* trans-decl.c (gfor_fndecl_internal_realloc,
	gfor_fndecl_allocate, gfor_fndecl_allocate_array,
	gfor_fndecl_deallocate): Remove function decls.
	(gfc_build_builtin_function_decls): Likewise.

	* runtime/memory.c (internal_realloc, allocate, allocate_array,
	deallocate): Remove functions.
	* gfortran.map (_gfortran_allocate, _gfortran_allocate_array,
	_gfortran_deallocate, _gfortran_internal_realloc): Remove symbols.
	* libgfortran.h (error_codes): Add comment.

	* gfortran.dg/alloc_comp_basics_1.f90: Update check.
	* gfortran.dg/alloc_comp_constructor_1.f90: Update check.

From-SVN: r127897
2007-08-29 12:44:32 +00:00
Jerry DeLisle 0f35a72c2a Fix ChangeLog.
From-SVN: r127883
2007-08-29 04:09:20 +00:00
Jerry DeLisle 5d75fb81c7 re PR libfortran/33055 (Runtime error in INQUIRE unit existance with -fdefault-integer-8)
2007-08-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/33055
	Revert previous patch.

From-SVN: r127877
2007-08-29 02:26:01 +00:00
Jerry DeLisle 2861f77f87 write.c (stdbool.h): Add include.
2007-08-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/write.c (stdbool.h): Add include. (sign_t): Move typedef to
	new file write_float.def. Include write_float.def.
	(extract_real): Delete. (calculate_sign): Delete.
	(calculate_exp): Delete. (calculate_G_format): Delete.
	(output_float): Delete. (write_float): Delete.
	* io/write_float.def (calculate_sign): Added.
	(output_float): Refactored to be independent of kind and added to this
	file for inclusion. (write_infnan): New function to write "Infinite" or
	"NaN" depending on flags passed, independent of kind.
	(CALCULATE_EXP): New macro to build kind specific functions. Use it.
	(OUTPUT_FLOAT_FMT_G): New macro, likewise. Use it.
	(DTOA, DTOAL): Macros to implement "decimal to ascii".
	(WRITE_FLOAT): New macro for kind specific write_float functions.
	(write_float): Revised function to determine kind and use WRITE_FLOAT
	to implement kind specific output.

From-SVN: r127846
2007-08-28 00:56:05 +00:00
Jerry DeLisle 128997b6a5 re PR libfortran/33055 (Runtime error in INQUIRE unit existance with -fdefault-integer-8)
2007-08-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/33055
	* trans-io.c (create_dummy_iostat): New function to create a unique
	dummy variable expression to use with IOSTAT.
	(gfc_trans_inquire): Use the new function to pass unit number error info
	to run-time library if a regular IOSTAT variable was not given.

	PR libfortran/33055
	* io/inquire.c (inquire_via_unit):  If inquiring by unit, check for 
	an error condition from the IOSTAT variable and set EXIST to false if
	there was a bad unit number.

From-SVN: r127817
2007-08-26 22:04:48 +00:00
Thomas Koenig 28dc6b33c4 re PR libfortran/32972 (performance of pack/unpack)
2007-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/32972
	* iresolve.c:  Don't convert array masks.

2007-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/32972
	* libgfortran.h:  Remove GFOR_POINTER_L8_TO_L4 macro.
	Add GFOR_POINTER_TO_L1 macro.
	* m4/iforeach.m4(`m'name`'rtype_qual`_'atype_code):
	Change argument 'mask' to gfc_array_l1.  Adjust prototype.
	Change mask pointer to GFC_LOGICAL_1.  Multiply strides
	by kind of mask
	* m4/ifunction.m4:  Likewise.
	* intrinsics/pack_generic.c(pack_internal):  Likewise.
	* intrinsics/unpack_generic.c(unpack_internal):  Likewise.
	* m4/matmull.m4:  Switch to GFC_LOGICAL_1.  Multiply strides by
	kind of logical arguments a and b.
	* generated/matmul_l16.c: Regenerated.
	* generated/matmul_l4.c: Regenerated.
	* generated/matmul_l8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

From-SVN: r127774
2007-08-24 16:16:16 +00:00
Francois-Xavier Coudert db8092dc4c re PR libfortran/23138 ([mingw32] real(16) values are printed incorrectly)
PR libfortran/23138
	* acinclude.m4 (LIBGFOR_CHECK_MINGW_SNPRINTF): New check.
	* configure.ac: Use LIBGFOR_CHECK_MINGW_SNPRINTF.
	* libgfortran.h: If HAVE_MINGW_SNPRINTF is true, use __mingw_snprintf
	instead of snprintf.
	* config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r127739
2007-08-23 13:03:35 +00:00
Bernhard Fischer 3a923a7585 Makefile.am (AM_CPPFLAGS): Commentary typo fix.
2007-08-22  Bernhard Fischer  <rep.dot.nop@gmail.com>

	* libgfortran/Makefile.am (AM_CPPFLAGS): Commentary typo fix.

From-SVN: r127714
2007-08-22 22:30:26 +02:00
Francois-Xavier Coudert 000007c535 re PR libfortran/33079 (Optional empty strings do not appear to be 'PRESENT')
PR fortran/33079

	* intrinsics/string_intrinsics.c (string_trim, string_minmax): Fix
	the zero-length result case.

	* gfortran.dg/zero_length_2.f90: New test.

From-SVN: r127584
2007-08-17 13:09:23 +00:00
Francois-Xavier Coudert ee5d176a88 re PR fortran/33077 (RANDOM_SEED failure for integer(kind=8))
PR fortran/33077
	* intrinsics/random.c (random_seed_i8): Fix code logic.
	* gfortran.dg/random_7.f90: Initialize variable.

From-SVN: r127512
2007-08-15 12:35:57 +00:00
Danny Smith 6e20eae994 * acinclude.m4 (GTHREAD_USE_WEAK) Define to 0 for mingw32.
* configure: Regenerate.

From-SVN: r127395
2007-08-13 12:21:35 +00:00
Francois-Xavier Coudert 34b4bc5c61 re PR fortran/30964 (optional arguments to random_seed)
PR fortran/30964
	PR fortran/33054

	* trans-expr.c (gfc_conv_function_call): When no formal argument
	list is available, we still substitute missing optional arguments.
	* check.c (gfc_check_random_seed): Correct the check on the
	number of arguments to RANDOM_SEED.
	* intrinsic.c (add_subroutines): Add a resolution function to
	RANDOM_SEED.
	* iresolve.c (gfc_resolve_random_seed): New function.
	* intrinsic.h (gfc_resolve_random_seed): New prototype.

	* intrinsics/random.c (random_seed): Rename into random_seed_i4.
	(random_seed_i8): New function.
	* gfortran.map (GFORTRAN_1.0): Remove _gfortran_random_seed,
	add _gfortran_random_seed_i4 and _gfortran_random_seed_i8.
	* libgfortran.h (iexport_proto): Replace random_seed by
	random_seed_i4 and random_seed_i8.
	* runtime/main.c (init): Call the new random_seed_i4.

	* gfortran.dg/random_4.f90: New test.
	* gfortran.dg/random_5.f90: New test.
	* gfortran.dg/random_6.f90: New test.
	* gfortran.dg/random_7.f90: New test.

From-SVN: r127383
2007-08-12 20:45:29 +00:00
Francois-Xavier Coudert 2b840e5067 re PR fortran/31189 (Support backtracing for non-library errors)
PR fortran/31189

	* runtime/backtrace.c (show_backtrace): Skip _gfortrani_handler
	when displaying backtrace.
	* runtime/compile_options.c: Include <signal.h>.
	(handler): New function.
	(set_options): Set signal handlers for backtrace.
	* libgfortran.h (handler): Add prototype.

	* invoke.texi (-fbacktrace): Document the new behaviour.

Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>

From-SVN: r127364
2007-08-11 21:52:22 +00:00
Francois-Xavier Coudert c9ff1de3ae re PR fortran/32937 (segfault with string and -fdefault-integer-8)
PR fortran/32937

	* trans-array.c (gfc_conv_expr_descriptor): Use
	gfc_conv_const_charlen to generate backend_decl of right type.
	* trans-expr.c (gfc_conv_expr_op): Use correct return type.
	(gfc_build_compare_string): Use int type instead of default
	integer kind for single character comparison.
	(gfc_conv_aliased_arg): Give backend_decl the right type.
	* trans-decl.c (gfc_build_intrinsic_function_decls): Make
	compare_string return an int.

	* gfortran.dg/char_length_6.f90: New test.

	* intrinsics/string_intrinsics.c (compare_string): Return an int.
	* libgfortran.h (compare_string): Likewise.

From-SVN: r127363
2007-08-11 21:31:35 +00:00
Francois-Xavier Coudert c8fe94c7ea re PR fortran/31270 (print subscript value and array bounds when out-of-bounds error occurs)
PR fortran/31270

	* trans.c (gfc_trans_runtime_check): Reorder arguments and
	add extra variable arguments. Hand them to the library function.
	* trans.h (gfc_trans_runtime_check): Update prototype.
	* trans-array.c (gfc_trans_array_bound_check): Issue more
	detailled error messages.
	(gfc_conv_array_ref): Likewise.
	(gfc_conv_ss_startstride): Likewise.
	(gfc_trans_dummy_array_bias): Reorder arguments to
	gfc_trans_runtime_check.
	* trans-expr.c (gfc_conv_substring): Issue more detailled
	error messages.
	(gfc_conv_function_call): Reorder arguments to gfc_trans_runtime_check.
	* trans-stmt.c (gfc_trans_goto): Likewise.
	* trans-io.c (set_string): Reorder arguments to
	gfc_trans_runtime_check and issue a more detailled error message.
	* trans-decl.c (gfc_build_builtin_function_decls): Make
	runtime_error and runtime_error_at handle a variable number of
	arguments.
	* trans-intrinsic.c (gfc_conv_intrinsic_bound): Reorder arguments
	to gfc_trans_runtime_check.
	(gfc_conv_intrinsic_minmax): Likewise.
	(gfc_conv_intrinsic_repeat): Issue more detailled error messages.

	* runtime/error.c (runtime_error_at): Add a variable number of
	arguments.
	* libgfortran.h (runtime_error_at): Update prototype.

From-SVN: r127352
2007-08-10 22:12:04 +00:00
Francois-Xavier Coudert 8a09ef91fa re PR fortran/32933 (ICE in simplify_subreg with -fdefault-integer-8)
PR fortran/32933

	* trans-decl.c (gfc_build_builtin_function_decls): Change
	prototype for associated.
	* trans-intrinsic.c (gfc_conv_intrinsic_minmax): Convert the
	result of __builtin_isnan into a boolean.
	(gfc_conv_intrinsic_strcmp): Cleanup.
	(gfc_conv_associated): Convert the result of the associated
	function into a boolean.

	* intrinsics/associated.c: Change return type of associated into
	a C int.

From-SVN: r127334
2007-08-10 13:20:46 +00:00
Jerry DeLisle cf9293a17e re PR fortran/33039 (Read NAMELIST: reads wrong namelist name)
2007-08-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33039
	* io/list_read.c (find_nml_name): Check for a space after a namelist
	name match.

From-SVN: r127332
2007-08-10 12:36:01 +00:00
Tobias Burnus c2df0359e6 re PR fortran/32987 (TAB in FORMAT: accept extension, warn with -std=f*)
2007-08-09  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32987
	* io.c (format_token): Add FMT_ERROR.
	(next_char_not_space): Print error/warning when
	'\t' are used in format specifications.
	(format_lex): Propagate error.
	(check_format): Ditto.

2007-08-09  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32987
	* io/format.c (next_char): Treat '\t' as ' ' in format specification.

2007-08-09  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32987
	* gfortran.dg/fmt_tab_1.f90: New.
	* gfortran.dg/fmt_tab_2.f90: New.

From-SVN: r127324
2007-08-10 00:02:32 +02:00
Francois-Xavier Coudert 19c222f890 re PR fortran/30947 (intrinsic: ALARM)
PR fortran/30947

	* iresolve.c (gfc_resolve_alarm_sub): Suffix the subroutine name
	with the kind of the STATUS argument.

	* intrinsics/signal.c: Create specific versions of alarm_sub and
	alarm_sub_int according to the integer kind of the last argument.
	* gfortran.map (GFORTRAN_1.0): Remove _gfortran_alarm_sub and
	_gfortran_alarm_sub_int, add _gfortran_alarm_sub_i4,
	_gfortran_alarm_sub_i8, _gfortran_alarm_sub_int_i4 and
	_gfortran_alarm_sub_int_i8.

From-SVN: r127259
2007-08-06 23:02:38 +00:00
Francois-Xavier Coudert 2263c77558 re PR fortran/29828 ([F2003] MIN and MAX with character variables)
PR fortran/29828

	* trans.h (gfor_fndecl_string_minmax): New prototype.
	* trans-decl.c (gfor_fndecl_string_minmax): New variable.
	(gfc_build_intrinsic_function_decls): Create gfor_fndecl_string_minmax.
	* check.c (gfc_check_min_max): Allow for character arguments.
	* trans-intrinsic.c (gfc_conv_intrinsic_minmax_char): New function.
	(gfc_conv_intrinsic_function): Add special case for MIN and MAX
	intrinsics with character arguments.
	* simplify.c (simplify_min_max): Add simplification for character
	arguments.

	* intrinsics/string_intrinsics.c (string_minmax): New function
	and prototype.
	* gfortran.map (GFORTRAN_1.0): Add _gfortran_string_minmax

	* gfortran.dg/minmax_char_1.f90: New test.
	* gfortran.dg/minmax_char_2.f90: New test.
	* gfortran.dg/min_max_optional_4.f90: New test.

From-SVN: r127252
2007-08-06 20:47:17 +00:00
Francois-Xavier Coudert c120ef140a re PR fortran/31202 (Incorrect rounding generated for NINT)
2007-08-05  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR fortran/31202
	* intrinsics/c99_functions.c (roundl): Provide fallback
	implementation for systems without ceill.
	* c99_protos.h (roundl): Define prototype in all cases.

From-SVN: r127227
2007-08-05 22:14:34 +00:00
Thomas Koenig f353733a26 re PR libfortran/32977 (All gfortran tests fail on Tru64 UNIX V4.0F: vsnprintf missing)
2007-08-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32977
	* io/unix.c:  If there is no vsnprintf, use vsprintf and issue
	a fatal error when a buffer overrun occurs.

From-SVN: r127187
2007-08-03 22:09:10 +00:00
Francois-Xavier Coudert 94f548c244 re PR fortran/31202 (Incorrect rounding generated for NINT)
PR fortran/31202

        * f95-lang.c (gfc_init_builtin_functions): Defin builtins for 
        lround{f,,l} and llround{f,,l}.
        * trans-intrinsic.c (build_fix_expr): Generate calls to the
        {l,}round{f,,l} functions.

        * intrinsics/c99_functions.c (roundl,lroundf,lround,lroundl,
        llroundf,llround,llroundl): New functions.
        * c99_protos.h (roundl,lroundf,lround,lroundl,llroundf,llround,
        llroundl): New prototypes.
        * configure.ac: Check for lroundf, lround, lroundl, llroundf,
        llround and llroundl.
        * configure: Regenerate.
        * Makefile.in: Regenerate.
        * config.h.in: Regenerate.

        * gfortran.dg/nint_2.f90: New test.

From-SVN: r127185
2007-08-03 21:26:10 +00:00
Francois-Xavier Coudert 7f7639220a * libgfortran.h: Include <stdarg.h>.
From-SVN: r127060
2007-07-30 13:02:50 +00:00
Thomas Koenig d8163f5cc0 re PR libfortran/32858 (printf-capabilities for runtime_error())
2007-07-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32858
	PR libfortran/30814
	* configure.ac:  Added checks for presence of stdio.h and
	stdarg.h.  Test presence of vsnprintf().
	* configure: Regenerated.
	* config.h.in:  Regenerated.
	* libgfortran.h:  Include <stdio.h>.  Add printf attribute to
	prototype of runtime_error.  Remove prototype for st_sprintf.
	Add prototype for st_vprintf.
	* runtime/main.c (store_exec_path):  Replace st_sprintf by sprintf.
	* runtime/error.c (st_sprintf):  Remove.
	(runtime_error):  Rewrite as a variadic function.  Call
	st_vprintf().
	* intrinsics/pack_generic.c:  Output extents of LHS and RHS for
	bounds error.
	* io/open.c (new_unit):  Replace st_sprintf by sprintf.
	* io/list_read.c (convert_integer):  Likewise.
	(parse_repeat):  Likewise.
	(read_logical):  Likewise.
	(read_character):  Likewise.
	(parse_real):  Likewise.
	(read_real):  Likewise.
	(check_type):  Likewise.
	(nml_parse_qualifyer):  Likewise.
	(nml_read_obj):  Likewise.
	(nml_get_ojb_data):  Likewise.
	* io/unix.c (init_error_stream):  Remove.
	(tempfile):  Replace st_sprintf by sprintf.
	(st_vprintf):  New function.
	(st_printf):  Rewrite to call st_vprintf.
	* io/transfer.c (require_type):  Replace st_sprintf by sprintf.
	* io/format.c (format_error):  Likewise.
	* io/write.c (nml_write_obj):  Likewise.

2007-07-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32858
	PR libfortran/30814
	* gfortran.dg/pack_bounds_1.f90:  Adjust to new error message.

From-SVN: r127049
2007-07-29 20:01:45 +00:00
Janne Blomqvist 6520ecacd5 Fortran frontend changelog:
2007-07-27  Janne Blomqvist  <jb@gcc.gnu.org>

	* trans-io.c (gfc_build_io_library_fndecls): Change to use
	gfc_array_index_type for array descriptor triplets instead of
	gfc_int4_type_node.

libgfortran ChangeLog:

2007-07-27  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/transfer.c (st_set_nml_var_dim): Use index_type instead of
	GFC_INTEGER_4 for array descriptor triplets.

From-SVN: r126992
2007-07-27 21:13:37 +03:00
Francois-Xavier Coudert 008afe5148 * io/unix.c (stream_ttyname): Mark argument as potentialy unused.
From-SVN: r126983
2007-07-27 16:42:12 +00:00
Francois-Xavier Coudert 2b8327ce6a re PR fortran/32035 ('<anonymous>' may be used uninitialized in this function)
PR fortran/32035

	* trans-stmt.c (gfc_trans_character_select): Replace the
	mechanism with labels by a SWITCH_EXPR.
	* trans-decl.c (gfc_build_builtin_function_decls): Change
	return type for select_string.

	* runtime/select.c (select_string): Adjust prototype and function
	so that the return value is an integer, not a pointer.

	* gfortran.dg/select_char_1.f90: New test.

From-SVN: r126978
2007-07-27 14:26:43 +00:00
Tobias Burnus bdcfceb443 ChangeLog: Correct entry.
gcc/fortran/
2007-07-24  Tobias Burnus  <burnus@net-b.de>

	* ChangeLog: Correct entry.

libgfortran/
2007-07-24  Tobias Burnus  <burnus@net-b.de>

       * libgfortran.h:  Add bounds_check to compile_options_t.

From-SVN: r126877
2007-07-24 14:58:20 +02:00
Thomas Koenig 18fe404fbc re PR fortran/30814 (non-conforming array sizes in PACK should raise an error)
2007-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/30814
	* trans-decl.c (generate_function_code):  Add argument
	for flag_bounds_check to the array for set_options.
	* invoke.texi:  Mention that some checks require
	-fbounds-check to be set during compilation of the
	main program.

2007-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/30814
	* libgfortran.h:  Add bounds_check to compile_options_t.
	* runtime/compile_options.c (set_options):  Add handling
	of compile_options.bounds_check.
	* intrinsics/pack_generic.c (pack_internal):  Also determine
	the number of elements if compile_options.bounds_check is
	true.  Raise runtime error if a different array shape is
	detected.

2007-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/30814
	* gfortran.dg/pack_bounds_1.f90:  New test case.

From-SVN: r126866
2007-07-24 05:52:44 +00:00
Christopher D. Rickett 089db47df6 re PR fortran/32600 ([ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function)
2007-07-23  Christopher D. Rickett  <crickett@lanl.gov>
	    Tobias Burnus  <burnus@net-b.de>

	PR fortran/32600
	* trans-expr.c (gfc_conv_function_call): Handle c_funloc.
	* trans-types.c: Add pfunc_type_node.
	(gfc_init_types,gfc_typenode_for_spec): Use it.
	* resolve.c (gfc_iso_c_func_interface): Fix whitespace and
	improve error message.

2007-07-23  Christopher D. Rickett  <crickett@lanl.gov>

	PR fortran/32600
	* intrinsics/iso_c_binding.c (c_funloc): Remove.
	* intrinsics/iso_c_binding.h: Remove c_funloc.
	* gfortran.map: Ditto.

2007-07-23  Christopher D. Rickett  <crickett@lanl.gov>

	PR fortran/32600
	* gfortran.dg/c_funloc_tests_5.f03: New.
	* gfortran.dg/c_funloc_tests_5.f04: New.
	* gfortran.dg/c_funloc_tests_4_driver.c: New.


Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r126835
2007-07-23 08:03:33 +02:00
Jerry DeLisle db75c37a3a read.c (convert_real): Generate error only on EINVAL.
2007-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/read.c (convert_real): Generate error only on EINVAL.

From-SVN: r126834
2007-07-23 02:42:05 +00:00
Christopher D. Rickett 6ad5cf725f re PR fortran/32627 ([ISO Bind C] Accept c_f_pointer for TYPE)
2007-07-21  Christopher D. Rickett  <crickett@lanl.gov>

        PR fortran/32627
        * resolve.c (set_name_and_label): Set kind number for character
        version of c_f_pointer.
        (gfc_iso_c_sub_interface): Set the kind of the SHAPE formal arg to
        that of the actual SHAPE arg.
        * symbol.c (gen_shape_param): Initialize kind for SHAPE arg.

2007-07-21  Christopher D. Rickett  <crickett@lanl.gov>

        PR fortran/32627
        * libgfortran/intrinsics/iso_c_generated_procs.c: Add c_f_pointer
        for character/string arguments.
        * libgfortran/intrinsic/iso_c_binding.c (c_f_pointer_u0): Allow
        the optional SHAPE arg to be any valid integer kind.
        * libgfortran/gfortran.map: Add c_f_pointer_s0.
        * libgfortran/mk-kinds-h.sh: Save smallest integer kind as default
        character kind.
        * libgfortran/intrinsics/iso_c_generated_procs.c: Add versions of
        c_f_pointer for complex and logical types.
        * libgfortran/gfortran.map: Add c_f_pointer versions for logical
        and complex types.

2007-07-21  Christopher D. Rickett  <crickett@lanl.gov>

        PR fortran/32627
        * gfortran.dg/pr32627_driver.c: Driver for pr32627.
        * gfortran.dg/pr32627.f03: New test case.
        * gfortran.dg/c_f_pointer_logical.f03: New test case.
        * gfortran.dg/c_f_pointer_logical_driver.c: Driver for
        c_f_pointer_logical.
        * gfortran.dg/c_f_pointer_complex_driver.c: Driver for
        c_f_pointer_complex.
        * gfortran.dg/c_f_pointer_complex.f03: New test case.
        * gfortran.dg/c_f_pointer_shape_tests_2_driver.c: Driver for
        c_f_pointer_shape_tests_2.
        * gfortran.dg/c_f_pointer_shape_tests_2.f03: New test case.

From-SVN: r126817
2007-07-21 23:45:44 +00:00
Christopher D. Rickett 972345f2c9 re PR fortran/32600 ([ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function)
2007-07-19  Christopher D. Rickett  <crickett@lanl.gov>

	PR fortran/32600
	* trans-expr.c (gfc_conv_function_call): Inline C_LOC.


2007-07-19  Christopher D. Rickett  <crickett@lanl.gov>

	PR fortran/32600
	* libgfortran/intrinsics/iso_c_binding.c: Remove C_LOC.
	* libgfortran/intrinsics/iso_c_binding.h: Ditto.
	* libgfortran/gfortran.map: Ditto.

From-SVN: r126744
2007-07-19 08:14:19 +02:00
Jerry DeLisle 2bb6de3a7e re PR libfortran/32611 (Print sign of negative zero)
2007-07-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR fortran/32611
	* runtime/compile_options.c (set_std): Remove.
	(set_options): New function.
	(init_compile_options): Add initialization for -fsign-zero option.
	* gfortran.map (GFORTRAN_1.0): Rename _gfortran_set_std into
	_gfortran_set_options.
	* libgfortran.h (compile_options_t): Add sign_zero field.
	* io/write.c (output_float): Use the sign bit of the value to determine
	if a negative sign should be emitted for zero values.  Do not emit the
	negative sign for zero if -fno-sign-zero was set during compile.

Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>

From-SVN: r126654
2007-07-15 16:26:22 +00:00
Jerry DeLisle d40150cc3c re PR libfortran/32752 (Segfault on WRITE with modified unix_stream structure)
2007-07-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32752
	* io/unix.c (unix_stream): Move buffer pointer adjacent to small_buffer.
	* io/transfer.c (formatted_transfer_scalar): If stream I/O, set
	bytes_used to zero. Fix off by one error in calculation of pos and
	skips. Eliminate duplicate pending_spaces check.

From-SVN: r126652
2007-07-15 05:29:29 +00:00
Francois-Xavier Coudert 3705841503 re PR fortran/32357 (MVBITS gives wrong-code on big-endian with -fdefault-integer-8)
PR fortran/32357

	* iresolve.c (gfc_resolve_mvbits): Convert FROMPOS, LEN and TOPOS
	to C int.

	* intrinsics/mvbits.c: Change prototype so that FROMPOS, LEN and
	TOPOS arguments are C int.

	* gfortran.dg/mvbits_2.f90: New test.

From-SVN: r126646
2007-07-14 23:11:04 +00:00
Jerry DeLisle 899583cb40 re PR libfortran/32702 (crash when printing big character variable)
2007-07-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32702
	* io/unix.c (unix_stream): Restore buffer pointer and small_buffer.
	(fd_alloc): If the number of bytes needed is greater than the default
	BUFFER_SIZE, allocate a new buffer large enough.  Free the old buffer if
	necessary. (fd_sfree): Restore use of buffer pointer.
	(fd_close): Likewise. (fd_open): Likewise.
	(init_error_stream): Likewise.

From-SVN: r126510
2007-07-10 05:37:29 +00:00
Thomas Koenig 18c492a994 re PR libfortran/32336 (matmul: flag runtime- instead of assertation error)
2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32336
	* m4/matmul.m4:  When the dimension of b is incorrect,
	raise a runtime error instead of a failed assertion.
	* generated/matmul_i1.c:  Regenerated.
	* generated/matmul_i2.c:  Regenerated.
	* generated/matmul_i4.c:  Regenerated.
	* generated/matmul_i8.c:  Regenerated.
	* generated/matmul_i16.c:  Regenerated.
	* generated/matmul_r4.c:  Regenerated.
	* generated/matmul_r8.c:  Regenerated.
	* generated/matmul_r10.c:  Regenerated.
	* generated/matmul_r16.c:  Regenerated.

2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32336
	* gfortran.dg/matmul_5.f90:  New test case.

From-SVN: r126498
2007-07-09 22:34:43 +00:00
Jerry DeLisle 8d917a24a7 re PR fortran/32678 ([4.2, 4.1]GFortan works incorrectly when writing with FORMAT Tx)
2007-07-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32678
	* io/transfer.c (formatted_transfer_scalar): Don't allow pending_spaces
	to go negative.

From-SVN: r126473
2007-07-09 00:15:15 +00:00
Thomas Koenig fb263f821c re PR fortran/32217 (segfaults (at runtime) on UNPACK with zero-sized arrays)
2007-07-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32217
	* intrinsics/unpack_generic.c:  If the destination array is
	empty, return early.

2007-07-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32217
	* gfortran.dg/unpack_zerosize_1.f90:  New test case.

From-SVN: r126469
2007-07-08 22:20:04 +00:00
H.J. Lu 12a27363b0 Regenerate aclocal.m4 in boehm-gc, libffi, libgfortran, libgomp,
libjava, libmudflap, libobjc, libssp and zlib.

From-SVN: r126373
2007-07-05 10:54:10 -07:00
David Edelsohn 3d22e00109 configure.ac: SUBST CFLAGS.
* configure.ac: SUBST CFLAGS.
        * configure: Regenerate.

From-SVN: r126324
2007-07-04 12:20:13 -04:00
Janne Blomqvist db430f6a2a Fortran frontend:
2007-07-03  Janne Blomqvist  <jb@gcc.gnu.org>

	* trans-decl.c (gfc_build_builtin_function_decls): Mark
	internal_realloc as a malloc function.

libgfortran:

2007-07-03  Janne Blomqvist  <jb@gcc.gnu.org>

	* libgfortran.h: Mark internal_malloc_size as a malloc function.
	* runtime/memory.c (internal_realloc_size): Remove.
	(internal_realloc): Call realloc directly instead of
	internal_realloc_size.
	(allocate_size): Remove.
	(allocate): Call malloc directly instead of allocate_size, mark as
	malloc function.

From-SVN: r126264
2007-07-03 19:50:05 +03:00
Steven G. Kargl 8eacc23d94 [multiple changes]
2007-07-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	Restore collateral damage from ISO C Binding merge.

        2007-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32456
	* io/unit.c (filename_from_unit): Don't use find_unit, instead search
	for unit directly.

From-SVN: r126238
2007-07-02 23:29:27 +00:00
Steven G. Kargl f4e9e7fa00 Makefile.in: Regenerated with automake 1.9.6.
2007-07-02  Steven G. Kargl  <kargl@gcc.gnu.org>

        * Makefile.in:  Regenerated with automake 1.9.6.

From-SVN: r126232
2007-07-02 19:46:19 +00:00
Steven G. Kargl 0afff512bb Makefile.in: Remove extraneous kill.lo rule.
2007-07-02  Steven G. Kargl  <kargl@gcc.gnu.org>

        * Makefile.in:  Remove extraneous kill.lo rule.

From-SVN: r126220
2007-07-02 18:01:09 +00:00
Janne Blomqvist f6b55636d8 Forgot to delete these during yesterdays commit.
2007-07-02  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/32239
	* generated/pow_r*_i4.c: Removed.

From-SVN: r126215
2007-07-02 19:21:37 +03:00
Christopher D. Rickett a8b3b0b633 [multiple changes]
2007-07-01  Christopher D. Rickett  <crickett@lanl.gov>

	* interface.c (gfc_compare_derived_types): Special case for comparing
	derived types across namespaces.
	(gfc_compare_types): Deal with BT_VOID.
	(compare_parameter): Use BT_VOID to accept ISO C Binding pointers.
	* trans-expr.c (gfc_conv_function_call): Remove setting parm_kind
	to SCALAR
	(gfc_conv_initializer): Deal with ISO C Binding NULL_PTR and 
	NULL_FUNPTR.
	(gfc_conv_expr): Convert expressions for ISO C Binding derived types.
	* symbol.c (gfc_set_default_type): BIND(C) variables should not be
	implicitly declared.
	(check_conflict): Add BIND(C) and check for conflicts.
	(gfc_add_explicit_interface): Whitespace.	
	(gfc_add_is_bind_c): New function.  
	(gfc_copy_attr): Use it.
	(gfc_new_symbol): Initialize ISO C Binding objects.
	(get_iso_c_binding_dt):  New function.
	(verify_bind_c_derived_type): Ditto.
	(gen_special_c_interop_ptr): Ditto.
	(add_formal_arg): Ditto.
	(gen_cptr_param): Ditto.
	(gen_fptr_param): Ditto.
	(gen_shape_param): Ditto.
	(add_proc_interface): Ditto.
	(build_formal_args): Ditto.
	(generate_isocbinding_symbol):  Ditto.
	(get_iso_c_sym):  Ditto.
	* decl.c (num_idents_on_line, has_name_equals): New variables.
	(verify_c_interop_param): New function.
	(build_sym): Finish binding labels and deal with COMMON blocks.
	(add_init_expr_to_sym): Check if the initialized expression is
	an iso_c_binding named constants
	(variable_decl): Set ISO C Binding type_spec components.
	(gfc_match_kind_spec): Check match for C interoperable kind.
	(match_char_spec): Fix comment. Chnage gfc_match_small_int
	to gfc_match_small_int_expr.  Check for C interoperable kind.
	(match_type_spec): Clear the current binding label.
	(match_attr_spec): Add DECL_IS_BIND_C.  If BIND(C) is found, use it
	to set attributes.
	(set_binding_label): New function.
	(set_com_block_bind_c): Ditto.
	(verify_c_interop): Ditto.
	(verify_com_block_vars_c_interop): Ditto.
	(verify_bind_c_sym): Ditto.
	(set_verify_bind_c_sym): Ditto.
	(set_verify_bind_c_com_block): Ditto.
	(get_bind_c_idents): Ditto.
	(gfc_match_bind_c_stmt): Ditto.
	(gfc_match_data_decl): Use num_idents_on_line.
	(match_result): Deal with right paren in BIND(C).
	(gfc_match_suffix): New function.
	(gfc_match_function_decl): Use it.  Code is re-arranged to deal with
	ISO C Binding result clauses.
	(gfc_match_subroutine):  Deal with BIND(C).
 	(gfc_match_bind_c): New function.
	(gfc_get_type_attr_spec): New function.  Code is re-arranged in and
	taken from gfc_match_derived_decl.
	(gfc_match_derived_decl): Add check for BIND(C).
	* trans-common.c: Forward declare gfc_get_common.
	(gfc_sym_mangled_common_id): Change arg from 'const char *name' to
	'gfc_common_head *com'.  Check for ISO C Binding of the common block.
	(build_common_decl): 'com->name' to 'com in SET_DECL_ASSEMBLER_NAME.
	* gfortran.h: Add GFC_MAX_BINDING_LABEL_LEN
	(bt): Add BT_VOID
	(sym_flavor): Add FL_VOID.
 	(iso_fortran_env_symbol, iso_c_binding_symbol, intmod_id): New enum
	(CInteropKind_t): New struct.
	(c_interop_kinds_table): Use it.  Declare an array of structs.
	(symbol_attribute): Add is_bind_c, is_c_interop, and is_iso_c
	bitfields.
	(gfc_typespec): Add is_c_interop; is_iso_c, and f90_type members.
	(gfc_symbol): Add from_intmod, intmod_sym_id, binding_label, and
	common_block members.
	(gfc_common_head): Add binding_label and is_bind_c members.
	(gfc_gsymbol): Add sym_name, mod_name, and binding_label members.
	Add prototypes for get_c_kind, gfc_validate_c_kind, 
	gfc_check_any_c_kind, gfc_add_is_bind_c, gfc_add_value,
	verify_c_interop, verify_c_interop_param, verify_bind_c_sym,
	verify_bind_c_derived_type, verify_com_block_vars_c_interop,
	generate_isocbinding_symbol, get_iso_c_sym, gfc_iso_c_sub_interface
	* iso-c-binding.def: New file. This file contains the definitions
	of the types provided by the Fortran 2003 ISO_C_BINDING intrinsic
	module.
	* trans-const.c (gfc_conv_constant_to_tree): Deal with C_NULL_PTR
	 or C_NULL_FUNPTR expressions.
	* expr.c (gfc_copy_expr): Add BT_VOID case.  For BT_CHARACTER, the
	ISO C Binding requires a minimum string length of 1 for '\0'.  
	* module.c (intmod_sym): New struct.
	(pointer_info): Add binding_label member.
	(write_atom): Set len to 0 for NULL pointers. Check for NULL p and *p.
	(ab_attribute): Add AB_IS_BIND_C, AB_IS_C_INTEROP and AB_IS_ISO_C.
	(attr_bits): Add "IS_BIND_C", "IS_C_INTEROP", and "IS_ISO_C".
	(mio_symbol_attribute): Deal with ISO C Binding attributes.
	(bt_types): Add "VOID".
	(mio_typespec): Deal with ISO C Binding components.
	(mio_namespace_ref): Add intmod variable. 
	(mio_symbol): Check for symbols from an intrinsic module.
	(load_commons): Check for BIND(C) common block.
	(read_module): Read binding_label and use it.
	(write_common): Add label.  Write BIND(C) info.
	(write_blank_common): Blank commons are not BIND(C).  Explicitly
	set is_bind_c=0.
	(write_symbol): Deal with binding_label.
	(sort_iso_c_rename_list): New function.
	(import_iso_c_binding_module): Ditto.
	(create_int_parameter): Add to args.
	(use_iso_fortran_env_module): Adjust to deal with iso_c_binding
	intrinsic module.
	* trans-types.c (c_interop_kinds_table): new array of structs. 
	(gfc_validate_c_kind): New function.
	(gfc_check_any_c_kind): Ditto.
	(get_real_kind_from_node): Ditto.
	(get_int_kind_from_node): Ditto.
	(get_int_kind_from_width): Ditto.
	(get_int_kind_from_minimal_width): Ditto.
	(init_c_interop_kinds): Ditto.
	(gfc_init_kinds): call init_c_interop_kinds.
	(gfc_typenode_for_spec): Adjust for BT_VOID and ISO C Binding pointers.
	Adjust handling of BT_DERIVED.
	(gfc_sym_type): Whitespace.
	(gfc_get_derived_type):  Account for iso_c_binding derived types
	* resolve.c (is_scalar_expr_ptr): New function.
	(gfc_iso_c_func_interface): Ditto.
	(resolve_function): Use gfc_iso_c_func_interface. 
	(set_name_and_label): New function.
	(gfc_iso_c_sub_interface): Ditto.
	(resolve_specific_s0): Use gfc_iso_c_sub_interface.
	(resolve_bind_c_comms): New function.
	(resolve_bind_c_derived_types): Ditto.
	(gfc_verify_binding_labels): Ditto.
	(resolve_fl_procedure): Check for ISO C interoperability.
	(resolve_symbol): Check C interoperability.
	(resolve_types): Walk the namespace.  Check COMMON blocks.
	* trans-decl.c (gfc_sym_mangled_identifier):  Prevent the mangling
	of identifiers that have an assigned binding label.
	(gfc_sym_mangled_function_id): Use the binding label rather than
	the mangled name.
	(gfc_finish_var_decl): Put variables that are BIND(C) into a common
	segment of the object file, because this is what C would do.
	(gfc_create_module_variable): Conver to proper types
	(set_tree_decl_type_code): New function.
	(generate_local_decl): Check dummy variables and derived types for
	ISO C Binding attributes.
	* match.c (gfc_match_small_int_expr): New function.
	(gfc_match_name_C): Ditto.
	(match_common_name): Deal with ISO C Binding in COMMON blocks
	* trans-io.c (transfer_expr):  Deal with C_NULL_PTR or C_NULL_FUNPTR
	expressions
	* match.h: Add prototypes for gfc_match_small_int_expr,
	gfc_match_name_C, match_common_name, set_com_block_bind_c,
	set_binding_label, set_verify_bind_c_sym,
	set_verify_bind_c_com_block, get_bind_c_idents,
	gfc_match_bind_c_stmt, gfc_match_suffix, gfc_match_bind_c,
	gfc_get_type_attr_spec
	* parse.c (decode_statement): Use gfc_match_bind_c_stmt
	(parse_derived): Init *derived_sym = NULL, and gfc_current_block
	later for valiadation.
	* primary.c (got_delim): Set ISO C Binding components of ts.
	(match_logical_constant): Ditto.
	(match_complex_constant): Ditto.
	(match_complex_constant): Ditto.
	(gfc_match_rvalue): Check for existence of at least one arg for
	C_LOC, C_FUNLOC, and C_ASSOCIATED.
	* misc.c (gfc_clear_ts): Clear ISO C Bindoing components in ts.
	(get_c_kind): New function.

2007-07-01  Christopher D. Rickett  <crickett@lanl.gov>

	* Makefile.in: Add support for iso_c_generated_procs.c and
	iso_c_binding.c.
	* Makefile.am: Ditto.
	* intrinsics/iso_c_generated_procs.c: New file containing helper
	functions.
	* intrinsics/iso_c_binding.c: Ditto.
	* intrinsics/iso_c_binding.h: New file
	* gfortran.map: Include the __iso_c_binding_c_* functions.
	* libgfortran.h: define GFC_NUM_RANK_BITS.

2007-06-23  Christopher D. Rickett  <crickett@lanl.gov>

	* bind_c_array_params.f03: New files for Fortran 2003 ISO C Binding.
	* bind_c_coms.f90: Ditto.
	* bind_c_coms_driver.c: Ditto.
	* bind_c_dts.f90: Ditto.
	* bind_c_dts_2.f03: Ditto.
	* bind_c_dts_2_driver.c: Ditto.
	* bind_c_dts_3.f03: Ditto.
	* bind_c_dts_4.f03: Ditto.
	* bind_c_dts_driver.c: Ditto.
	* bind_c_implicit_vars.f03: Ditto.
	* bind_c_procs.f03: Ditto.
	* bind_c_usage_2.f03: Ditto.
	* bind_c_usage_3.f03: Ditto.
	* bind_c_usage_5.f03: Ditto.
	* bind_c_usage_6.f03: Ditto.
	* bind_c_usage_7.f03: Ditto.
	* bind_c_vars.f90: Ditto.
	* bind_c_vars_driver.c: Ditto.
	* binding_c_table_15_1.f03: Ditto.
	* binding_label_tests.f03: Ditto.
	* binding_label_tests_10.f03: Ditto.
	* binding_label_tests_10_main.f03: Ditto.
	* binding_label_tests_11.f03: Ditto.
	* binding_label_tests_11_main.f03: Ditto.
	* binding_label_tests_12.f03: Ditto.
	* binding_label_tests_13.f03: Ditto.
	* binding_label_tests_13_main.f03: Ditto.
	* binding_label_tests_14.f03: Ditto.
	* binding_label_tests_2.f03: Ditto.
	* binding_label_tests_3.f03: Ditto.
	* binding_label_tests_4.f03: Ditto.
	* binding_label_tests_5.f03: Ditto.
	* binding_label_tests_6.f03: Ditto.
	* binding_label_tests_7.f03: Ditto.
	* binding_label_tests_8.f03: Ditto.
	* binding_label_tests_9.f03: Ditto.
	* c_assoc.f90: Ditto.
	* c_assoc_2.f03: Ditto.
	* c_f_pointer_shape_test.f90: Ditto.
	* c_f_pointer_tests.f90: Ditto.
	* c_f_tests_driver.c: Ditto.
	* c_funloc_tests.f03: Ditto.
	* c_funloc_tests_2.f03: Ditto.
	* c_funloc_tests_3.f03: Ditto.
	* c_funloc_tests_3_funcs.c: Ditto.
	* c_kind_params.f90: Ditto.
	* c_kind_tests_2.f03: Ditto.
	* c_kinds.c: Ditto.
	* c_loc_driver.c: Ditto.
	* c_loc_test.f90: Ditto.
	* c_loc_tests_2.f03: Ditto.
	* c_loc_tests_2_funcs.c: Ditto.
	* c_loc_tests_3.f03: Ditto.
	* c_loc_tests_4.f03: Ditto.
	* c_loc_tests_5.f03: Ditto.
	* c_loc_tests_6.f03: Ditto.
	* c_loc_tests_7.f03: Ditto.
	* c_loc_tests_8.f03: Ditto.
	* c_ptr_tests.f03: Ditto.
	* c_ptr_tests_10.f03: Ditto.
	* c_ptr_tests_5.f03: Ditto.
	* c_ptr_tests_7.f03: Ditto.
	* c_ptr_tests_7_driver.c: Ditto.
	* c_ptr_tests_8.f03: Ditto.
	* c_ptr_tests_8_funcs.c: Ditto.
	* c_ptr_tests_9.f03: Ditto.
	* c_ptr_tests_driver.c: Ditto.
	* c_size_t_driver.c: Ditto.
	* c_size_t_test.f03: Ditto.
	* com_block_driver.f90: Ditto.
	* global_vars_c_init.f90: Ditto.
	* global_vars_c_init_driver.c: Ditto.
	* global_vars_f90_init.f90: Ditto.
	* global_vars_f90_init_driver.c: Ditto.
	* interop_params.f03: Ditto.
	* iso_c_binding_only.f03: Ditto.
	* iso_c_binding_rename_1.f03: Ditto.
	* iso_c_binding_rename_1_driver.c: Ditto.
	* iso_c_binding_rename_2.f03: Ditto.
	* iso_c_binding_rename_2_driver.c: Ditto.
	* kind_tests_2.f03: Ditto.
	* kind_tests_3.f03: Ditto.
	* module_md5_1.f90: Ditto.
	* only_clause_main.c: Ditto.
	* print_c_kinds.f90: Ditto.
	* test_bind_c_parens.f03: Ditto.
	* test_c_assoc.c: Ditto.
	* test_com_block.f90: Ditto.
	* test_common_binding_labels.f03: Ditto.
	* test_common_binding_labels_2.f03: Ditto.
	* test_common_binding_labels_2_main.f03: Ditto.
	* test_common_binding_labels_3.f03: Ditto.
	* test_common_binding_labels_3_main.f03: Ditto.
	* test_only_clause.f90: Ditto.
	* use_iso_c_binding.f90: Ditto.
	* value_5.f90: Ditto.
	* value_test.f90: Ditto.
	* value_tests_f03.f90: Ditto.

From-SVN: r126185
2007-07-02 02:47:21 +00:00
Janne Blomqvist 31c97dfe34 re PR fortran/32239 (optimize power in loops, use __builtin_powi instead of _gfortran_pow_r4_i4)
gcc/fortran:
	
2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/32239
	* trans-expr.c (gfc_conv_power_op): Use builtin_powi for
	real**int4 powers.
	* f95-lang.c (gfc_init_builtin_functions): Add builtin_powi to the
	builtins table.

	
libgfortran:
	
2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/32239
	* Makefile.am: Don't generate real**int4 pow functions.
	* gfortran.map: Remove real**int4 pow symbols.
	* Makefile.in: Regenerated.

testsuite

2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/32239
	* gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90
	(test_4): Use proper test for floating point equality.
	(test_8): Likewise.

From-SVN: r126175
2007-07-01 19:24:38 +03:00
Jerry DeLisle c767280aa7 re PR fortran/32554 ([4.2 Only] Bug in P formatting)
2007-07-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32554
	* io/write.c (output_float): Set edigits to a fixed size, avoiding
	variation in field width calculation and eliminate buffer overrun.

From-SVN: r126173
2007-07-01 15:46:33 +00:00
Janne Blomqvist a6bd380438 fortran frontend:
2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>

	* trans.h: Remove decls for 64-bit allocation functions.
	* trans-array.c (gfc_grow_array): Always pick the standard realloc
	function decl.
	(gfc_array_allocate): Likewise.
	* trans-decl.c: Remove trees for 64-bit allocation functions.
	(gfc_build_builtin_function_decls): Don't build fndecls for 64-bit
	allocations functions, use index_int_type for normal allocation
	functions.

libgfortran changelog:

2007-07-01  Janne Blomqvist  <jb@gcc.gnu.org>

	* runtime/memory.c (internal_realloc): Use index_type for size
	argument instead of GFC_INTEGER_4.
	(allocate_array): Likewise.
	(allocate): Likewise, add ifdef around unnecessary check.
	(internal_reallo64): Remove.
	(allocate_array64): Remove.
	(allocate64): Remove.
	* gfortran.map: Remove symbols for 64-bit allocation functions.

From-SVN: r126166
2007-07-01 15:08:59 +03:00
Jerry DeLisle d1d92e95d2 re PR libfortran/32456 (IO error message should show Unit/Filename)
2007-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32456
	* io/unit.c (filename_from_unit): Don't use find_unit, instead search
	for unit directly.

From-SVN: r126119
2007-06-29 19:39:21 +00:00
Adam Nemet c861db6620 re PR libfortran/32495 (static declaration of 'strcasestr' follows non-static declaration)
PR libfortran/32495
	* runtime/backtrace.c (local_strcasestr): Rename from strcasestr.
	(show_backtrace): Rename strcasestr to local_strcasestr.

From-SVN: r125998
2007-06-25 17:21:46 +00:00
Jerry DeLisle 87557722c8 re PR libfortran/32456 (IO error message should show Unit/Filename)
2007-06-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32456
	* runtime/error.c (show_locus): Update to emit the unit number
	and file name involved with the error.  Use new function
	filename_from_unit.
	* libgfortran.h (filename_from_unit): Declare new function.
	* io/unit.c (init_units): Set the unit file name for stdin, stdout,
	and stderr for use later in error reporting.
	(filename_from_unit): Add this new function.

From-SVN: r125989
2007-06-24 22:56:21 +00:00
Jerry DeLisle 69774e69a7 re PR fortran/32446 (F0.n output format fails with large numbers)
2007-06-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32446
	* io/write.c (output_float): Calculate ndigits correctly for large
	numbered formats that must pad zeros before the decimal point.

From-SVN: r125985
2007-06-24 18:54:50 +00:00
Rainer Orth bec38225d5 re PR libfortran/32345 (Unconditional snprintf use breaks all gfortran exec tests on Tru64 UNIX V4.0F)
PR libfortran/32345
	* runtime/backtrace.c (show_backtrace): Only use snprintf if
	available.

From-SVN: r125739
2007-06-15 10:26:16 +00:00
Jerry DeLisle 82fa3fc0d3 re PR fortran/32235 (incorrectly position text file after backspace)
2007-06-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/32235
	* io/transfer.c (st_read): Remove test for end of file condition.
	(next_record_r): Add test for end of file condition.

From-SVN: r125606
2007-06-10 22:50:47 +00:00
Paolo Bonzini 82a6cadf50 configure: Regenerate.
boehm-gc:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libffi:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libgfortran:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libgomp:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libjava:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libmudflap:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libobjc:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libssp:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

libstdc++-v3:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

zlib:
2007-06-02  Paolo Bonzini  <bonzini@gnu.org>

	* configure: Regenerate.

From-SVN: r125278
2007-06-02 08:18:15 +00:00
Tobias Burnus 3078848ea3 re PR fortran/32124 (Execution stops with stat= in ALLOCATE)
2007-05-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32124
	* runtime/memory.c (allocate_size): Use ERROR_ALLOCATION.
	(allocate,allocate64): Use stat variable if present.

From-SVN: r125133
2007-05-28 18:39:35 +02:00
Janne Blomqvist 88fdfd5a86 string.c (compare0): Use gfc_charlen_type instead of int.
2007-05-27  Janne Blomqvist  <jb@gcc.gnu.org>

	* runtime/string.c (compare0): Use gfc_charlen_type instead of int.
	(fstrlen): Likewise.
	(find_option): Likewise.
	(fstrcpy): Use gfc_charlen_type instead of int, return length.
	(cf_strcpy): Likewise.
	* libgfortran.h: Change string prototypes to use gfc_charlen_type.
	* io/open.c (new_unit): Use snprintf if available.
	* io/list_read.c (nml_touch_nodes): Use memcpy instead of strcpy/strcat.
	(nml_read_obj): Likewise.
	* io/transfer.c (st_set_nml_var): Likewise.
	* io/write.c (output_float): Use snprintf if available.
	(nml_write_obj) Use memcpy instead of strcpy/strcat.

From-SVN: r125100
2007-05-27 00:15:22 +03:00
Janne Blomqvist c132497f1b unix.c (unix_stream): Rearrange struct members, remove small_buffer.
2007-05-26  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/unix.c (unix_stream): Rearrange struct members, remove
	small_buffer.
	(int_stream): New struct.
	(fd_alloc): Always use existing buffer, never reallocate.
	(fd_sfree): Remove check for buffer != small_buffer.
	(fd_close): Likewise.
	(mem_alloc_r_at): Change to use int_stream.
	(mem_alloc_w_at): Likewise.
	(mem_read): Likewise.
	(mem_write): Likewise.
	(mem_set): Likewise.
	(mem_truncate): Likewise.
	(mem_close): Likewise.
	(mem_sfree): Likewise.
	(empty_internal_buffer): Likewise.
	(open_internal): Likewise.

From-SVN: r125099
2007-05-26 23:50:21 +03:00
Jerry DeLisle 853c0ad7f0 transfer.c (unformatted_read): Use size from front end eliminating use of size_from_real_kind.
2007-05-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (unformatted_read): Use size from front end eliminating
	use of size_from_real_kind. (unformatted_write): Ditto.

From-SVN: r125064
2007-05-25 17:41:17 +00:00
Steve Ellcey 1cf3d07da6 ltmain.sh: Update from ToT Libtool.
* ltmain.sh: Update from ToT Libtool.
        * libtool.m4: Update from ToT Libtool.
        * ltsugar.m4: New. Update from ToT Libtool.
        * ltversion.m4: New. Update from ToT Libtool.
        * ltoptions.m4: New. Update from ToT Libtool.
        * ltconfig: Remove.
        * ltcf-c.sh: Remove.
        * ltcf-cxx.sh: Remove.
        * ltcf-gcj.sh: Remove.
	* Regenerate all subdirs

From-SVN: r125032
2007-05-24 16:37:27 +00:00
Tobias Burnus 6b12f000e0 libgfortran.h: Mark stop_numeric as noreturn.
2007-05-22  Tobias Burnus  <burnus@net-b.de>

       * libgfortran.h: Mark stop_numeric as noreturn.

From-SVN: r124962
2007-05-22 22:55:53 +02:00
Tobias Burnus 1f801ab788 re PR libfortran/31295 (Uninitialized variable in libgfortran's _gfortran_eoshift0_4)
2007-05-22  Tobias Burnus  <burnus@net-b.de>

       PR libgfortran/31295
       * intrinsics/eoshift0.c (eoshift0): Silence uninitialized warning.
       * intrinsics/eoshift2.c (eoshift2): Ditto.

From-SVN: r124948
2007-05-22 18:19:09 +02:00
Jerry DeLisle c152efbb10 re PR fortran/31964 ([4.2, 4.1 only]ishftc fails with certain thrid argument)
2007-05-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/31964
	* intrinsics/ishftc.c (ishftc4, ishftc8, ishftc16): Fix mask to handle
	shift of bit-size number of bits.

From-SVN: r124846
2007-05-19 01:04:03 +00:00
Tobias Burnus 2d24f24b97 re PR fortran/31917 ([4.1 only] GFORTRAN_CONVERT_UNIT is ignored)
2007-05-14  Tobias Burnus <burnus@net-b.de>

        PR fortran/31917
        * runtime/environ.c (mark_range): Fix setting default convert unit.

From-SVN: r124787
2007-05-17 10:39:32 +02:00
Jerry DeLisle d5638e6e67 re PR fortran/31922 ([4.2 only] Accessing uninitialized variable for print *, trim(blank_string))
2007-05-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/31922
	* intrinsics/string_intrinsics.c (string_trim): Set result to null if
	string length is zero.

From-SVN: r124754
2007-05-16 00:37:55 +00:00
Tobias Burnus 80bcbc8044 re PR libfortran/31915 (Failure with unf_io_convert_3.f90)
2007-05-15  Tobias Burnus  <burnus@net-b.de>

        PR libfortran/31915
        * io/transfer.c (unformatted_read): Use proper size for real(10).
          (unformatted_write): Ditto.

From-SVN: r124741
2007-05-15 12:16:46 +02:00
Francois-Xavier Coudert 1529b8d9be re PR fortran/30723 (Freeing memory doesn't need to call a library function)
PR fortran/30723

	* trans.h (gfor_fndecl_internal_malloc, gfor_fndecl_internal_malloc64,
	gfor_fndecl_internal_free): Remove prototypes.
	(gfor_fndecl_os_error, gfc_call_free, gfc_call_malloc): Add prototypes.
	* trans.c (gfc_call_malloc, gfc_call_free): New functions.
	* f95-lang.c (gfc_init_builtin_functions): Add __builtin_free
	and __builtin_malloc builtins.
	* trans-decl.c (gfor_fndecl_internal_malloc,
	gfor_fndecl_internal_malloc64, gfor_fndecl_internal_free): Remove.
	(gfor_fndecl_os_error): Add.
	(gfc_build_builtin_function_decls): Don't create internal_malloc,
	internal_malloc64 and internal_free library function declaration.
	Create os_error library call function declaration.
	* trans-array.c (gfc_trans_allocate_array_storage,
	gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
	gfc_conv_array_parameter, gfc_duplicate_allocatable): Use
	gfc_call_malloc and gfc_call_free instead of building calls to
	internal_malloc and internal_free.
	* trans-expr.c (gfc_conv_string_tmp): Likewise.
	* trans-stmt.c (gfc_do_allocate, gfc_trans_assign_need_temp,
	gfc_trans_pointer_assign_need_temp, gfc_trans_forall_1,
	gfc_trans_where_2: Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
	gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
	gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_trim): Likewise.

	* runtime/memory.c (internal_malloc, internal_malloc64,
	internal_free): Remove.
	* runtime/error.c (os_error): Export function.
	* intrinsics/move_alloc.c: Include stdlib.h.
	(move_alloc): Call free instead of internal_free.
	(move_alloc_c): Wrap long lines.
	* libgfortran.h (os_error): Export prototype.
	(internal_free): Remove prototype.
	* gfortran.map (GFORTRAN_1.0): Remove _gfortran_internal_free,
	_gfortran_internal_malloc and _gfortran_internal_malloc64.
	Add _gfortran_os_error.

From-SVN: r124721
2007-05-14 19:33:57 +00:00
Jerry DeLisle d5f9d0802c re PR libfortran/31880 ([4.2 only] silent data corruption in gfortran read statement)
2007-05-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/31880
	* io/unix.c (fd_alloc_r_at): Fix calculation of physical offset.

From-SVN: r124588
2007-05-10 01:01:27 +00:00
Francois-Xavier Coudert 25a5e75613 re PR libfortran/31607 (CALL SYSTEM produces garbled output when writing to a buffered file)
PR libfortran/31607
	* intrinsics/system.c (system_sub): Call flush_all_units.
	* io/io.h (flush_all_units): Move prototype to libgfortran.h.
	* libgfortran.h (flush_all_units): Add prototype.

From-SVN: r124510
2007-05-07 19:48:40 +00:00
Jerry DeLisle cb13c28858 re PR fortran/31201 (Too large unit number generates wrong code)
2007-05-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/31201
	* runtime/error.c (runtime_error_at): New function.
	(generate_error): Export this function.
	* gfortran.map: Add _gfortran_generate_error and
	_gfortran_runtime_error_at.
	* libgfortran.h: Add comment to reference error codes in front end.
	(library_start): Locate prototype with library_end macro and add
	a new comment.  Add prototype for runtime_error_at. Export prototype for
	generate_error.
	* io/lock.c (library_start): Fix check for error condition.
	* io/transfer.c (data_transfer_init): Add library check.

From-SVN: r124479
2007-05-06 22:28:31 +00:00
Daniel Franke 134b401077 Fix typo in PR numbers 22539 <> 22359.
From-SVN: r124441
2007-05-04 14:21:48 -04:00
Daniel Franke dcdc26dfd5 re PR target/22539 (Internal compiler error with maximum sized array)
gcc/fortran:
2007-05-04  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/22539
	* intrinsic.c (add_subroutines): Added FSEEK.
	* intrinsic.h (gfc_resolve_fseek_sub, gfc_check_fseek_sub): New.
	* iresolve.c (gfc_resolve_fseek_sub): New.
	* check.c (gfc_check_fseek_sub): New.
	* intrinsic.texi (FSEEK): Updated.

gcc/testsuite:
2007-05-01  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/22539
	* gfortran.dg/fseek.f90: New test.

libgfortran:
2007-05-04  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/22539
	* io/intrinsics.c (fseek_sub): New.
	* io/unix.c (fd_fseek): Change logical and physical offsets only
	if seek succeeds.
	* gfortran.map (fseek_sub): New.

From-SVN: r124437
2007-05-04 14:02:18 -04:00
Francois-Xavier Coudert e50443368c re PR libfortran/31210 (I/O of string with (non-constant) zero length)
PR libfortran/31210
	* io/transfer.c (transfer_character): Avoid passing a NULL
	pointer as source to the transfer routines, if the string length
	is zero.

From-SVN: r124428
2007-05-04 15:14:07 +00:00
Jerry DeLisle d10fb73e91 re PR libfortran/31501 (libgfortran internal unit I/O performance issues)
2007-04-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/31501
	* io/list_read.c (next_char): Fix whitespace.
	* io/io.h: Remove prototypes and define macros for is_array_io,
	is_stream_io, and is_internal_unit.
	* io/unit.c (is_array_io), (is_internal_unit), (is_stream_io): Delete
	these functions.
	* io/transfer.c (read_sf): Change handling of internal_unit to make a
	single call to salloc_r and use memcpy to transfer the data.

From-SVN: r124266
2007-04-28 23:23:35 +00:00
Jerry DeLisle 16d962d92c re PR libfortran/31532 (INQUIRE(...,POSITION=...) not standard conforming)
2007-04-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/31532
	* io/file_pos.c (st_backspace): Set flags.position for end of file
	condition and use new function update_position.
	(st_endfile): Use new function update_position.
	* io/io.h: Add prototype for new function.
	* io/inquire.c (inquire_via_unit): If not direct access, set NEXTREC
	to zero.
	* io/unit.c (update_position): New function to update position info
	used by inquire.
	* io/transfer.c (next_record): Fix typo and use new function.

From-SVN: r124252
2007-04-28 02:03:21 +00:00
François-Xavier Coudert 6422c11230 re PR libfortran/31299 (Use getpwuid(geteuid()) instead of getlogin() for GETLOG())
PR libfortran/31299
	* intrinsics/getlog.c: Use getpwuid and geteuid instead of
	getlogin if they are available.
	* configure.ac: Add checks for getpwuid and geteuid.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r124143
2007-04-25 07:36:20 +00:00
Janne Blomqvist 78511f8b0d configure: Regenerate using autoconf 2.59.
2007-04-25  Janne Blomqvist  <jb@gcc.gnu.org>

	* configure: Regenerate using autoconf 2.59.
	* Makefile.in: Likewise.  
	* config.h.in: Likewise.

From-SVN: r124142
2007-04-25 10:25:09 +03:00
Janne Blomqvist c0e7e2bf13 re PR libfortran/27740 (libgfortran should use versioned symbols)
2007-04-24  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/27740
	* configure.ac: New test to determine if symbol versioning is
	supported.
	* Makefile.am: Use result of above test to add appropriate linker
	flags.
	* gfortran.map: New file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* config.h.in: Regenerated.

From-SVN: r124098
2007-04-24 12:08:52 +03:00
Thomas Koenig e08e57d0c5 re PR fortran/31618 ([4.2, 4.1 only] backspace intrinsic is not working on an unformatted file)
2007-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/31618
	* io/transfer.c (read_block_direct):  Instead of calling us_read,
	set dtp->u.p.current_unit->current_record = 0 so that pre_position
	will read the record marker.
	(data_transfer_init):  For different error conditions, call
	generate_error, then return.

2007-04-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/31618
	* gfortran.dg/backspace_8.f:  New test case.

From-SVN: r124079
2007-04-23 19:43:54 +00:00
Francois-Xavier Coudert a777d6e967 main.c (please_free_exe_path_when_done): New variable.
* runtime/main.c (please_free_exe_path_when_done): New variable.
	(store_exe_path): Initialize character buffer, and mark whether
	exe_path should be free'd by the library destructor function.
	(cleanup): Only free exe_path if needed.

From-SVN: r123969
2007-04-19 11:01:15 +00:00
François-Xavier Coudert 383862e812 * ChangeLog: Forgot to include Tobias in the authors.
From-SVN: r123945
2007-04-18 08:54:40 +00:00
François-Xavier Coudert c6e75626c9 re PR libfortran/31286 (cshift uses uninitialized variables)
PR libfortran/31286
	PR libfortran/31296

	* intrinsics/cshift0.c (cshift0): Initialize sstride[0] and rstride[0].
	* intrinsics/unpack_generic.c (unpack0, unpack0_char): Zero the
	array structures we pass to unpack_internal.

From-SVN: r123944
2007-04-18 08:47:28 +00:00
Jerry DeLisle b4501dfdd2 open.c (test_endfile): Revert changes for 31052, restoring this function.
2007-04-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/open.c (test_endfile): Revert changes for 31052, restoring this
	function.

From-SVN: r123842
2007-04-15 01:53:43 +00:00
Steve Ellcey 01a6a27a02 Makefile.am: Add -I ..
* Makefile.am: Add -I .. to ACLOCAL_AMFLAGS.  Add libgfortran_la_LINK.
        * Makefile.in: Regenerate.

From-SVN: r123827
2007-04-14 19:50:46 +00:00
Kai Tietz c18b8a1c11 configure: Regenerate.
libgfortran:
2007-04-11  Kai Tietz   <kai.tietz@onevision.com>

        * configure: Regenerate.

libdecnumber:
2007-04-11  Kai Tietz   <kai.tietz@onevision.com>

        * configure: Regenerate.

config:
2007-04-11  Kai Tietz  <kai.tietz@onevision.com>

	* stdint.m4: Make template compatible with older cygwin 
	types.h, wrapping each type in a __XXX_t_defined #ifdef.

From-SVN: r123746
2007-04-12 13:06:43 +00:00
Francois-Xavier Coudert 5e9f08ba5d cpu_time.c: Don't include headers already included by libgfortran.h.
* intrinsics/cpu_time.c: Don't include headers already included
	by libgfortran.h. Protect inclusion of sys/times.h.
	* configure.ac: Remove unneeded checks for finit, stdio.h,
	stddef.h, math.h and sys/params.h.
	* config/fpu-aix.h: Don't include headers already included by
	libgfortran.h.
	* config/fpu-sysv.h: Likewise.
	* io/write.c: Likewise.
	* m4/minloc1.m4: Likewise.
	* m4/maxloc1.m4: Likewise.
	* m4/fraction.m4: Likewise.
	* m4/set_exponent.m4: Likewise.
	* m4/spacing.m4: Likewise.
	* m4/minval.m4: Likewise.
	* m4/maxval.m4: Likewise.
	* m4/exponent.m4: Likewise.
	* m4/nearest.m4: Likewise.
	* m4/minloc0.m4: Likewise.
	* m4/maxloc0.m4: Likewise.
	* m4/rrspacing.m4: Likewise.
	* runtime/main.c: Likewise.
	* runtime/error.c: Likewise.
	* intrinsics/system_clock.c: Likewise.
	* intrinsics/etime.c: Likewise.
	* intrinsics/stat.c: Likewise.
	* intrinsics/date_and_time.c: Likewise.
	* intrinsics/env.c: Likewise.
	* intrinsics/kill.c: Likewise.
	* intrinsics/getXid.c: Likewise.
	* intrinsics/chmod.c: Likewise.
	* intrinsics/args.c: Likewise.
	* intrinsics/c99_functions.c: Likewise.
	* generated/minval_r8.c: Regenerate.
	* generated/maxloc1_4_r8.c: Regenerate.
	* generated/minloc1_16_r16.c: Regenerate.
	* generated/maxval_i2.c: Regenerate.
	* generated/maxloc1_8_i4.c: Regenerate.
	* generated/exponent_r16.c: Regenerate.
	* generated/maxloc0_4_r4.c: Regenerate.
	* generated/fraction_r16.c: Regenerate.
	* generated/fraction_r4.c: Regenerate.
	* generated/minloc0_4_r16.c: Regenerate.
	* generated/minloc0_4_i1.c: Regenerate.
	* generated/maxloc0_4_r16.c: Regenerate.
	* generated/maxloc0_4_i2.c: Regenerate.
	* generated/minloc1_8_r16.c: Regenerate.
	* generated/maxloc1_8_r16.c: Regenerate.
	* generated/set_exponent_r8.c: Regenerate.
	* generated/maxloc0_8_i8.c: Regenerate.
	* generated/minloc1_4_r8.c: Regenerate.
	* generated/maxloc1_16_r16.c: Regenerate.
	* generated/minloc1_16_i4.c: Regenerate.
	* generated/maxloc1_16_i4.c: Regenerate.
	* generated/minloc0_16_i8.c: Regenerate.
	* generated/maxloc0_16_i8.c: Regenerate.
	* generated/nearest_r8.c: Regenerate.
	* generated/spacing_r16.c: Regenerate.
	* generated/maxval_r16.c: Regenerate.
	* generated/minloc1_8_i4.c: Regenerate.
	* generated/minloc0_16_i16.c: Regenerate.
	* generated/minloc0_4_r4.c: Regenerate.
	* generated/set_exponent_r10.c: Regenerate.
	* generated/rrspacing_r10.c: Regenerate.
	* generated/minloc0_4_i2.c: Regenerate.
	* generated/maxloc0_8_i1.c: Regenerate.
	* generated/minloc0_8_i8.c: Regenerate.
	* generated/spacing_r4.c: Regenerate.
	* generated/minloc1_16_r10.c: Regenerate.
	* generated/minloc0_16_i1.c: Regenerate.
	* generated/maxloc0_16_i1.c: Regenerate.
	* generated/maxloc1_8_r8.c: Regenerate.
	* generated/minval_i16.c: Regenerate.
	* generated/exponent_r10.c: Regenerate.
	* generated/maxval_i4.c: Regenerate.
	* generated/minval_i8.c: Regenerate.
	* generated/maxloc1_4_i8.c: Regenerate.
	* generated/fraction_r10.c: Regenerate.
	* generated/maxloc0_16_i16.c: Regenerate.
	* generated/maxloc0_8_r4.c: Regenerate.
	* generated/rrspacing_r8.c: Regenerate.
	* generated/minloc1_4_i16.c: Regenerate.
	* generated/minloc0_4_r10.c: Regenerate.
	* generated/maxloc1_4_i16.c: Regenerate.
	* generated/minloc0_8_i16.c: Regenerate.
	* generated/maxloc0_4_r10.c: Regenerate.
	* generated/maxloc0_8_i16.c: Regenerate.
	* generated/minloc1_8_r10.c: Regenerate.
	* generated/minloc0_16_r4.c: Regenerate.
	* generated/maxloc1_8_r10.c: Regenerate.
	* generated/maxloc0_16_r4.c: Regenerate.
	* generated/minloc1_16_r8.c: Regenerate.
	* generated/minloc0_8_i1.c: Regenerate.
	* generated/maxloc0_4_i4.c: Regenerate.
	* generated/maxloc1_16_r8.c: Regenerate.
	* generated/maxloc0_8_i2.c: Regenerate.
	* generated/nearest_r16.c: Regenerate.
	* generated/maxloc1_16_r10.c: Regenerate.
	* generated/minloc0_16_i2.c: Regenerate.
	* generated/minloc1_8_r8.c: Regenerate.
	* generated/maxloc0_16_i2.c: Regenerate.
	* generated/exponent_r4.c: Regenerate.
	* generated/spacing_r10.c: Regenerate.
	* generated/maxval_r10.c: Regenerate.
	* generated/minval_i1.c: Regenerate.
	* generated/maxloc1_4_i1.c: Regenerate.
	* generated/minloc1_4_i8.c: Regenerate.
	* generated/minloc0_8_r4.c: Regenerate.
	* generated/minloc0_16_r16.c: Regenerate.
	* generated/minloc0_4_i4.c: Regenerate.
	* generated/minloc0_8_i2.c: Regenerate.
	* generated/minval_r4.c: Regenerate.
	* generated/maxloc1_4_r4.c: Regenerate.
	* generated/maxval_r8.c: Regenerate.
	* generated/minval_r16.c: Regenerate.
	* generated/minloc1_4_i1.c: Regenerate.
	* generated/minval_i2.c: Regenerate.
	* generated/maxloc1_4_i2.c: Regenerate.
	* generated/maxloc1_8_i8.c: Regenerate.
	* generated/maxloc0_4_r8.c: Regenerate.
	* generated/maxloc0_16_r16.c: Regenerate.
	* generated/minloc1_4_r16.c: Regenerate.
	* generated/fraction_r8.c: Regenerate.
	* generated/maxloc1_4_r16.c: Regenerate.
	* generated/set_exponent_r4.c: Regenerate.
	* generated/minloc0_8_r16.c: Regenerate.
	* generated/maxloc0_8_r16.c: Regenerate.
	* generated/nearest_r10.c: Regenerate.
	* generated/maxloc0_8_i4.c: Regenerate.
	* generated/minloc1_4_r4.c: Regenerate.
	* generated/minloc0_16_i4.c: Regenerate.
	* generated/maxloc0_16_i4.c: Regenerate.
	* generated/nearest_r4.c: Regenerate.
	* generated/minloc1_16_i8.c: Regenerate.
	* generated/maxloc1_16_i8.c: Regenerate.
	* generated/minloc1_4_i2.c: Regenerate.
	* generated/maxloc1_8_i1.c: Regenerate.
	* generated/minloc0_16_r10.c: Regenerate.
	* generated/minloc1_8_i8.c: Regenerate.
	* generated/minloc0_4_r8.c: Regenerate.
	* generated/minloc0_8_i4.c: Regenerate.
	* generated/minloc1_16_i16.c: Regenerate.
	* generated/spacing_r8.c: Regenerate.
	* generated/maxloc1_8_r4.c: Regenerate.
	* generated/minloc1_16_i1.c: Regenerate.
	* generated/maxloc1_16_i1.c: Regenerate.
	* generated/minval_r10.c: Regenerate.
	* generated/minval_i4.c: Regenerate.
	* generated/minloc1_8_i1.c: Regenerate.
	* generated/maxloc1_4_i4.c: Regenerate.
	* generated/maxloc1_8_i2.c: Regenerate.
	* generated/maxval_i8.c: Regenerate.
	* generated/maxloc0_16_r10.c: Regenerate.
	* generated/rrspacing_r4.c: Regenerate.
	* generated/minloc0_4_i16.c: Regenerate.
	* generated/maxloc0_8_r8.c: Regenerate.
	* generated/maxloc0_4_i16.c: Regenerate.
	* generated/minloc1_4_r10.c: Regenerate.
	* generated/minloc1_8_i16.c: Regenerate.
	* generated/maxloc1_4_r10.c: Regenerate.
	* generated/minloc0_8_r10.c: Regenerate.
	* generated/maxloc1_8_i16.c: Regenerate.
	* generated/maxloc0_8_r10.c: Regenerate.
	* generated/minloc1_16_r4.c: Regenerate.
	* generated/maxloc1_16_r4.c: Regenerate.
	* generated/minloc0_16_r8.c: Regenerate.
	* generated/maxloc0_16_r8.c: Regenerate.
	* generated/maxloc0_4_i8.c: Regenerate.
	* generated/maxloc1_16_i16.c: Regenerate.
	* generated/minloc1_8_r4.c: Regenerate.
	* generated/minloc1_16_i2.c: Regenerate.
	* generated/maxloc1_16_i2.c: Regenerate.
	* generated/maxval_i16.c: Regenerate.
	* generated/exponent_r8.c: Regenerate.
	* generated/minloc1_4_i4.c: Regenerate.
	* generated/maxval_i1.c: Regenerate.
	* generated/minloc1_8_i2.c: Regenerate.
	* generated/minloc0_8_r8.c: Regenerate.
	* generated/set_exponent_r16.c: Regenerate.
	* generated/maxloc0_4_i1.c: Regenerate.
	* generated/rrspacing_r16.c: Regenerate.
	* generated/minloc0_4_i8.c: Regenerate.
	* generated/maxval_r4.c: Regenerate.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r123623
2007-04-06 16:47:23 +00:00
Jerry DeLisle 5a97b4f907 re PR fortran/31395 ([4.2 Only] Colon edit descriptor is ignored unless preceded by a comma or a slash)
2007-04-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31395
	* io/format.c (parse_format_list): Fix parsing.

From-SVN: r123620
2007-04-06 15:39:02 +00:00
Francois-Xavier Coudert f1412ca58a re PR fortran/31304 (REPEAT argument NCOPIES is not converted as it should)
PR fortran/31304

	* fortran/gfortran.h (gfc_charlen_int_kind): New prototype.
	* fortran/trans-types.c (gfc_charlen_int_kind): New variable.
	(gfc_init_types): Define gfc_charlen_int_kind. 
	* fortran/trans.h (gfor_fndecl_string_repeat): Remove prototype.
	* fortran/trans-decl.c (gfor_fndecl_string_repeat): Delete.
	(gfc_build_intrinsic_function_decls): Don't set
	gfor_fndecl_string_repeat.
	* fortran/trans-intrinsic.c (gfc_conv_intrinsic_repeat): Rewrite
	so that we don't have to call a library function.
	* fortran/simplify.c (gfc_simplify_repeat): Perform the necessary
	checks on the NCOPIES argument, and work with arbitrary size
	arguments.

	* intrinsics/string_intrinsics.c (string_repeat): Remove.

	* gfortran.dg/repeat_2.f90: New test.
	* gfortran.dg/repeat_3.f90: New test.
	* gfortran.dg/repeat_4.f90: New test.

From-SVN: r123481
2007-04-03 21:05:14 +00:00
Jerry DeLisle 08f9246a45 re PR libfortran/31052 ([4.2 only] Bad IOSTAT values when readings NAMELISTs past EOF)
2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31052
	* io/open.c (test_endfile): Delete this function.
	(edit_modes): Delete call to test_endfile.
	(new_unit): Likewise.
	* io/io.h: Delete prototype for test_endfile.
	* io/transfer.c (next_record_r): Remove use of test_endfile.
	(st_read):  Add test for end file condition and adjust status.

From-SVN: r123403
2007-04-01 17:32:20 +00:00
Jerry DeLisle 138469296c re PR fortran/31366 ([4.2 only] Last record truncated for read after short write, direct access file)
2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31366
	* io/transfer.c (read_block_direct): Do not generate error when reading
	past EOF on a short record that is less than the RECL= specified.
	
2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31207
	* io/unit.c (close_unit_1): If there are bytes previously written from
	ADVANCE="no", move to the end before closing.

From-SVN: r123401
2007-04-01 15:23:48 +00:00
Francois-Xavier Coudert 29e86cb09c re PR libfortran/31335 (Calls lstat(), stat() and fstat() in libgfortran should be protected by autoconf HAVE_{L,,F}STAT macros)
PR libfortran/31335
	* intrinsics/stat.c: Only provide STAT and FSTAT library routines
	if stat() and fstat() library functions are available. When lstat()
	is not available, use stat() instead.
	* configure.ac: Add checks for stat, fstat and lstat.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r123388
2007-03-31 19:41:11 +00:00
Jerry DeLisle f70ddc12ec re PR libfortran/31052 ([4.2 only] Bad IOSTAT values when readings NAMELISTs past EOF)
2007-03-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31052
	* io/transfer.c (next_record_r): Do not call test_endfile if in namelist
	mode.

From-SVN: r123284
2007-03-28 00:19:39 +00:00
Jerry DeLisle 2ff0a77e97 Fix date in entry.
From-SVN: r123206
2007-03-26 03:26:51 +00:00
Jerry DeLisle beb6a65e75 re PR fortran/31199 (write with "t1" + nonadvancing transfer format gives wrong output)
2007-03-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31199
	*io/io.h: Add saved_pos to gfc_unit structure.
	*io/open.c (new_unit): Initialize saved_pos.
	*io/transfer.c (data_transfer_init): Set max_pos to value in saved_pos.
	(next_record_w): Fix whitespace.
	(finalze_transfer): Calculate max_pos for ADVANCE="no" and save it for
	later use.  If not ADVANCE="no" set saved_pos to zero.

From-SVN: r123205
2007-03-26 03:23:15 +00:00
Thomas Koenig cc41ec4ebc re PR fortran/31196 ([4.1 only] wrong code generated with RESHAPE/TRANSPOSE)
2007-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/31196
	* intrinsics/reshape_generic.c (reshape_internal):  Increment
	correct variable.

2007-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/31196
	* gfortran.dg/reshape_transpose_1.f90:  New test.

From-SVN: r123195
2007-03-25 08:29:10 +00:00
Jerry DeLisle 9a7b6ea727 re PR libfortran/31052 ([4.2 only] Bad IOSTAT values when readings NAMELISTs past EOF)
2007-03-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31052
	* file_pos.c: Update Copyright year.
	* io/open.c (test_endfile): Restore test_endfile to fix SPEC regression.
	Update Copyright year.
	* io/io.h: Same.
	* io/unix.c (is_special): Add missing type for this function.
	Update Copyright year.
	* io/transfer.c (next_record_r): Restore test_endfile.
	(st_read): Fix whitespace.  Update Copyright year

From-SVN: r123139
2007-03-23 00:13:19 +00:00
Francois-Xavier Coudert 7f483eece3 configure.ac: Add missing check for gettimeofday.
* configure.ac: Add missing check for gettimeofday.
	* config.h.in: Renegerate.
	* configure: Regenerate.

From-SVN: r123094
2007-03-20 23:09:39 +00:00
Jerry DeLisle 7ab8aa3620 re PR libfortran/31052 ([4.2 only] Bad IOSTAT values when readings NAMELISTs past EOF)
2007-03-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31052
	* io/file_position (st_rewind): Fix comments. Remove use of
	test_endfile. Don't seek if already at 0 position.  Use new is_special
	function to set endfile state.
	* io/open.c (test_endfile): Delete this function.
	* io/io.h: Delete prototype for test_endfile.  Add prototype
	for is_special.
	* io/unix.c (is_special): New function. Fix whitespace.
	* io/transfer.c (next_record_r): Remove use of test_endfile.

From-SVN: r123038
2007-03-18 18:13:50 +00:00
David Edelsohn b24e9b3902 * runtime/main.c: Include "config.h" first.
From-SVN: r122994
2007-03-16 11:50:19 -04:00
Jerry DeLisle b746fc0e8c re PR libfortran/31099 (Runtime error on legal code using RECL)
2007-03-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31099
	* io/file_pos.c (st_rewind): Don't set bytes_left to zero.

From-SVN: r122970
2007-03-16 00:41:36 +00:00
Francois-Xavier Coudert 868d75dbdc gfortran.h (gfc_option_t): Add flag_backtrace field.
* gfortran.h (gfc_option_t): Add flag_backtrace field.
	* lang.opt: Add -fbacktrace option.
	* invoke.texi: Document the new option.
	* trans-decl.c (gfc_build_builtin_function_decls): Add new
	option to the call to set_std.
	* options.c (gfc_init_options, gfc_handle_option): Handle the
	new option.

	* runtime/backtrace.c: New file.
	* runtime/environ.c (variable_table): New GFORTRAN_ERROR_BACKTRACE
	environment variable.
	* runtime/compile_options.c (set_std): Add new argument.
	* runtime/main.c (store_exe_path, full_exe_path): New functions.
	* runtime/error.c (sys_exit): Add call to show_backtrace.
	* libgfortran.h (options_t): New backtrace field.
	(store_exe_path, full_exe_path, show_backtrace): New prototypes.
	* configure.ac: Add checks for execinfo.h, execvp, pipe, dup2,
	close, fdopen, strcasestr, getrlimit, backtrace, backtrace_symbols
	and getppid.
	* Makefile.am: Add runtime/backtrace.c.
	* fmain.c (main): Add call to store_exe_path.
	* Makefile.in: Renegerate.
	* config.h.in: Renegerate.
	* configure: Regenerate.

From-SVN: r122954
2007-03-15 12:39:47 +00:00
Jerry DeLisle 22cbc70726 re PR fortran/31051 ([4.2 Only] gfortran bug with x and t format descriptors.)
2007-03-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31051
	* io/transfer.c (formatted_transfer_scalar): Adjust position for pending
	spaces when in writing mode.  Clean up some formatting.

From-SVN: r122940
2007-03-15 01:25:27 +00:00
Thomas Koenig adea5e16e4 re PR libfortran/30690 ([4.2, 4.1 only] Clean up m4 files)
2007-03-14  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30690
	* all.m4: Quote everything, except for m4 macros.
	* any.m4: Likewise.
	* count.m4: Likewise.
	* cshift1.m4: Likewise.
	* eoshift1.m4: Likewise.
	* eoshift3.m4: Likewise.
	* exponent.m4: Likewise.
	* fraction.m4: Likewise.
	* in_pack.m4: Likewise.
	* in_unpack.m4: Likewise.
	* matmul.m4: Likewise.
	* matmull.m4: Likewise.
	* nearest.m4: Likewise.
	* pow.m4: Likewise.
	* product.m4: Likewise.
	* reshape.m4: Likewise.
	* rrspacing.m4: Likewise.
	* set_exponent.m4: Likewise.
	* shape.m4: Likewise.
	* spacing.m4: Likewise.
	* transpose.m4: Likewise.

From-SVN: r122927
2007-03-14 19:26:38 +00:00
Jakub Jelinek d70d13acb5 unix.c (regular_file): For ACTION_UNSPECIFIED retry with O_RDONLY even if errno is EROFS.
* io/unix.c (regular_file): For ACTION_UNSPECIFIED retry with
	O_RDONLY even if errno is EROFS.

From-SVN: r122914
2007-03-14 13:14:58 +01:00
Jerry DeLisle f4072316a3 re PR libfortran/31099 (Runtime error on legal code using RECL)
2007-03-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/31099
	* io/open.c (new_unit): Initialize bytes_left and recl_subrecord.
	* io/transfer.c (next_record_w): Set bytes left to record length for
	sequential unformatted I/O.
	(next_record_r): Ditto.
	(read_block_direct): Fix test for exceeding bytes_left.

From-SVN: r122763
2007-03-09 21:51:39 +00:00
Daniel Franke 02330e1953 re PR fortran/30947 (intrinsic: ALARM)
2007-03-08  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/30947
        * intrinsics/signal.c (alarm_sub_int): Avoid SEGFAULT with
        integer arguments.

From-SVN: r122716
2007-03-08 16:46:16 -05:00
Thomas Koenig 3d1f465aff re PR fortran/30981 ([4.1 only] a ** exp fails for integer exponents if exp is "-huge()-1" (endless loop))
2007-03-04  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30981
	* m4/pow_m4: Use appropriate unsigned int type for u.
	* generated/pow_c10_i16.c: Regenerated.
	* generated/pow_c10_i4.c: Regenerated.
	* generated/pow_c10_i8.c: Regenerated.
	* generated/pow_c16_i16.c: Regenerated.
	* generated/pow_c16_i4.c: Regenerated.
	* generated/pow_c16_i8.c: Regenerated.
	* generated/pow_c4_i16.c: Regenerated.
	* generated/pow_c4_i4.c: Regenerated.
	* generated/pow_c4_i8.c: Regenerated.
	* generated/pow_c8_i16.c: Regenerated.
	* generated/pow_c8_i4.c: Regenerated.
	* generated/pow_c8_i8.c: Regenerated.
	* generated/pow_i16_i16.c: Regenerated.
	* generated/pow_i16_i4.c: Regenerated.
	* generated/pow_i16_i8.c: Regenerated.
	* generated/pow_i4_i16.c: Regenerated.
	* generated/pow_i4_i4.c: Regenerated.
	* generated/pow_i4_i8.c: Regenerated.
	* generated/pow_i8_i16.c: Regenerated.
	* generated/pow_i8_i4.c: Regenerated.
	* generated/pow_i8_i8.c: Regenerated.
	* generated/pow_r10_i16.c: Regenerated.
	* generated/pow_r10_i4.c: Regenerated.
	* generated/pow_r10_i8.c: Regenerated.
	* generated/pow_r16_i16.c: Regenerated.
	* generated/pow_r16_i4.c: Regenerated.
	* generated/pow_r16_i8.c: Regenerated.
	* generated/pow_r4_i16.c: Regenerated.
	* generated/pow_r4_i4.c: Regenerated.
	* generated/pow_r4_i8.c: Regenerated.
	* generated/pow_r8_i16.c: Regenerated.
	* generated/pow_r8_i4.c: Regenerated.
	* generated/pow_r8_i8.c: Regenerated.
	
2007-03-04  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30981
	* gfortran.dg/integer_exponentiation_1.f90:  New test.

From-SVN: r122522
2007-03-04 08:03:34 +00:00
Francois-Xavier Coudert 42d53ef301 re PR libfortran/31001 ([4.1 only] PACK crashes on zero-sized arrays)
PR libfortran/31001

        * intrinsics/pack_generic.c (pack_internal): Add special checks
        for zero-sized arrays.

        * gfortran.dg/zero_sized_3.f90: New test.

From-SVN: r122507
2007-03-03 16:37:54 +00:00
Brooks Moses e6e3b4b35e Makefile.am: Add dummy install-pdf target.
* Makefile.am: Add dummy install-pdf target.
* Makefile.in: Regenerate

From-SVN: r122446
2007-03-01 15:57:32 -08:00
Jerry DeLisle 4f8d744edb re PR libfortran/30918 (Failure to skip commented out NAMELIST)
2007-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/30918
	* io/listread.c (namelist_read): Eat comment line.

From-SVN: r122307
2007-02-25 02:27:17 +00:00
Jerry DeLisle 9014618cb9 re PR fortran/30910 ([Regression 4.2, 4.3] Gfortran: ES format not quite right...)
2007-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/30910
	* io/write.c (output_float): Add condition of format F only for
	special case rounding with zero precision.

From-SVN: r122250
2007-02-23 05:43:16 +00:00
Thomas Koenig 567c915b04 re PR libfortran/30533 ([4.1 only] minval, maxval missing for kind=1 and kind=2)
2007-02-19  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30533
	PR libfortran/30765
	* Makefile.am: Add $(srcdir) too all files in generated/.
	(i_maxloc0_c): Add maxloc0_4_i1.c, maxloc0_8_i1.c,
	maxloc0_16_i1.c, maxloc0_4_i2.c, maxloc0_8_i2.c and
	maxloc0_16_i2.c.
	(i_maxloc1_c): Add maxloc1_4_i1.c, maxloc1_8_i1.c,
	maxloc1_16_i1.c, maxloc1_4_i2.c, maxloc1_8_i2.c and
	maxloc1_16_i2.c.
	(i_maxval_c): Add maxval_i1.c and maxval_i2.c.
	(i_minloc0_c):  Add minloc0_4_i1.c, minloc0_8_i1.c,
	minloc0_16_i1.c, minloc0_4_i2.c, minloc0_8_i2.c and
	minloc0_16_i2.c.
	(i_minloc_1.c): Add minloc1_4_i1.c, minloc1_8_i1.c,
	minloc1_16_i1.c, minloc1_4_i2.c, minloc1_8_i2.c and
	minloc1_16_i2.c.
	(i_minval_c):  Add minval_i1.c and minval_i2.c.
	(i_sum_c):  Add sum_i1.c and sum_i2.c.
	(i_product_c):  Add product_i1.c and product_i2.c.
	(i_matmul_c):  Add matmul_i1.c and matmul_i2.c.
	(gfor_built_specific_src):  Remove $(srcdir) from target.
	(gfor_bulit_specific2_src):  Likewise.
	Makefile.in:  Regenerated.
	libgfortran.h:  Add GFC_INTEGER_1_HUGE and GFC_INTEGER_2_HUGE.
	Add gfc_array_i1 and gfc_array_i2.
	* generated/matmul_i1.c: New file.
	* generated/matmul_i2.c: New file.
	* generated/maxloc0_16_i1.c: New file.
	* generated/maxloc0_16_i2.c: New file.
	* generated/maxloc0_4_i1.c: New file.
	* generated/maxloc0_4_i2.c: New file.
	* generated/maxloc0_8_i1.c: New file.
	* generated/maxloc0_8_i2.c: New file.
	* generated/maxloc1_16_i1.c: New file.
	* generated/maxloc1_16_i2.c: New file.
	* generated/maxloc1_4_i1.c: New file.
	* generated/maxloc1_4_i2.c: New file.
	* generated/maxloc1_8_i1.c: New file.
	* generated/maxloc1_8_i2.c: New file.
	* generated/maxval_i1.c: New file.
	* generated/maxval_i2.c: New file.
	* generated/minloc0_16_i1.c: New file.
	* generated/minloc0_16_i2.c: New file.
	* generated/minloc0_4_i1.c: New file.
	* generated/minloc0_4_i2.c: New file.
	* generated/minloc0_8_i1.c: New file.
	* generated/minloc0_8_i2.c: New file.
	* generated/minloc1_16_i1.c: New file.
	* generated/minloc1_16_i2.c: New file.
	* generated/minloc1_4_i1.c: New file.
	* generated/minloc1_4_i2.c: New file.
	* generated/minloc1_8_i1.c: New file.
	* generated/minloc1_8_i2.c: New file.
	* generated/minval_i1.c: New file.
	* generated/minval_i2.c: New file.
	* generated/product_i1.c: New file.
	* generated/product_i2.c: New file.
	* generated/sum_i1.c: New file.
	* generated/sum_i2.c: New file.

2007-02-19  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30533
	* fortran/iresolve.c(gfc_resolve_maxloc):  Remove coercion of
	argument to default integer.
	(gfc_resolve_minloc):  Likewise.

2007-02-19  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30533
	* gfortran.dg/intrinsic_intkinds_1.f90:  New test.

From-SVN: r122137
2007-02-19 20:49:10 +00:00
Francois-Xavier Coudert 6eedbf0dce * runtime/memory.c (deallocate): Correct comment.
From-SVN: r122038
2007-02-16 10:07:00 +00:00
Thomas Koenig 2ccef0dd3a Makefile.am: Use $(M4) instead of m4.
2007-02-10  Thomas Koenig  <Thomas.Koenig@online.de>

	* Makefile.am:  Use $(M4) instead of m4.
	* Makefile.in:  Regenerate.

From-SVN: r121801
2007-02-10 19:44:15 +00:00
Thomas Koenig 7e10187c3a Makefile.am: Remove $(srcdir) from assorted targets in maintainer mode.
2007-02-10  Thomas Koenig  <Thomas.Koenig@online.de>

	* Makefile.am: Remove $(srcdir) from assorted targets
	in maintainer mode.
	* Makefile.in: Regenerate.

From-SVN: r121795
2007-02-10 13:47:14 +00:00
Tobias Burnus 8811602900 re PR fortran/30512 ([4.1 only] MAXVAL() incorrect for zero-size int arrays, and for -HUGE-1 maximum values.)
fortran/
2007-02-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/30512
        * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc,
	  gfc_conv_intrinsic_minmaxval): Use HUGE-1 for most negative integer.

testsuite/
2007-02-09  Tobias Burnus  <burnus@net-b.de>

        PR fortran/30512
        * gfortran.dg/maxlocval_1.f90: New test.

libgfortran/
2007-02-09  Thomas Koenig  <Thomas.Koenig@online.de>
	    Tobias Burnus  <burnus@net-b.de>

        PR fortran/30512
        * m4/iparm.m4: Use HUGE-1 for most negative integer.
	* generated/maxloc1_8_i4.c: Regenerate.
	* generated/maxloc0_8_i8.c: Regenerate.
	* generated/maxloc1_16_i4.c: Regenerate.
	* generated/maxloc0_16_i8.c: Regenerate.
	* generated/maxval_i4.c: Regenerate.
	* generated/maxloc1_4_i8.c: Regenerate.
	* generated/maxloc0_16_i16.c: Regenerate.
	* generated/maxloc1_4_i16.c: Regenerate.
	* generated/maxloc0_8_i16.c: Regenerate.
	* generated/maxloc0_4_i4.c: Regenerate.
	* generated/maxloc1_8_i8.c: Regenerate.
	* generated/maxloc0_8_i4.c: Regenerate.
	* generated/maxloc0_16_i4.c: Regenerate.
	* generated/maxloc1_16_i8.c: Regenerate.
	* generated/maxloc1_4_i4.c: Regenerate.
	* generated/maxval_i8.c: Regenerate.
	* generated/maxloc0_4_i16.c: Regenerate.
	* generated/maxloc1_8_i16.c: Regenerate.
	* generated/maxloc0_4_i8.c: Regenerate.
	* generated/maxloc1_16_i16.c: Regenerate.
	* generated/maxval_i16.c: Regenerate.

From-SVN: r121777
2007-02-09 22:56:06 +01:00
Francois-Xavier Coudert a14fb6faeb re PR fortran/30611 ([4.1 only] Confusing error message for negative ncopies in REPEAT)
PR fortran/30611

	* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Evaluate
	arguments only once. Generate check that NCOPIES argument is not
	negative.

	* intrinsics/string_intrinsics.c (string_repeat): Don't check
	if ncopies is negative.

	* gcc/testsuite/gfortran.dg/repeat_1.f90: New test.

From-SVN: r121581
2007-02-04 21:33:10 +00:00
Francois-Xavier Coudert 3075a4cd08 re PR libfortran/30007 (libgfortran doesn't build for sh-elf)
PR libfortran/30007
	* libgfortran.h: Do not prefix symbol name with
	__USER_LABEL_PREFIX__ when used in __attribute__((__alias__(...))).

From-SVN: r121569
2007-02-04 10:30:17 +00:00
Paul Thomas d4feb3d31a re PR fortran/30284 ([4.1 only] ICE in gfc_add_modify with internal reads)
2007-02-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30284
	PR fortran/30626
	* trans-expr.c (gfc_conv_aliased_arg): Remove static attribute
	from function and make sure that substring lengths are
	translated.
	(is_aliased_array): Remove static attribute.
	* trans.c : Add prototypes for gfc_conv_aliased_arg and
	is_aliased_array.
	* trans-io.c (set_internal_unit): Add the post block to the
	arguments of the function.  Use is_aliased_array to check if
	temporary is needed; if so call gfc_conv_aliased_arg.
	(build_dt): Pass the post block to set_internal_unit and
	add to the block after all io activiy is done.

2007-02-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30284
	PR fortran/30626
	* io/transfer.c (init_loop_spec, next_array_record): Change to
	lbound rather than unity base.

2007-02-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30284
	* gfortran.dg/arrayio_11.f90.f90: New test.

	PR fortran/30626
	* gfortran.dg/arrayio_12.f90.f90: New test.

From-SVN: r121500
2007-02-02 12:35:57 +00:00
François-Xavier Coudert f64acab6ab * runtime/error.c: Include sys/time.h before sys/resource.h.
From-SVN: r121036
2007-01-21 21:04:53 +00:00
Thomas Koenig bd9431157f re PR libfortran/30525 ([4.2, 4.1 only] character comparisons with padding)
2007-01-21  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30525
	* intrinsics/string_intrinsics.c(compare_string):  Make
	sure that comparisons are done unsigned.

2007-01-21  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30525
	* gfortran.dg/char_comparison_1.f:  New test.

From-SVN: r121035
2007-01-21 20:51:53 +00:00
Tobias Burnus a63a095941 re PR libfortran/30015 ([4.1 only] Intrinsic date_and_time can go back in time)
2006-12-09  Tobias Burnus  <burnus@net-b.de>

        PR libfortran/30015
        * intrinsics/date_and_time.c (date_and_time): Fix case where time
          can go backwards.
        * configure.ac: Remove AC_TRY_RUN test for timezone in
          gettimeofday.
        * acinclude.m4: Ditto.
        * configure: Regenerate.
        * config.h.in: Regenerate.

From-SVN: r121033
2007-01-21 17:16:10 +01:00
Francois-Xavier Coudert e6472bcede gfortran.h (gfc_options_t): Add flag_allow_leading_underscore.
* gfortran.h (gfc_options_t): Add flag_allow_leading_underscore.
	* lang.opt: Add -fallow-leading-underscore.
	* match.c (gfc_match_name): Allow leading underscore in symbol
	name if -fallow-leading-underscore is used.
	* symbol.c (gfc_get_default_type): Add special case for symbol
	names beginning with an underscore.
	* trans-decl.c (gfc_get_extern_function_decl,
	gfc_build_intrinsic_function_decls): Add _gfortran prefix to
	library symbols selected_int_kind, selected_real_kind and 
	all specifics.
	* options.c (gfc_init_options, gfc_handle_option): Handle the
	new -fallow-leading-underscore option.

	* m4/misc_specifics.m4: Add _gfortran prefix to specific names.
	* m4/specific2.m4: Likewise.
	* m4/specific.m4: Likewise.
	* intrinsics/f2c_specifics.F90: Likewise.
	* intrinsics/selected_int_kind.f90: Add _gfortran prefix.
	* intrinsics/selected_real_kind.f90: Likewise.
	* intrinsics/dprod_r8.f90: Likewise.
	* Makefile.am: Add -fallow-leading-underscore to the
	gfor_specific_src files, as well as selected_real_kind.F90
	and selected_int_kind.F90
	* Makefile.in: Regenerate.
	* generated/_sqrt_c8.F90: Regenerate.
	* generated/_sign_r16.F90: Regenerate.
	* generated/_log_c16.F90: Regenerate.
	* generated/_sin_c10.F90: Regenerate.
	* generated/_tanh_r4.F90: Regenerate.
	* generated/_tanh_r8.F90: Regenerate.
	* generated/_log10_r10.F90: Regenerate.
	* generated/_aimag_c4.F90: Regenerate.
	* generated/_sign_r4.F90: Regenerate.
	* generated/_aimag_c8.F90: Regenerate.
	* generated/_sign_r8.F90: Regenerate.
	* generated/_mod_i4.F90: Regenerate.
	* generated/_cos_r16.F90: Regenerate.
	* generated/_aint_r10.F90: Regenerate.
	* generated/_mod_i8.F90: Regenerate.
	* generated/_abs_i16.F90: Regenerate.
	* generated/_sqrt_c10.F90: Regenerate.
	* generated/_atan2_r4.F90: Regenerate.
	* generated/_cos_c4.F90: Regenerate.
	* generated/_atan_r16.F90: Regenerate.
	* generated/_tanh_r10.F90: Regenerate.
	* generated/_atan2_r8.F90: Regenerate.
	* generated/_cos_c8.F90: Regenerate.
	* generated/_exp_r4.F90: Regenerate.
	* generated/_log_r10.F90: Regenerate.
	* generated/_exp_r8.F90: Regenerate.
	* generated/_abs_r4.F90: Regenerate.
	* generated/_abs_r8.F90: Regenerate.
	* generated/_sin_r16.F90: Regenerate.
	* generated/_tan_r4.F90: Regenerate.
	* generated/_tan_r8.F90: Regenerate.
	* generated/_sign_i4.F90: Regenerate.
	* generated/_sign_i8.F90: Regenerate.
	* generated/_exp_c16.F90: Regenerate.
	* generated/_sqrt_r16.F90: Regenerate.
	* generated/_conjg_c4.F90: Regenerate.
	* generated/_conjg_c8.F90: Regenerate.
	* generated/_dim_r16.F90: Regenerate.
	* generated/_mod_r10.F90: Regenerate.
	* generated/_abs_c10.F90: Regenerate.
	* generated/_conjg_c16.F90: Regenerate.
	* generated/_tan_r16.F90: Regenerate.
	* generated/_asinh_r10.F90: Regenerate.
	* generated/_abs_i4.F90: Regenerate.
	* generated/_abs_i8.F90: Regenerate.
	* generated/_acos_r10.F90: Regenerate.
	* generated/_exp_r10.F90: Regenerate.
	* generated/_acosh_r16.F90: Regenerate.
	* generated/_atan2_r16.F90: Regenerate.
	* generated/_cos_c16.F90: Regenerate.
	* generated/_mod_i16.F90: Regenerate.
	* generated/_asin_r4.F90: Regenerate.
	* generated/_anint_r16.F90: Regenerate.
	* generated/_asin_r8.F90: Regenerate.
	* generated/_aimag_c10.F90: Regenerate.
	* generated/_exp_c4.F90: Regenerate.
	* generated/_sinh_r10.F90: Regenerate.
	* generated/_exp_c8.F90: Regenerate.
	* generated/_log10_r4.F90: Regenerate.
	* generated/_log10_r8.F90: Regenerate.
	* generated/_abs_c4.F90: Regenerate.
	* generated/_abs_r16.F90: Regenerate.
	* generated/_abs_c8.F90: Regenerate.
	* generated/_asin_r10.F90: Regenerate.
	* generated/_sign_r10.F90: Regenerate.
	* generated/_atanh_r16.F90: Regenerate.
	* generated/_log_c10.F90: Regenerate.
	* generated/_cosh_r16.F90: Regenerate.
	* generated/_sin_c16.F90: Regenerate.
	* generated/_cos_r10.F90: Regenerate.
	* generated/_log10_r16.F90: Regenerate.
	* generated/_aint_r16.F90: Regenerate.
	* generated/_acos_r4.F90: Regenerate.
	* generated/_acos_r8.F90: Regenerate.
	* generated/_sqrt_c16.F90: Regenerate.
	* generated/_acosh_r4.F90: Regenerate.
	* generated/_atan_r10.F90: Regenerate.
	* generated/_acosh_r8.F90: Regenerate.
	* generated/_sign_i16.F90: Regenerate.
	* generated/_tanh_r16.F90: Regenerate.
	* generated/_log_r4.F90: Regenerate.
	* generated/_log_r8.F90: Regenerate.
	* generated/_sin_r4.F90: Regenerate.
	* generated/_sin_r8.F90: Regenerate.
	* generated/_log_r16.F90: Regenerate.
	* generated/_sin_r10.F90: Regenerate.
	* generated/_sqrt_r4.F90: Regenerate.
	* generated/_exp_c10.F90: Regenerate.
	* generated/_sqrt_r8.F90: Regenerate.
	* generated/_asinh_r4.F90: Regenerate.
	* generated/_sqrt_r10.F90: Regenerate.
	* generated/_asinh_r8.F90: Regenerate.
	* generated/_dim_r4.F90: Regenerate.
	* generated/_dim_r8.F90: Regenerate.
	* generated/_dim_r10.F90: Regenerate.
	* generated/_cosh_r4.F90: Regenerate.
	* generated/_conjg_c10.F90: Regenerate.
	* generated/_tan_r10.F90: Regenerate.
	* generated/_cosh_r8.F90: Regenerate.
	* generated/_mod_r16.F90: Regenerate.
	* generated/_abs_c16.F90: Regenerate.
	* generated/_cos_r4.F90: Regenerate.
	* generated/_asinh_r16.F90: Regenerate.
	* generated/_cos_r8.F90: Regenerate.
	* generated/_atanh_r4.F90: Regenerate.
	* generated/_atanh_r8.F90: Regenerate.
	* generated/_acos_r16.F90: Regenerate.
	* generated/_anint_r4.F90: Regenerate.
	* generated/_acosh_r10.F90: Regenerate.
	* generated/_anint_r8.F90: Regenerate.
	* generated/_exp_r16.F90: Regenerate.
	* generated/_mod_r4.F90: Regenerate.
	* generated/_cos_c10.F90: Regenerate.
	* generated/_atan2_r10.F90: Regenerate.
	* generated/_dim_i16.F90: Regenerate.
	* generated/_mod_r8.F90: Regenerate.
	* generated/_anint_r10.F90: Regenerate.
	* generated/_aint_r4.F90: Regenerate.
	* generated/_aint_r8.F90: Regenerate.
	* generated/_dim_i4.F90: Regenerate.
	* generated/_sinh_r4.F90: Regenerate.
	* generated/_log_c4.F90: Regenerate.
	* generated/_dim_i8.F90: Regenerate.
	* generated/_sinh_r8.F90: Regenerate.
	* generated/_log_c8.F90: Regenerate.
	* generated/_sin_c4.F90: Regenerate.
	* generated/_sin_c8.F90: Regenerate.
	* generated/misc_specifics.F90: Regenerate.
	* generated/_abs_r10.F90: Regenerate.
	* generated/_aimag_c16.F90: Regenerate.
	* generated/_atan_r4.F90: Regenerate.
	* generated/_sinh_r16.F90: Regenerate.
	* generated/_atan_r8.F90: Regenerate.
	* generated/_atanh_r10.F90: Regenerate.
	* generated/_cosh_r10.F90: Regenerate.
	* generated/_sqrt_c4.F90: Regenerate.
	* generated/_asin_r16.F90: Regenerate.

From-SVN: r121007
2007-01-20 18:33:20 +00:00
Francois-Xavier Coudert 15e92535d3 re PR libfortran/26893 ([4.1 only] kinds.h not generated, causing failure)
PR libfortran/26893
	* acinclude.m4 (LIBGFOR_WORKING_GFORTRAN): New check.
	* configure.ac: Add call to LIBGFOR_WORKING_GFORTRAN.
	* configure: Regenerate.
	* config.h.in: Regenerate because it was forgottent in the last
	commit.

Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r120949
2007-01-19 07:12:16 +00:00
Francois-Xavier Coudert eedeea04da 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
2007-01-18 13:54:11 +01:00
Tom Tromey 679c0f9a4c re PR libfortran/27107 (Make dependency on io/io.h broken)
PR libgfortran/27107:
	* aclocal.m4, configure, Makefile.in: Rebuilt.
	* configure.ac: Enable automake dependency tracking.  Update
	minimum automake version.

From-SVN: r120878
2007-01-17 22:14:48 +00:00
Francois-Xavier Coudert 0dce3ca161 re PR libfortran/27107 (Make dependency on io/io.h broken)
PR libfortran/27107
	* runtime/environ.c: Don't include io/io.h.
	* runtime/string.c: Don't include io/io.h.
	(compare0): Add cast to avoid warning.
	* runtime/error.c: Don't include io/io.h.
	(st_printf): Move to io/unix.c.
	* intrinsics/flush.c: Delete, contents moved to io/intrinsics.c.
	* intrinsics/fget.c: Likewise.
	* intrinsics/ftell.c: Likewise.
	* intrinsics/tty.c: Likewise.
	* libgfortran.h (DEFAULT_RECL, notification_std,
	get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert,
	DEFAULT_TEMPDIR): New declarations.
	* io/io.h (DEFAULT_RECL, notification_std, get_unformatted_convert,
	IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR):
	Move to libgfortran.h.
	* io/unix.c: Add io/unix.h content.
	(st_printf): New function.
	* io/intrinsics.c: New file.
	* io/unix.h: Remove, contents moved into unix.c.
	* libtool-version: Update library version to 3.0.0.
	* configure.ac: Update library version to 0.3.
	* Makefile.am (intrinsics/fget.c, intrinsics/flush.c,
	intrinsics/ftell.c, intrinsics/tty.c, libgfortran.h): Remove targets.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

From-SVN: r120869
2007-01-17 19:44:00 +00:00
Jerry DeLisle b8df885f63 re PR fortran/30435 (Slash at end of input not recognized according to standard)
2007-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/30435
	* io/list_read.c (finish_separator): Don't call next_record.
	(list_formatted_read_scalar): Clean up some comments and whitespace.
	(nml_read_obj): Whitespace fix.

From-SVN: r120737
2007-01-12 23:10:27 +00:00
Jerry DeLisle 779f397598 re PR libfortran/30162 (Document when sequential I/O with named pipes works)
2007-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/30162
	* io/unix.c (fd_flush): Don't seek if file is not seekable, defined as
	s->file_length == -1.
	(fd_alloc_w_at): Do not adjust file_length if file is not seekable.
	(fd_seek): If not seekable, just return success.
	(fd_truncate): If not seekable, no need to truncate.  Return failure if
	seek fails and the stream is not a pipe.
	(fd_to_stream): Make test for non-seekable file more robust.

From-SVN: r120512
2007-01-06 00:14:38 +00:00
Steven G. Kargl 80f0281f36 Rotate ChangeLog
From-SVN: r120311
2007-01-01 19:17:50 +00:00
Thomas Koenig 80ee04b982 re PR fortran/30321 (program crash for SUM applied to zero-size array)
2006-12-30  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30321
	* m4/ifunction.m4 (name`'rtype_qual`_'atype_code):
	Check for extents < 0 for zero-sized arrays.  If
	no retarray has been specified and the size is zero,
	return early.
	(`m'name`'rtype_qual`_'atype_code): Likewise.
	* generated/all_l16.c: Regenerated.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/any_l16.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/count_16_l16.c: Regenerated.
	* generated/count_16_l4.c: Regenerated.
	* generated/count_16_l8.c: Regenerated.
	* generated/count_4_l16.c: Regenerated.
	* generated/count_4_l4.c: Regenerated.
	* generated/count_4_l8.c: Regenerated.
	* generated/count_8_l16.c: Regenerated.
	* generated/count_8_l4.c: Regenerated.
	* generated/count_8_l8.c: Regenerated.
	* generated/cshift1_16.c: Regenerated.
	* generated/cshift1_4.c: Regenerated.
	* generated/cshift1_8.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

2006-12-30  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30321
	* gfortran.dg/sum_zero_array_1.f90:  New test.

From-SVN: r120287
2006-12-30 13:16:36 +00:00
Jerry DeLisle cf79465213 re PR libfortran/30014 (INQUIRE (iolength = xx) limited to kind=4)
2006-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/30014
	*io/io.h (st_parameter_dt): Change *size and *iolength type to
	GFC_IO_INT.
	*io/transfer.c (finalize_transfer): Cast dtp->u.p.size_used to
	GFC_IO_INT.  (iolength_transfer): Cast size * nelems to GFC_IO_INT.

From-SVN: r120234
2006-12-28 01:40:23 +00:00
Tobias Burnus 2ef73bb4ef associated.c: Check for associated(NULL,NULL).
2006-12-17  Tobias Burnus  <burnus@net-b.de>

    * intrinsics/associated.c: Check for associated(NULL,NULL).

2006-12-17  Tobias Burnus  <burnus@net-b.de>

    * gfortran.dg/associated_2.f90: Add test for associated(NULL,NULL).

From-SVN: r119989
2006-12-17 19:00:46 +01:00
Jerry DeLisle 87cd572dee re PR fortran/30145 (Fortran 90: write statement fails to ignore zero-sized array...)
2006-12-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/30145
	* io/transfer.c (transfer_array):  Check for negative extent.

From-SVN: r119942
2006-12-15 19:54:52 +00:00
Richard Guenther 54200abb68 re PR fortran/30115 (allocate() interface pessimizes aliasing)
2006-12-13  Richard Guenther  <rguenther@suse.de>

	PR fortran/30115
	* runtime/memory.c (allocate_size): Change interface to
	void *()(size_t, GFC_INTEGER_4 *).
	(allocate): Likewise.
	(allocate64): Likewise.
	(allocate_array): Change interface to
	void *()(void *, size_t, GFC_INTEGER_4 *).
	(allocate64_array): Likewise.
	(deallocate): Change interface to
	void ()(void *, GFC_INTEGER_4 *).

	* trans-array.c (gfc_array_allocate): Adjust for changed
	library interface.
	(gfc_array_deallocate): Likewise.
	(gfc_trans_dealloc_allocated): Likewise.
	* trans-stmt.c (gfc_trans_allocate): Likewise.
	(gfc_trans_deallocate): Likewise.
	* trans-decl.c (gfc_build_builtin_function_decls): Adjust
	function declarations to match the library changes.  Mark
	allocation functions with DECL_IS_MALLOC.

From-SVN: r119822
2006-12-13 09:57:56 +00:00
Francois-Xavier Coudert eb647f7d99 re PR libfortran/29810 (Unsatisfied symbol "fmodl" in libgfortran shared library)
PR libfortran/29810
	* intrinsics/c99_functions.c (fmodf, fmodl, floorl): New functions.
	* c99_protos.h (fmodf, fmodl, floorl): New prototypes.
	* configure.ac: Check for fmodf, fmod and fmodl.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r119599
2006-12-06 21:49:55 +00:00
Thomas Koenig b4c811bd14 re PR libfortran/30009 ([4.1 only] Unformatted reads exceeding storage units gives EOF instead of ERR)
2006-12-06  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30009
	PR libfortran/30056
	* gfortran.dg/read_eof_4.f90:  Add tests.
	* gfortran.dg/readwrite_unf_direct_eor_1.f90:  New test.
	* gfortran.dg/unf_read_corrupted_1.f90: New test.

2006-12-06  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30009
	PR libfortran/30056
	* libgfortran.h:  Add ERROR_CORRUPT_FILE to error_codes.
	* runtime/error.c (translate_error):  Add handling for
	ERROR_CORRUPT_FILE.
	* io/transfer.c (read_block_direct):  Add comment about
	EOR for stream files.
	Remove test for no bytes left for direct access files.
	Generate an ERROR_SHORT_RECORD if the read was short.
	For unformatted sequential files:  Check endfile condition.
	Remove test for no bytes left.  End of file here means
	that the file structure has been corrupted.  Pre-position
	the file for the next record in case of error.
	(write_buf):  Whitespace fix.  Subtract the number of bytes
	written from bytes_left.

From-SVN: r119592
2006-12-06 19:25:44 +00:00
Jerry DeLisle db7317c3cf re PR libfortran/30005 (Open errors (not/already exists etc.): show also the file name)
2006-12-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/30005
	* io/open.c: Add errno.h include.
	(new_unit): Add new error messages with file name for file open.

From-SVN: r119530
2006-12-05 00:51:26 +00:00
Thomas Koenig 07b3bbf200 re PR libfortran/29568 (implement unformatted files with subrecords (Intel style))
2006-12-01  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29568
	* gfortran.dg/convert_implied_open.f90:  Change to
	new default record length.
	* gfortran.dg/unf_short_record_1.f90:  Adapt to
	new error message.
	* gfortran.dg/unformatted_subrecords_1.f90:  New test.

2006-12-01  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29568
	* gfortran.h (gfc_option_t):  Add max_subrecord_length.
	(top level): Define MAX_SUBRECORD_LENGTH.
	* lang.opt:  Add option -fmax-subrecord-length=.
	* trans-decl.c:  Add new function set_max_subrecord_length.
	(gfc_generate_function_code): If we are within the main
	program and max_subrecord_length has been set, call
	set_max_subrecord_length.
	* options.c (gfc_init_options):  Add defaults for
	max_subrecord_lenght, convert and record_marker.
	(gfc_handle_option):  Add handling for
	-fmax_subrecord_length.
	* invoke.texi:  Document the new default for
	-frecord-marker=<n>.

2006-12-01  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29568
	* libgfortran/libgfortran.h (compile_options_t):  Add
	record_marker. (top level):  Define GFC_MAX_SUBRECORD_LENGTH.
	* runtime/compile_options.c (set_record_marker):  Change
	default to four-byte record marker.
	(set_max_subrecord_length):  New function.
	* runtime/error.c (translate_error):  Change error message
	for short record on unformatted read.
	* io/io.h (gfc_unit):  Add recl_subrecord, bytes_left_subrecord
	and continued.
	* io/file_pos.c (unformatted_backspace):  Change default of record
	marker size to four bytes.  Loop over subrecords.
	* io/open.c:  Default recl is max_offset.  If
	compile_options.max_subrecord_length has been set, set set
	u->recl_subrecord to its value, to the maximum value otherwise.
	* io/transfer.c (top level):  Add prototypes for us_read, us_write,
	next_record_r_unf and next_record_w_unf.
	(read_block_direct):  Separate codepaths for unformatted direct
	and unformatted sequential.  If a recl has been set by the
	user, use the number of bytes left for the record if it is smaller
	than the read request.  Loop over subrecords.  Set an error if the
	user has set a recl and the read was short.
	(write_buf):  Separate codepaths for unformatted direct and
	unformatted sequential. If a recl has been set by the
	user, use the number of bytes left for the record if it is smaller
	than the read request.  Loop over subrecords.  Set an error if the
	user has set a recl and the read was short.
	(us_read):  Add parameter continued (to indicate that bytes_left
	should not be intialized).  Change default of record marker size
	to four bytes. Use subrecord.  If the subrecord length is smaller than
	zero, this indicates a continuation.
	(us_write):  Add parameter continued (to indicate that the continued
	flag should be set).  Use subrecord.
	(pre_position):  Use 0 for continued on us_write and us_read calls.
	(skip_record):  New function.
	(next_record_r_unf):  New function.
	(next_record_r):  Use next_record_r_unf.
	(write_us_marker):  Default size for record markers is four bytes.
	(next_record_w_unf):  New function.
	(next_record_w):  Use next_record_w_unf.

From-SVN: r119412
2006-12-01 21:04:38 +00:00
Francois-Xavier Coudert 7afebb0232 Makefile.am: Remove intrinsics/erf.c and intrinsics/bessel.c.
* Makefile.am: Remove intrinsics/erf.c and intrinsics/bessel.c.
	* Makefile.in: Regenerate.
	* intrinsics/erf.c: Remove.
	* intrinsics/bessel.c: Remove.
	* c99_protos.h: Add prototypes for bessel and error functions.
	* intrinsics/c99_functions.c: Move content for intrinsics/erf.c
	and intrinsics/bessel.c here.

From-SVN: r119204
2006-11-25 17:22:53 +00:00
Jerry DeLisle b0c6db58ad io.h (unit_flags): Add new flag has_recl.
2006-11-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/io.h (unit_flags): Add new flag has_recl.
	* io.open.c (new_unit): Set flag if RECL= was specified.
	* io/transfer.c (us_write): If flag set, leave recl as initialized by
	new_unit.

From-SVN: r119087
2006-11-22 07:32:09 +00:00
Jerry DeLisle ebea7d6eb7 2006-11-17 Jerry DeLisle <jvdelisle@fcc.gnu.org
* ChangeLog: Fix typos.

From-SVN: r118954
2006-11-17 23:30:49 +00:00
François-Xavier Coudert 6c0e51c4fa trans-decl.c (gfc_get_symbol_decl): Fix formatting.
* trans-decl.c (gfc_get_symbol_decl): Fix formatting.

	* io/open.c (new_unit): Format %d expects an int variable.
	* runtime/error.c (show_locus): Format %d expects an int variable.

From-SVN: r118887
2006-11-16 11:20:57 +00:00
Steven G. Kargl 474e88dd75 2006-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
* io/read. (max_value): Hide "int n" in an #ifdef.

From-SVN: r118613
2006-11-09 03:57:44 +00:00
Jerry DeLisle 54938c1127 re PR fortran/29752 (write(*,*,advance='NO'), READ(): Data not flushed)
2006-11-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29752
	* io/transfer.c (finalize_transfer): Flush on ADVANCE_NO.

From-SVN: r118611
2006-11-09 03:03:40 +00:00
Jerry DeLisle d5fe3b0ea9 transfer.c (next_record_w): Fix indentation.
2006-11-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (next_record_w): Fix indentation.

From-SVN: r118508
2006-11-05 17:54:17 +00:00
Jerry DeLisle 97cd182da7 re PR libfortran/25545 (internal file and dollar edit descriptor)
2006-11-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/25545
	* io/transfer.c (write_block): Cleanup code paths between
	stream and non-stream I/O.
	(write_buf):  Cleanup.
	(read_block): Cleanup.
	(finalize_transfer): Call next_record for '$' edit descriptor handling
	of internal unit. Cleanup code for readability.

From-SVN: r118506
2006-11-05 17:35:30 +00:00
Francois-Xavier Coudert 47c07d96b1 re PR libfortran/27895 (problem with RESHAPE and zero-sized arrays)
PR libfortran/27895

	* intrinsics/reshape_generic.c (reshape_internal): Fix so that it
	works correctly for zero-sized arrays.
	* m4/reshape.m4: Likewise.
	* generated/reshape_r16.c: Regenerate.
	* generated/reshape_c4.c: Regenerate.
	* generated/reshape_i4.c: Regenerate.
	* generated/reshape_c16.c: Regenerate.
	* generated/reshape_r10.c: Regenerate.
	* generated/reshape_r8.c: Regenerate.
	* generated/reshape_c10.c: Regenerate.
	* generated/reshape_c8.c: Regenerate.
	* generated/reshape_i8.c: Regenerate.
	* generated/reshape_i16.c: Regenerate.
	* generated/reshape_r4.c: Regenerate.

	* gcc/testsuite/gfortran.dg/zero_sized_1.f90: Uncomment checks
	for RESHAPE.

From-SVN: r118455
2006-11-03 11:51:09 +00:00
Thomas Koenig 8a7f7fb6de re PR libfortran/29627 ([4.1 only] partial unformatted reads shouldn't succeed)
2006-10-31  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29627
	* libgfortran.h: Add ERROR_SHORT_RECORD
	* runtime/error.c (translate_error): Add case
	for ERROR_SHORT_RECORD.
	* io/transfer.c (read_block_direct):  Separate codepaths
	for stream and record unformatted I/O.  Remove unneeded
	tests for standard input, padding and formatted I/O.
	If the record is short, read in as much data as possible,
	then raise the error.

2006-10-31  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/29627
	* gfortran.dg/unf_short_record_1.f90:  New test.

From-SVN: r118341
2006-10-31 20:58:26 +00:00
Tobias Burnus 9aceacac92 re PR fortran/29452 (Keyword check for specifiers in WRITE and READ)
fortran/
2006-10-30  Tobias Burnus  <burnus@net-b.de>

       	PR fortran/29452
       	* io.c (check_io_constraints): Fix keyword string comparison.

libgfortran/
2006-10-30  Tobias Burnus  <burnus@net-b.de>

       	PR fortran/29452
	* runtime/string.c (compare0): Check whether string lengths match.

testsuite/
2006-10-30  Tobias Burnus  <burnus@net-b.de>

	PR fortran/29452
	* gfortran.dg/write_check.f90: Check run-time keyword checking.
	* gfortran.dg/write_check2.f90: Check compile-time keyword checking

From-SVN: r118191
2006-10-30 19:22:47 +01:00
Francois-Xavier Coudert 9f9ef3032b configure: Regenerate.
* configure: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.

From-SVN: r118140
2006-10-29 11:34:53 +00:00
Tobias Burnus 751748ff5a re PR fortran/29625 (Octal edit descriptors allow real variables, even with -std=f95)
2006-10-28 Tobias Burnus <burnus@net-b.de>

	PR fortran/29625
	* io/transfer.c (formatted_transfer_scalar): Allow binary edit
	  descriptors for real variables; give error for BOZ edit
	  descriptor for non-integers when using -std=f*.

From-SVN: r118111
2006-10-28 23:05:42 +02:00
Jerry DeLisle bbd6c8aa76 re PR fortran/29563 (Internal read loses data.)
2006-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29563
	* io/list_read.c (next_char): Fix an error in previous commit.

From-SVN: r118063
2006-10-26 07:17:21 +00:00
Jerry DeLisle 807fb853ee re PR fortran/29563 (Internal read loses data.)
2006-10-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29563
	* io/io.h (st_parameter_dt): Add new flag at_eof.
	* io/list_read.c (next_char): Set flag when EOF and return '\n' to
	signal EOR.  Check flag on next call and jump out.
	* io/unit.c (get_internal_unit): Initialize new flag.

From-SVN: r118059
2006-10-26 04:35:45 +00:00
Francois-Xavier Coudert 5a0aad3165 re PR fortran/26025 (Optionally use BLAS for matmul)
PR fortran/26025

	* lang.opt: Add -fexternal-blas and -fblas-matmul-limit options.
	* options.c (gfc_init_options): Initialize new flags.
	(gfc_handle_option): Handle new flags.
	* gfortran.h (gfc_option): Add flag_external_blas and
	blas_matmul_limit flags.
	* trans-expr.c (gfc_conv_function_call): Use new argument
	append_args, appending it at the end of the argument list
	built for a function call.
	* trans-stmt.c (gfc_trans_call): Use NULL_TREE for the new
	append_args argument to gfc_trans_call.
	* trans.h (gfc_conv_function_call): Update prototype.
	* trans-decl.c (gfc_build_intrinsic_function_decls): Add
	prototypes for BLAS ?gemm routines.
	* trans-intrinsic.c (gfc_conv_intrinsic_funcall): Generate the
	extra arguments given to the library matmul function, and give
	them to gfc_conv_function_call.
	* invoke.texi: Add documentation for -fexternal-blas and
	-fblas-matmul-limit.

	* m4/matmul.m4: Add possible call to gemm routine.
	* generated/matmul_r8.c: Regenerate.
	* generated/matmul_r16.c: Regenerate.
	* generated/matmul_c8.c: Regenerate.
	* generated/matmul_i8.c: Regenerate.
	* generated/matmul_c16.c: Regenerate.
	* generated/matmul_r10.c: Regenerate.
	* generated/matmul_r4.c: Regenerate.
	* generated/matmul_c10.c: Regenerate.
	* generated/matmul_c4.c: Regenerate.
	* generated/matmul_i4.c: Regenerate.
	* generated/matmul_i16.c: Regenerate.

From-SVN: r117948
2006-10-22 07:41:48 +00:00
Steven G. Kargl 4a8bce89d1 error.c: Add errno.h
2006-10-21  Steven G. Kargl  <kargl@gcc.gnu.org>

        * runtime/error.c: Add errno.h
        (generate_error): Set iostat to errno on OS error.
        * libgfortran.h: Set ERROR_OS to 5000

From-SVN: r117939
2006-10-21 22:38:56 +00:00
Francois-Xavier Coudert 5d7adf7a15 minval_r8.c: Regenerate.
* generated/minval_r8.c: Regenerate.
	* generated/maxloc1_4_r8.c: Regenerate.
	* generated/minloc1_16_r16.c: Regenerate.
	* generated/sum_i8.c: Regenerate.
	* generated/eoshift3_4.c: Regenerate.
	* generated/any_l16.c: Regenerate.
	* generated/eoshift1_8.c: Regenerate.
	* generated/reshape_r16.c: Regenerate.
	* generated/product_r4.c: Regenerate.
	* generated/maxloc1_8_i4.c: Regenerate.
	* generated/maxloc0_4_r4.c: Regenerate.
	* generated/in_unpack_i8.c: Regenerate.
	* generated/minloc0_4_r16.c: Regenerate.
	* generated/reshape_c4.c: Regenerate.
	* generated/maxloc0_4_r16.c: Regenerate.
	* generated/minloc1_8_r16.c: Regenerate.
	* generated/maxloc1_8_r16.c: Regenerate.
	* generated/in_unpack_i16.c: Regenerate.
	* generated/maxloc0_8_i8.c: Regenerate.
	* generated/sum_r16.c: Regenerate.
	* generated/minloc1_4_r8.c: Regenerate.
	* generated/maxloc1_16_r16.c: Regenerate.
	* generated/minloc1_16_i4.c: Regenerate.
	* generated/maxloc1_16_i4.c: Regenerate.
	* generated/minloc0_16_i8.c: Regenerate.
	* generated/maxloc0_16_i8.c: Regenerate.
	* generated/maxval_r16.c: Regenerate.
	* generated/count_16_l16.c: Regenerate.
	* generated/count_8_l8.c: Regenerate.
	* generated/product_c10.c: Regenerate.
	* generated/minloc1_8_i4.c: Regenerate.
	* generated/minloc0_16_i16.c: Regenerate.
	* generated/eoshift1_16.c: Regenerate.
	* generated/minloc0_4_r4.c: Regenerate.
	* generated/product_c4.c: Regenerate.
	* generated/sum_r4.c: Regenerate.
	* generated/in_pack_c16.c: Regenerate.
	* generated/reshape_i4.c: Regenerate.
	* generated/minloc0_8_i8.c: Regenerate.
	* generated/minloc1_16_r10.c: Regenerate.
	* generated/in_pack_c4.c: Regenerate.
	* generated/all_l16.c: Regenerate.
	* generated/reshape_c16.c: Regenerate.
	* generated/maxloc1_8_r8.c: Regenerate.
	* generated/minval_i16.c: Regenerate.
	* generated/reshape_r10.c: Regenerate.
	* generated/maxval_i4.c: Regenerate.
	* generated/any_l4.c: Regenerate.
	* generated/minval_i8.c: Regenerate.
	* generated/maxloc1_4_i8.c: Regenerate.
	* generated/maxloc0_16_i16.c: Regenerate.
	* generated/maxloc0_8_r4.c: Regenerate.
	* generated/minloc1_4_i16.c: Regenerate.
	* generated/minloc0_4_r10.c: Regenerate.
	* generated/maxloc1_4_i16.c: Regenerate.
	* generated/minloc0_8_i16.c: Regenerate.
	* generated/maxloc0_4_r10.c: Regenerate.
	* generated/maxloc0_8_i16.c: Regenerate.
	* generated/minloc1_8_r10.c: Regenerate.
	* generated/product_i4.c: Regenerate.
	* generated/minloc0_16_r4.c: Regenerate.
	* generated/sum_c16.c: Regenerate.
	* generated/maxloc1_8_r10.c: Regenerate.
	* generated/maxloc0_16_r4.c: Regenerate.
	* generated/minloc1_16_r8.c: Regenerate.
	* generated/maxloc0_4_i4.c: Regenerate.
	* generated/maxloc1_16_r8.c: Regenerate.
	* generated/cshift1_4.c: Regenerate.
	* generated/sum_r10.c: Regenerate.
	* generated/sum_c4.c: Regenerate.
	* generated/maxloc1_16_r10.c: Regenerate.
	* generated/count_4_l16.c: Regenerate.
	* generated/in_pack_i4.c: Regenerate.
	* generated/minloc1_8_r8.c: Regenerate.
	* generated/count_4_l4.c: Regenerate.
	* generated/maxval_r10.c: Regenerate.
	* generated/minloc1_4_i8.c: Regenerate.
	* generated/in_unpack_c4.c: Regenerate.
	* generated/minloc0_8_r4.c: Regenerate.
	* generated/product_i16.c: Regenerate.
	* generated/minloc0_16_r16.c: Regenerate.
	* generated/reshape_r8.c: Regenerate.
	* generated/all_l4.c: Regenerate.
	* generated/in_pack_c10.c: Regenerate.
	* generated/minloc0_4_i4.c: Regenerate.
	* generated/reshape_c10.c: Regenerate.
	* generated/minval_r4.c: Regenerate.
	* generated/maxloc1_4_r4.c: Regenerate.
	* generated/sum_i4.c: Regenerate.
	* generated/count_16_l8.c: Regenerate.
	* generated/maxval_r8.c: Regenerate.
	* generated/eoshift1_4.c: Regenerate.
	* generated/eoshift3_8.c: Regenerate.
	* generated/minval_r16.c: Regenerate.
	* generated/product_r8.c: Regenerate.
	* generated/maxloc1_8_i8.c: Regenerate.
	* generated/maxloc0_4_r8.c: Regenerate.
	* generated/maxloc0_16_r16.c: Regenerate.
	* generated/in_unpack_i4.c: Regenerate.
	* generated/sum_c10.c: Regenerate.
	* generated/minloc1_4_r16.c: Regenerate.
	* generated/maxloc1_4_r16.c: Regenerate.
	* generated/in_unpack_c16.c: Regenerate.
	* generated/minloc0_8_r16.c: Regenerate.
	* generated/reshape_c8.c: Regenerate.
	* generated/maxloc0_8_r16.c: Regenerate.
	* generated/maxloc0_8_i4.c: Regenerate.
	* generated/minloc1_4_r4.c: Regenerate.
	* generated/minloc0_16_i4.c: Regenerate.
	* generated/maxloc0_16_i4.c: Regenerate.
	* generated/minloc1_16_i8.c: Regenerate.
	* generated/maxloc1_16_i8.c: Regenerate.
	* generated/count_8_l4.c: Regenerate.
	* generated/minloc0_16_r10.c: Regenerate.
	* generated/minloc1_8_i8.c: Regenerate.
	* generated/minloc0_4_r8.c: Regenerate.
	* generated/product_r16.c: Regenerate.
	* generated/product_c8.c: Regenerate.
	* generated/sum_r8.c: Regenerate.
	* generated/in_pack_i16.c: Regenerate.
	* generated/minloc0_8_i4.c: Regenerate.
	* generated/minloc1_16_i16.c: Regenerate.
	* generated/reshape_i8.c: Regenerate.
	* generated/in_pack_c8.c: Regenerate.
	* generated/maxloc1_8_r4.c: Regenerate.
	* generated/reshape_i16.c: Regenerate.
	* generated/minval_r10.c: Regenerate.
	* generated/minval_i4.c: Regenerate.
	* generated/maxloc1_4_i4.c: Regenerate.
	* generated/maxval_i8.c: Regenerate.
	* generated/eoshift3_16.c: Regenerate.
	* generated/any_l8.c: Regenerate.
	* generated/maxloc0_16_r10.c: Regenerate.
	* generated/minloc0_4_i16.c: Regenerate.
	* generated/maxloc0_8_r8.c: Regenerate.
	* generated/maxloc0_4_i16.c: Regenerate.
	* generated/minloc1_4_r10.c: Regenerate.
	* generated/minloc1_8_i16.c: Regenerate.
	* generated/maxloc1_4_r10.c: Regenerate.
	* generated/minloc0_8_r10.c: Regenerate.
	* generated/maxloc1_8_i16.c: Regenerate.
	* generated/in_unpack_c10.c: Regenerate.
	* generated/maxloc0_8_r10.c: Regenerate.
	* generated/minloc1_16_r4.c: Regenerate.
	* generated/maxloc1_16_r4.c: Regenerate.
	* generated/minloc0_16_r8.c: Regenerate.
	* generated/product_i8.c: Regenerate.
	* generated/maxloc0_16_r8.c: Regenerate.
	* generated/sum_i16.c: Regenerate.
	* generated/maxloc0_4_i8.c: Regenerate.
	* generated/cshift1_8.c: Regenerate.
	* generated/maxloc1_16_i16.c: Regenerate.
	* generated/minloc1_8_r4.c: Regenerate.
	* generated/sum_c8.c: Regenerate.
	* generated/count_8_l16.c: Regenerate.
	* generated/in_pack_i8.c: Regenerate.
	* generated/maxval_i16.c: Regenerate.
	* generated/count_4_l8.c: Regenerate.
	* generated/minloc1_4_i4.c: Regenerate.
	* generated/product_c16.c: Regenerate.
	* generated/reshape_r4.c: Regenerate.
	* generated/minloc0_8_r8.c: Regenerate.
	* generated/in_unpack_c8.c: Regenerate.
	* generated/product_r10.c: Regenerate.
	* generated/cshift1_16.c: Regenerate.
	* generated/all_l8.c: Regenerate.
	* generated/minloc0_4_i8.c: Regenerate.
	* generated/maxval_r4.c: Regenerate.
	* generated/count_16_l4.c: Regenerate.

From-SVN: r117904
2006-10-20 11:52:56 +00:00
François-Xavier Coudert 3d894fc3f0 re PR libfortran/27895 (problem with RESHAPE and zero-sized arrays)
PR libfortran/27895

	* intrinsics/cshift0.c: Special cases for zero-sized arrays.
	* intrinsics/pack_generic.c: Likewise.
	* intrinsics/spread_generic.c: Likewise.

	* gfortran.dg/zero_sized_1.f90: New test.

From-SVN: r117890
2006-10-19 21:48:50 +00:00
Jerry DeLisle 9e7fc6b946 re PR fortran/29277 (Formated stream output: Translate "\n" / achar(10) into "\r\n" on some platforms)
2006-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29277
	* io/write.c (write_a): Add conversion of LF to CR-LF for systems with
	#define HAVE_CRLF.

From-SVN: r117866
2006-10-18 23:13:33 +00:00
Tobias Burnus 8b6dba81f0 in_pack.m4: Fixed a typo.
2006-10-16  Tobias Burnus  <burnus@net-b.de>

        * m4/in_pack.m4: Fixed a typo.
        * m4/iforeach.m4: Fixed a typo.
        * m4/eoshift1.m4: Fixed a typo.
        * m4/eoshift3.m4: Fixed a typo.
        * m4/cshift1.m4: Fixed a typo.
        * m4/in_unpack.m4: Fixed a typo.
        * m4/reshape.m4: Fixed a typo.
        * m4/ifunction.m4: Fixed a typo.
        * runtime/environ.c: Fixed a typo.
        * runtime/in_pack_generic.c: Fixed a typo.
        * runtime/in_unpack_generic.c: Fixed a typo.
        * runtime/memory.c: Fixed a typo.
        * intrinsics/cshift0.c: Fixed a typo.
        * intrinsics/cpu_time.c: Fixed a typo.
        * intrinsics/pack_generic.c: Fixed a typo.
        * intrinsics/unpack_generic.c: Fixed a typo.
        * intrinsics/eoshift0.c: Fixed a typo.
        * intrinsics/eoshift2.c: Fixed a typo.
        * intrinsics/reshape_generic.c: Fixed a typo.
        * io/open.c: Fixed a typo.
        * io/list_read.c: Fixed a typo.
        * io/io.h: Fixed a typo.
        * io/transfer.c: Fixed a typo.
        * io/write.c: Fixed a typo.

From-SVN: r117857
2006-10-18 19:17:49 +02:00
Jerry DeLisle 09861cbee6 re PR fortran/29277 (Formated stream output: Translate "\n" / achar(10) into "\r\n" on some platforms)
2006-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29277
	* io/list_read.c (next_char): Update strm_pos.
	(eat_separator): Delete extra call to unget_char.
	* io/transfer.c (read_block): Use read_sf for formatted stream I/O.
	(next_record_r): Update strm_pos for formatted stream I/O and handle
	end-of-record correctly.
	(next_record_w): Ditto.
	(next_record): Enable next record (r/w) functions and update strm_pos.
	(finalize_transfer): Call next_record to finish the record.

From-SVN: r117846
2006-10-18 04:04:07 +00:00
Steven G. Kargl 4010308ce5 spacing.m4: Use scalbn[f,l] if ldexp[f,l] is unavailable.
2006-10-13  Steven G. Kargl  <kargl@gcc.gnu.org>

        * m4/spacing.m4: Use scalbn[f,l] if ldexp[f,l] is unavailable.
        * m4/rrspacing.m4: Ditto.
        * generated/spacing_r4.c: Regenerated.
        * generated/spacing_r8.c: Ditto.
        * generated/spacing_r10.c: Ditto.
        * generated/spacing_r16.c: Ditto.
        * generated/rrspacing_r4.c: Ditto.
        * generated/rrspacing_r8.c: Ditto.
        * generated/rrspacing_r10.c: Ditto.
        * generated/rrspacing_r16.c: Ditto.

From-SVN: r117703
2006-10-13 19:08:37 +00:00
Steven G. Kargl cc6d3bde5a re PR fortran/15441 (RRSPACING broken for denormals)
2006-10-06  Steven G. Kargl  <kargl@gcc.gnu.org>
 
	* gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info.
	* arith.c (arctangent, gfc_check_real_range): Use it.	
	* simplify.c (gfc_simplify_atan2, gfc_simplify_exponent,
	gfc_simplify_log, gfc_simplify_nearest): Use it.

	PR fortran/15441
	PR fortran/29312
	* iresolve.c (gfc_resolve_rrspacing): Give rrspacing library
	routine hidden precision argument.
	(gfc_resolve_spacing): Give spacing library routine hidden
	precision, emin - 1, and tiny(x) arguments.
	* simplify.c (gfc_simplify_nearest): Remove explicit subnormalization.
	(gfc_simplify_rrspacing): Implement formula from Fortran 95 standard.
	(gfc_simplify_spacing): Implement formula from Fortran 2003 standard.
	* trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and
	spacing via LIBF_FUNCTION
	(prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing,
	gfc_conv_intrinsic_rrspacing): Remove functions.
	(gfc_conv_intrinsic_function): Remove calls to
	gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing.
	* f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz,
	__builtin_clzl and __builtin_clzll


2006-10-06  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/15441
	PR fortran/29312
	* configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL
	* m4/spacing.m4: New file.  Use new HAVE_* defines.
	* m4/rrspacing.m4: Ditto.
	* Makefile.am: Handle new files.
	* configure: Regenerated.
	* Makefile.in: Ditto.
	* config.h.in: Ditto.
	* generated/spacing_r4.c: Generated.
	* generated/spacing_r8.c: Ditto.
	* generated/spacing_r10.c: Ditto.
	* generated/spacing_r16.c: Ditto.
	* generated/rrspacing_r4.c: Ditto.
	* generated/rrspacing_r8.c: Ditto.
	* generated/rrspacing_r10.c: Ditto.
	* generated/rrspacing_r16.c: Ditto.

From-SVN: r117584
2006-10-09 20:55:29 +00:00
François-Xavier Coudert ca0551f028 Makefile.am: Add intrinsics/move_alloc.c, ommited in Paul's previous commit.
* Makefile.am: Add intrinsics/move_alloc.c, ommited in Paul's
	previous commit.
	* Makefile.in: Regenerate.

From-SVN: r117561
2006-10-08 19:07:29 +00:00
Francois-Xavier Coudert 456d9b174d hyper.c: Remove file.
* intrinsics/hyper.c: Remove file.
	* intrinsics/c99_functions.c: Add fallback functions asinhf,
	acoshf and atanhf.
	* Makefile.am: Remove file intrinsics/hyper.c.
	* Makefile.in: Regenerate.

From-SVN: r117560
2006-10-08 18:39:18 +00:00
Francois-Xavier Coudert 22ae47e29c c99_protos.h: Correctly protect definitions of prototypes for asinhf...
* c99_protos.h: Correctly protect definitions of prototypes for
	asinhf, acoshf and atanhf to be the same as in intrinsics/hyper.c.

From-SVN: r117559
2006-10-08 17:16:38 +00:00
Paul Thomas 5046aff56b [multiple changes]
2006-10-05  Erik Edelmann <edelmann@gcc.gnu.org>
	    Paul Thomas <pault@gcc.gnu.org>

	PR fortran/20541
	* interface.c (gfc_compare_derived_types): Add comparison of
	the allocatable field.
	* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
	* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
	gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
	gfc_trans_scalar_assign): Add extra arguments l_is_temp
	and r_is_var to references to latter function.
	(gfc_conv_function_call): Add enum for types of argument and
	an associated variable parm_kind. Deallocate components of
	INTENT(OUT) and non-variable arrays.
	(gfc_trans_subcomponent_assign): Add block to assign arrays
	to allocatable components.
	(gfc_trans_scalar_assign): Add block to handle assignments of
	derived types with allocatable components, using the above new
	arguments to control allocation/deallocation of memory and the
	copying of allocated arrays.
	* trans-array.c (gfc_array_allocate): Remove old identification 
	of pointer and replace with that of an allocatable array. Add
	nullify of structures with allocatable components. 
	(gfc_conv_array_initializer): Treat EXPR_NULL.
	(gfc_conv_array_parameter): Deallocate allocatable components
	of non-variable structures.
	(gfc_trans_dealloc_allocated): Use second argument of library
	deallocate to inhibit, without error, freeing NULL pointers.
	(get_full_array_size): New function to return the size of a
	full array.
	(gfc_duplicate_allocatable): New function to allocate and copy
	allocated data.
	(structure_alloc_comps): New recursive function to deallocate,
	nullify or copy allocatable components.
	(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
	gfc_copy_alloc_comp): New interface functions to call previous.
	(gfc_trans_deferred_array): Add the code to nullify allocatable
	components, when entering scope, and to deallocate them on
	leaving. Do not call gfc_trans_static_array_pointer and return
	for structures with allocatable components and default
	initializers.
	* symbol.c (gfc_set_component_attr): Set allocatable field.
	(gfc_get_component_attr): Set the allocatable attribute.
	* intrinsic.h : Prototype for gfc_check_move_alloc.
	* decl.c (build_struct): Apply TR15581 constraints for
	allocatable components.
	(variable_decl): Default initializer is always NULL for
	allocatable components.
	(match_attr_spec): Allow, or not, allocatable components,
	according to the standard in force.
	* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
	gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
	gfc_duplicate_allocatable.
	* gfortran.texi : Add mention of TR15581 extensions.
	* gfortran.h : Add attribute alloc_comp, add
	gfc_components field allocatable and add the prototype
	for gfc_expr_to_initialize.
	* trans-stmt.c (generate_loop_for_temp_to_lhs,
	generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
	gfc_trans_where_3): Add extra arguments to calls to
	gfc_trans_scalar_assign and set appropriately.
	(gfc_trans_allocate): Nullify allocatable components.
	(gfc_trans_deallocate): Deallocate to ultimate allocatable
	components but stop at ultimate pointer components.
	* module.c (mio_symbol_attribute, mio_symbol_attribute,
	mio_component): Add module support for allocatable
	components.
	* trans-types.c (gfc_get_derived_type): Treat allocatable
	components.
	* trans.h : Add two boolean arguments to
	gfc_trans_scalar_assign.
	* resolve.c (resolve_structure_cons): Check conformance of
	constructor element and the component.
	(resolve_allocate_expr): Add expression to nullify the
	constructor expression for allocatable components.
	(resolve_transfer): Inhibit I/O of derived types with
	allocatable components.
	(resolve_fl_derived): Skip check of bounds of allocatable
	components.
	* trans-decl.c (gfc_get_symbol_decl): Add derived types
	with allocatable components to deferred variable.
	(gfc_trans_deferred_vars): Make calls for derived types
	with allocatable components to gfc_trans_deferred_array.
	(gfc_generate_function_code): Nullify allocatable
	component function result on entry.
	* parse.c (parse_derived): Set symbol attr.allocatable if
	allocatable components are present.
	* check.c (gfc_check_allocated): Enforce attr.allocatable
	for intrinsic arguments.
	(gfc_check_move_alloc): Check arguments of move_alloc.
	* primary.c (gfc_variable_attr): Set allocatable attribute.
	* intrinsic.texi : Add index entry and section for
	for move_alloc.

	PR fortran/29115
	* resolve.c (resolve_structure_cons): It is an error if the
	pointer component elements of a derived type constructor are
	not pointer or target.


	PR fortran/29211
	* trans-stmt.c (generate_loop_for_temp_to_lhs,
	generate_loop_for_rhs_to_temp): Provide a string length for
	the temporary by copying that of the other side of the scalar
	assignment.


2006-10-05  Paul Thomas  <pault@gcc.gnu.org>
	    Erik Edelmann  <edelmann@gcc.gnu.org>

	PR libgfortran/20541
	* Makefile.in : Add move_alloc.
	* intrinsics/move_alloc.c: New function.
	* Makefile.am : Add move_alloc.



2006-10-05  Erik Edelmann  <edelmann@gcc.gnu.org>
	    Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/20541
	* gfortran.dg/alloc_comp_basics_1.f90: New test.
	* gfortran.dg/alloc_comp_basics_2.f90: New test.
	* gfortran.dg/alloc_comp_assign_1.f90: New test.
	* gfortran.dg/alloc_comp_assign_2.f90: New test.
	* gfortran.dg/alloc_comp_assign_3.f90: New test.
	* gfortran.dg/alloc_comp_assign_4.f90: New test.
	* gfortran.dg/alloc_comp_constraint_1.f90: New test.
	* gfortran.dg/alloc_comp_constraint_2.f90: New test.
	* gfortran.dg/alloc_comp_constraint_3.f90: New test.
	* gfortran.dg/alloc_comp_constructor_1.f90: New test.
	* gfortran.dg/alloc_comp_constructor_2.f90: New test.
	* gfortran.dg/alloc_comp_initializer_1.f90: New test.
	* gfortran.dg/alloc_comp_std.f90: New test.
	* gfortran.dg/move_alloc.f90: New test.

	PR fortran/29115
	* gfortran.dg/derived_constructor_comps_2.f90: New test.

	PR fortran/29211
	* gfortran.dg/forall_char_dependencies_1.f90: New test.

From-SVN: r117558
2006-10-08 16:21:55 +00:00
Francois-Xavier Coudert 28f8c9e97b re PR libfortran/26540 ([4.1 only] intrinsics/signal.c warnings)
PR libfortran/26540
	* intrinsics/signal.c (signal_sub, signal_sub_int): Use intptr_t
	if available to cast function pointers to int and back.
	* configure.ac: Check for intptr_t.
	* config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r117556
2006-10-08 14:27:22 +00:00
François-Xavier Coudert 0e7e7e6e82 re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
	PR fortran/29288

	* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
	gfc_intrinsic_sym structure is filled.
	(gfc_intrinsic_actual_ok): New function.
	(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
	add_sym_5s): Intrinsic subroutines are not allowed as actual
	arguments, so we remove argument actual_ok.
	(add_functions): Correct the values for actual_ok of all intrinsics.
	(add_subroutines): Remove the actual_ok argument, which was never used.
	* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
	* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
	* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
	an intrinsic used as an argument list is allowed there.
	* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
	(gfc_resolve_len): Change intrinsic function name to agree with
	libgfortran.
	* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
	new case, because some specific intrinsics take 3 arguments.
	* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.

	* libgfortran/Makefile.am: Add the new files to the build
	process, and rules to build them.
	* libgfortran/Makefile.in: Regenerate.
	* libgfortran/m4/misc_specifics.m4: New file.
	* libgfortran/m4/specific.m4: Add new special cases for function
	with complex argument and real result, like abs_c* and aimag_c*.
	* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
	AIMAG, ASINH, ACOSH and ATANH.
	* libgfortran/generated/_aimag_c4.F90: New file.
	* libgfortran/generated/_aimag_c8.F90: New file.
	* libgfortran/generated/_asinh_r10.F90: New file.
	* libgfortran/generated/_acosh_r16.F90: New file.
	* libgfortran/generated/_aimag_c10.F90: New file.
	* libgfortran/generated/_atanh_r16.F90: New file.
	* libgfortran/generated/_acosh_r4.F90: New file.
	* libgfortran/generated/_acosh_r8.F90: New file.
	* libgfortran/generated/_asinh_r4.F90: New file.
	* libgfortran/generated/_asinh_r8.F90: New file.
	* libgfortran/generated/_asinh_r16.F90: New file.
	* libgfortran/generated/_atanh_r4.F90: New file.
	* libgfortran/generated/_atanh_r8.F90: New file.
	* libgfortran/generated/_acosh_r10.F90: New file.
	* libgfortran/generated/misc_specifics.F90: New file.
	* libgfortran/generated/_aimag_c16.F90: New file.
	* libgfortran/generated/_atanh_r10.F90: New file.

	* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
	Add tests for using all possible intrinsics as actual arguments.
	* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
	all possible intrinsics as actual arguments.
	* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
	* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.

From-SVN: r117534
2006-10-07 13:34:16 +00:00
Danny Smith 76be85be9c acinclude.m4 (HAVE_ATTRIBUTE_ALIAS): Remove __USER_LABEL_PREFIX__ from test.
* acinclude.m4 (HAVE_ATTRIBUTE_ALIAS): Remove __USER_LABEL_PREFIX__ from test.
	* configure: Regenerate.

From-SVN: r117489
2006-10-06 08:21:49 +00:00
Danny Smith 16a314a996 acinclude.m4 (HAVE_ATTRIBUTE_ALIAS): Remove __USER_LABEL_PREFIX__ from test.
* acinclude.m4 (HAVE_ATTRIBUTE_ALIAS): Remove __USER_LABEL_PREFIX__ from test.
	* configure: Regenerate.

From-SVN: r117488
2006-10-06 08:21:22 +00:00
Steven G. Kargl 2c3c88ec20 Makefile.am: Use $(M4) instead of m4.
2006-10-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	* Makefile.am: Use $(M4) instead of m4.
	* Makefile.in: Regenerated.

From-SVN: r117467
2006-10-05 21:21:53 +00:00