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-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-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
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-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-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
* 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
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
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
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-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 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
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-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-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-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-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-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-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-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
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
PR libfortran/30007
* libgfortran.h: Do not prefix symbol name with
__USER_LABEL_PREFIX__ when used in __attribute__((__alias__(...))).
From-SVN: r121569
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-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
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
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-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
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-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-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-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-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
* 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-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-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-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
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-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-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-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-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
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
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