2006-04-12 Jerry DeLisle PR libgfortran/26766 * io/io.h: Add bit to identify associated unit as internal. * io/unit.c (get_external_unit): Renamed the find_unit_1 function to reflect the external unit functionality vs internal unit. (get_internal_unit): New function to allocate and initialize an internal unit structure. (get_unit): Use get_internal_unit and get_external_unit. (is_internal_unit): Revised to use new bit added in io.h. * io/transfer.c (data_transfer_init): Fix line width. (st_read_done): Free memory allocated for internal unit. (st_write_done): Add test to only flush and truncate when not an internal unit. Free memory allocated for internal unit. 2006-04-11 Jakub Jelinek * io/io.h (st_parameter_dt): Revert 2005-12-10 change to u.pad, fix comment. (check_st_parameter_dt): New compile time assert. 2006-04-10 Jakub Jelinek PR libgfortran/24685 * io/write.c (MIN_FIELD_WIDTH, STR, STR1): Define. (output_float): Increase buffer sizes for IEEE quad and IBM extended long double. (write_real): Output REAL(16) as 1PG43.34E4 rather than 1PG40.31E4. 2006-04-07 Jerry DeLisle PR libgfortran/26890 * io/io.h: Revert change to pad size made on 2006-03-30. Add comment explaining dependency with fortran/trans-io.c. 2006-04-03 Jerry DeLisle * io/write.c (output_float): Update condition to not error when decimal precision in format specifier is zero. 2006-04-01 Francois-Xavier Coudert * config/fpu-387.h: Use previously added SSE code in all cases, as it really is the right thing to do. 2006-03-30 Jerry DeLisle PR libgfortran/26890 * io/io.h: Add size_used to st_parameter_dt, adjust pad size. *io/transfer.c (data_transfer_init): Initialize size_used to zero. (read_sf): Use size_used. (read_block): Likewise. (read_block_direct): Likewise. (write_block): Likewise. (write_buf): Likewise and eliminate erroneous FAILURE return. (finalize_transfer): Assign value of size_used to *dtp->size. 2006-03-30 Francois-Xavier Coudert PR libfortran/26712 * config/fpu-387.h: Add special case for handling of SSE control bit on i386-darwin. 2006-03-30 Thomas Koenig PR fortran/25031 * runtime/memory.c (allocate_array): If stat is present and the variable is already allocated, free the variable, do the allocation and set stat. (allocate_array_64): Likewise. Whitespace fix. 2006-03-26 Jerry DeLisle PR libgfortran/26880 * io/file_pos.c (st_rewind): Clear read_bad flag. 2006-03-25 Jerry DeLisle PR libgfortran/26661 * io/io.h: Add read_sf so it can be used by read_x. * io/transfer.c (read_sf): Pass no_error flag to read_sf. Use it to break out rather than error on EOF or EOR conditions. (read_block): Update call to read_sf. (read_block_direct): Ditto. * io/read.c (read_x): Use the modified read_sf instead of read_block. 2006-03-25 Thomas Koenig PR libfortran/26735 * io/transfer.c (data_transfer_init): Set u_flags.convert on an unopened unit if specified by environment variable (via get_unformatted_convert) or by compile-time option. 2006-03-25 Thomas Koenig PR fortran/26769 * Makefile.am: Add transpose_r10.c and reshape_r10.c. * aclocal.m4: Regenerate using aclocal 1.9.3. * Makefile.in: Regenerate using automake 1.9.3. * m4/iparm.m4 (rtype_ccode): If rtype_letter is `i', evaluate to rtype_kind, otherwise to rtype_code. * generated/transpose_r10.c: Add. * generated/reshape_r10.c: Add. 2006-03-22 Thomas Koenig PR fortran/19303 * libgfortran.h (compile_options_t): Add record_marker. * runtime/compile_options.c (set_record_marker): New function. * io/open.c: If we have four-byte record markers, use GFC_INTEGER_4_HUGE as default record length. * io/file_pos.c (unformatted_backspace): Handle different size record markers. * io/transfer.c (us_read): Likewise. (us_write): Likewise. (next_record_r): Likewise. (write_us_marker): Likewise. (next_record_w): Likewise. 2006-03-20 Thomas Koenig PR fortran/20935 * m4/iforeach.m4: Add SCALAR_FOREACH_FUNCTION macro. * m4/ifunction.m4: Add SCALAR_ARRAY_FUNCTION macro. * m4/minloc0.m4: Use SCALAR_FOREACH_FUNCTION. * m4/minloc1.m4: Use SCALAR_ARRAY_FUNCTION. * m4/maxloc0.m4: Use SCALAR_FOREACH_FUNCTION. * m4/maxloc1.m4: Use SCALAR_ARRAY_FUNCTION. * m4/minval.m4: Likewise. * m4/maxval.m4: Likewise. * m4/product.m4: Likewise. * m4/sum.m4: Likewise. * minloc0_16_i16.c : Regenerated. * minloc0_16_i4.c : Regenerated. * minloc0_16_i8.c : Regenerated. * minloc0_16_r10.c : Regenerated. * minloc0_16_r16.c : Regenerated. * minloc0_16_r4.c : Regenerated. * minloc0_16_r8.c : Regenerated. * minloc0_4_i16.c : Regenerated. * minloc0_4_i4.c : Regenerated. * minloc0_4_i8.c : Regenerated. * minloc0_4_r10.c : Regenerated. * minloc0_4_r16.c : Regenerated. * minloc0_4_r4.c : Regenerated. * minloc0_4_r8.c : Regenerated. * minloc0_8_i16.c : Regenerated. * minloc0_8_i4.c : Regenerated. * minloc0_8_i8.c : Regenerated. * minloc0_8_r10.c : Regenerated. * minloc0_8_r16.c : Regenerated. * minloc0_8_r4.c : Regenerated. * minloc0_8_r8.c : Regenerated. * minloc1_16_i16.c : Regenerated. * minloc1_16_i4.c : Regenerated. * minloc1_16_i8.c : Regenerated. * minloc1_16_r10.c : Regenerated. * minloc1_16_r16.c : Regenerated. * minloc1_16_r4.c : Regenerated. * minloc1_16_r8.c : Regenerated. * minloc1_4_i16.c : Regenerated. * minloc1_4_i4.c : Regenerated. * minloc1_4_i8.c : Regenerated. * minloc1_4_r10.c : Regenerated. * minloc1_4_r16.c : Regenerated. * minloc1_4_r4.c : Regenerated. * minloc1_4_r8.c : Regenerated. * minloc1_8_i16.c : Regenerated. * minloc1_8_i4.c : Regenerated. * minloc1_8_i8.c : Regenerated. * minloc1_8_r10.c : Regenerated. * minloc1_8_r16.c : Regenerated. * minloc1_8_r4.c : Regenerated. * minloc1_8_r8.c : Regenerated. * maxloc0_16_i16.c : Regenerated. * maxloc0_16_i4.c : Regenerated. * maxloc0_16_i8.c : Regenerated. * maxloc0_16_r10.c : Regenerated. * maxloc0_16_r16.c : Regenerated. * maxloc0_16_r4.c : Regenerated. * maxloc0_16_r8.c : Regenerated. * maxloc0_4_i16.c : Regenerated. * maxloc0_4_i4.c : Regenerated. * maxloc0_4_i8.c : Regenerated. * maxloc0_4_r10.c : Regenerated. * maxloc0_4_r16.c : Regenerated. * maxloc0_4_r4.c : Regenerated. * maxloc0_4_r8.c : Regenerated. * maxloc0_8_i16.c : Regenerated. * maxloc0_8_i4.c : Regenerated. * maxloc0_8_i8.c : Regenerated. * maxloc0_8_r10.c : Regenerated. * maxloc0_8_r16.c : Regenerated. * maxloc0_8_r4.c : Regenerated. * maxloc0_8_r8.c : Regenerated. * maxloc1_16_i16.c : Regenerated. * maxloc1_16_i4.c : Regenerated. * maxloc1_16_i8.c : Regenerated. * maxloc1_16_r10.c : Regenerated. * maxloc1_16_r16.c : Regenerated. * maxloc1_16_r4.c : Regenerated. * maxloc1_16_r8.c : Regenerated. * maxloc1_4_i16.c : Regenerated. * maxloc1_4_i4.c : Regenerated. * maxloc1_4_i8.c : Regenerated. * maxloc1_4_r10.c : Regenerated. * maxloc1_4_r16.c : Regenerated. * maxloc1_4_r4.c : Regenerated. * maxloc1_4_r8.c : Regenerated. * maxloc1_8_i16.c : Regenerated. * maxloc1_8_i4.c : Regenerated. * maxloc1_8_i8.c : Regenerated. * maxloc1_8_r10.c : Regenerated. * maxloc1_8_r16.c : Regenerated. * maxloc1_8_r4.c : Regenerated. * maxloc1_8_r8.c : Regenerated. * maxval_i16.c : Regenerated. * maxval_i4.c : Regenerated. * maxval_i8.c : Regenerated. * maxval_r10.c : Regenerated. * maxval_r16.c : Regenerated. * maxval_r4.c : Regenerated. * maxval_r8.c : Regenerated. * minval_i16.c : Regenerated. * minval_i4.c : Regenerated. * minval_i8.c : Regenerated. * minval_r10.c : Regenerated. * minval_r16.c : Regenerated. * minval_r4.c : Regenerated. * minval_r8.c : Regenerated. * sum_c10.c : Regenerated. * sum_c16.c : Regenerated. * sum_c4.c : Regenerated. * sum_c8.c : Regenerated. * sum_i16.c : Regenerated. * sum_i4.c : Regenerated. * sum_i8.c : Regenerated. * sum_r10.c : Regenerated. * sum_r16.c : Regenerated. * sum_r4.c : Regenerated. * sum_r8.c : Regenerated. * product_c10.c : Regenerated. * product_c16.c : Regenerated. * product_c4.c : Regenerated. * product_c8.c : Regenerated. * product_i16.c : Regenerated. * product_i4.c : Regenerated. * product_i8.c : Regenerated. * product_r10.c : Regenerated. * product_r16.c : Regenerated. * product_r4.c : Regenerated. * product_r8.c : Regenerated. 2006-03-17 Jerry DeLisle PR libgfortran/26509 * libgfortran.h: Add ERROR_DIRECT_EOR. * runtime/error.c (translate_error): Add translation for new error. * io/transfer.c (write_buf): Add check for EOR when mode is direct access. 2006-03-13 Paul Thomas PR fortran/25378 * libgfortran/m4/minloc1.m4: Set the initial position to zero and modify the condition for updating it, to implement the F2003 requirement for all(mask).eq.false. * libgfortran/m4/maxloc1.m4: The same. * libgfortran/m4/iforeach.m4: The same. * libgfortran/m4/minloc0.m4: The same. * libgfortran/m4/maxloc0.m4: The same. * libgfortran/generated/maxloc0_16_i16.c: Regenerated, together with 41 others. * libgfortran/generated/minloc0_16_i16.c: Regenerated, together with 41 others. 2006-03-09 Jerry DeLisle PR libgfortran/26499 * io/file_pos (st_rewind): Flush always. * io/unix.c (fd_truncate): Return SUCCESS rather than FAILURE for special files like /dev/null. * io/transfer.c (st_write_done): Remove broken logic that prevented calling fd_truncate. 2006-03-05 Jerry DeLisle PR libgfortran/26554 * io/list_read.c (read_logical): Return the value if not in namelist mode. 2006-03-03 Thomas Koenig PR fortran/25031 * runtime/memory.c: Adjust copyright years. (allocate_array): New function. (allocate64_array): New function. * libgfortran.h (error_codes): Add ERROR_ALLOCATION. 2006-02-28 Jerry DeLisle PR libgfortran/26136 * io/io.h: Add flag for reading from line_buffer. * io/list_read.c (l_push_char): New function to save namelist input when reading logicals. (free_line): New function to free line_buffer memory. (next_char): Added feature to read from line_buffer. (read_logical): Use new functions to test for '=' after reading a logical value, checking for possible variable name. (namelist_read): Use free_line when all done. 2006-02-27 Jerry DeLisle PR libgfortran/26464 * io/file_pos.c (st_backspace): Flush and truncate file when in AFTER_ENDFILE condition. * io/transfer.c (st_read_done): Remove flush, no longer needed. 2006-02-24 Jerry DeLisle PR libgfortran/26423 * io/unix.c (fd_seek): Revert change from 25949. (fd_read): Same. (fd_write): Same. 2006-02-19 Francois-Xavier Coudert * io/open.c (edit_modes): Correct abusive copy-pasting. 2006-02-16 Francois-Xavier Coudert PR libfortran/24903 * m4/dotprodc.m4: Use __builtin_conj instead of assigning real and imaginary parts separately. * generated/dotprod_c4.c: Regenerated. * generated/dotprod_c8.c: Regenerated. * generated/dotprod_c10.c: Regenerated. * generated/dotprod_c16.c: Regenerated. 2006-02-12 Janne Blomqvist PR libgfortran/25949 * io/io.h: Add set function pointer to struct stream. * io/unix.c (fd_seek): Only update offset, don't seek. (fd_sset): New function. (fd_read): Call lseek directly if necessary. (fd_write): Likewise. (fd_open): Set pointer to fd_sset. (mem_set): New function. (open_internal): Set pointer to mem_set. * io/transfer.c (write_block_direct): Rename to write_buf, add error return, non-pointer length argument. (unformatted_write): Update to use write_buf. (us_write): Simplify by using swrite instead of salloc_w. (write_us_marker): New function. (new_record_w): Use sset instead of memset, use write_us_marker, simplify by using swrite instead of salloc_w. 2006-02-08 Francois-Xavier Coudert PR libfortran/25425 * libgfortran.h: Add pedantic field to compile_options struct. * io/write.c (calculate_G_format): Depending on the standard, choose E or F format for list-directed output of 0.0. * runtime/error.c (notify_std): Make warning and error dependent on pedanticity. * runtime/compile_options.c (set_std): Use new pedantic argument. 2006-02-07 Dale Ranta PR fortran/25577 * intrinsics/mvbits.c: Shift '(TYPE)1' type when building 'lenmask'. 2006-02-07 Rainer Emrich * intrinsics/c99_functions.c: Work around incompatible declarations of cabs{,f,l} on pre-C99 IRIX systems. 2005-02-06 Thomas Koenig PR libfortran/23815 * runtime/environ.c (init_unformatted): Add GFORTRAN_CONVERT_UNIT environment variable. (top level): Add defines, type and static variables for GFORTRAN_CONVERT_UNIT handling. (search_unit): New function. (match_word): New function. (match_integer): New function. (next_token): New function. (push_token): New function. (mark_single): New function. (mark_range): New funciton. (do_parse): New function. (init_unformatted): New function. (get_unformatted_convert): New function. * runtime/compile_options.c: Add set_convert(). * libgfortran.h: Add convert to compile_options_t. * io/open.c (st_open): Call get_unformatted_convert to get unit default; if CONVERT_NONE is returned, check for the presence of a CONVERT specifier and use it. As default, use compile_options.convert. * io/io.h (top level): Add CONVERT_NONE to unit_convert, to signal "nothing has been set". (top level): Add prototype for get_unformatted_convert. 2006-02-06 Francois-Xavier Coudert PR libfortran/24685 * io/write.c (write_real): Widen the default format for real(10) variables output. 2006-01-24 Jerry DeLisle PR libgfortran/25835 * io/transfer.c (st_read_done): Flush buffers when read is done. 2006-01-17 Jerry DeLisle PR libgfortran/25697 * io/transfer.c (us_read): Detect end of file condition from previous operations and bail out (no need to pre-position). 2006-01-17 Jerry DeLisle PR libgfortran/25631 * io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and skips so that TL works correctly when no bytes_used yet. 2006-01-16 Roger Sayle * configure.ac (CFLAGS): Update to include -std=gnu99 so that the configure tests will be run with the same environment as used to compile the libgfortran source code. * configure: Regenerate. 2006-01-12 Roger Sayle * intrinsics/c99_functions.c: Add function prototypes to avoid warnings from -Wstrict-prototypes -Wmissing-prototypes. On Tru64 work around a brain-dead libm by redirecting calls to cabs{,f,l} to a local __gfc_cabs{,f,l}. 2006-01-07 Janne Blomqvist * configure.ac: Remove check for sys/mman.h. * configure: Regenerated. * Makefile.in: Regenerated. * config.h.in: Regenerated. * aclocal.m4: Regenerated. 2006-01-05 Jerry DeLisle PR libgfortran/25598 * io/file_pos.c (unformatted_backspace): Assure the new file position to seek is not less than zero. (st_backspace): Set unit bytes_left to zero. * io/transfer.c (next_record_r): Fix line lengths, no functional change. 2006-01-02 Paolo Bonzini PR target/25259 * configure.ac: Use GCC_HEADER_STDINT. * libgfortran.h: Include gstdint.h. * aclocal.m4: Regenerate. * configure: Regenerate. 2006-01-01 Steven G. Kargl * ChangeLog: Split into years ... * ChangeLog-2002: here. * ChangeLog-2003: here. * ChangeLog-2004: here. * ChangeLog-2005: here.