Commit Graph

857 Commits

Author SHA1 Message Date
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