aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/Makefile.am
AgeCommit message (Collapse)AuthorFilesLines
2008-08-14re PR libfortran/36886 (misaligment for cshift of character)Thomas Koenig1-1/+20
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-05-18select.c: Moved content to select_inc.c.Francois-Xavier Coudert1-0/+1
* 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-15Part 1 of PR 25561.Janne Blomqvist1-1/+2
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-09Makefile.am (LTLDFLAGS): New.Julian Brown1-1/+3
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-04-30intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.François-Xavier Coudert1-0/+1
* 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-03-28re PR libfortran/32972 (performance of pack/unpack)Thomas Koenig1-2/+20
2008-03-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 PR libfortran/32512 * Makefile.am: Add new variable, i_spread_c, containing pack_i1.c, pack_i2.c, pack_i4.c, pack_i8.c, spread_i16.c, spread_r4.c, spread_r8.c, spread_r10.c, spread_r16.c, spread_c4.c, spread_c8.c, spread_c10.c, spread_c16.c. * Makefile.in: Regenerated. * libgfortran.h: Add prototypes for spread_i1, spread_i2, spread_i4, spread_i8, spread_i16, spread_r4, spread_r8, spread_c4, spread_c8, spread_c10, spread_c16, spread_scalar_i1, spread_scalar_i2, spread_scalar_i4, spread_scalar_i8, spread_scalar_i16, spread_scalar_r4 spread_scalar_r8, spread_scalar_c4, spread_scalar_c8, spread_scalar_c10 and spread_scalar_c16. Add macros to isolate both type and size information from array descriptors with a single mask operation. * intrinsics/spread_generic.c: Add calls to specific spread functions. * m4/spread.m4: New file. * generated/spread_i1.c: New file. * generated/spread_i2.c: New file. * generated/spread_i4.c: New file. * generated/spread_i8.c: New file. * generated/spread_i16.c: New file. * generated/spread_r4.c: New file. * generated/spread_r8.c: New file. * generated/spread_r10.c: New file. * generated/spread_r16.c: New file. * generated/spread_c4.c: New file. * generated/spread_c8.c: New file. * generated/spread_c10.c: New file. * generated/spread_c16.c: New file. 2008-03-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 PR libfortran/32512 * intrinsic_spread_1.f90: New file. * intrinsic_spread_2.f90: New file. * intrinsic_spread_3.f90: New file. From-SVN: r133702
2008-03-23re PR libfortran/32972 (performance of pack/unpack)Thomas Koenig1-2/+21
2007-03-23 Thomas Koenig <tkoenig@gcc.gnu.org PR libfortran/32972 * Makefile.am: Add new variable, i_unpack_c, containing unpack_i1.c, unpack_i2.c, unpack_i4.c, unpack_i8.c, unpack_i16.c, unpack_r4.c, unpack_r8.c, unpack_r10.c, unpack_r16.c, unpack_c4.c, unpack_c8.c, unpack_c10.c and unpack_c16.c Add i_unpack_c to gfor_built_src. Add rule to generate i_unpack_c from m4/unpack.m4. * Makefile.in: Regenerated. * libgfortran.h: Add prototypes for unpack0_i1, unpack0_i2, unpack0_i4, unpack0_i8, unpack0_i16, unpack0_r4, unpack0_r8, unpack0_r10, unpack0_r16, unpack0_c4, unpack0_c8, unpack0_c10, unpack0_c16, unpack1_i1, unpack1_i2, unpack1_i4, unpack1_i8, unpack1_i16, unpack1_r4, unpack1_r8, unpack1_r10, unpack1_r16, unpack1_c4, unpack1_c8, unpack1_c10 and unpack1_c16. * intrinsics/pack_generic.c (unpack1): Add calls to specific unpack1 functions. (unpack0): Add calls to specific unpack0 functions. * m4/unpack.m4: New file. * generated/unpack_i1.c: New file. * generated/unpack_i2.c: New file. * generated/unpack_i4.c: New file. * generated/unpack_i8.c: New file. * generated/unpack_i16.c: New file. * generated/unpack_r4.c: New file. * generated/unpack_r8.c: New file. * generated/unpack_r10.c: New file. * generated/unpack_r16.c: New file. * generated/unpack_c4.c: New file. * generated/unpack_c8.c: New file. * generated/unpack_c10.c: New file. * generated/unpack_c16.c: New file. 2007-03-23 Thomas Koenig <tkoenig@gcc.gnu.org PR libfortran/32972 * gfortran.dg/intrinsic_unpack_1.f90: New test case. * gfortran.dg/intrinsic_unpack_2.f90: New test case. * gfortran.dg/intrinsic_unpack_3.f90: New test case. From-SVN: r133469
2008-03-21re PR libfortran/32972 (performance of pack/unpack)Thomas Koenig1-2/+20
2008-03-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 * Makefile.am: Add new variable, i_pack_c, containing pack_i1.c, pack_i2.c, pack_i4.c, pack_i8.c, pack_i16.c, pack_r4.c, pack_r8.c, pack_r10.c, pack_r16.c, pack_c4.c, pack_c8.c, pack_c10.c, pack_c16.c. Add m4/pack.m4 to m4_files. Add i_pack_c to gfor_built_src. Add rule to generate i_pack_c from m4/pack.m4. * Makefile.in: Regenerated. * libgfortran.h: Add prototypes for pack_i1, pack_i2, pack_i4, pack_i8, pack_i16, pack_r4, pack_r8, pack_c4, pack_c8, pack_c10, pack_c16. * intrinsics/pack_generic.c: Add calls to specific pack functions. * m4/pack.m4: New file. * generated/pack_i1.c: New file. * generated/pack_i2.c: New file. * generated/pack_i4.c: New file. * generated/pack_i8.c: New file. * generated/pack_i16.c: New file. * generated/pack_r4.c: New file. * generated/pack_r8.c: New file. * generated/pack_r10.c: New file. * generated/pack_r16.c: New file. * generated/pack_c4.c: New file. * generated/pack_c8.c: New file. * generated/pack_c10.c: New file. * generated/pack_c16.c: New file. 2008-03-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 * internal_pack_1.f90: New test case. * internal_pack_2.f90: New test case. * internal_pack_3.f90: New test case. From-SVN: r133427
2008-03-19re PR libfortran/32972 (performance of pack/unpack)Thomas Koenig1-0/+12
2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 * Makefile.am (in_pack_c): Add in_pack_i1.c, in_pack_i2.c, in_pack_r4.c, in_pack_r8.c, in_pack_r10.c and in_pack_r16.c. (in_unpack_c): Add in_unpack_i1.c, in_unpack_i2.c, in_unpack_r4.c, in_unpack_r8.c, in_unpack_r10.c and in_unpack_r16.c. * Makefile.in: Regenerate. * libgfortran.h: Add prototypes for internal_pack_1, internal_pack_2, internal_pack_16, internal_pack_r4, internal_pack_r8, internal_pack_r10, internal_pack_r16, internal_pack_c10 and internal_pack_c16. Add prototypes for internal_unpack_1, internal_unpack_2, internal_unpack_16, internal_unpack_r4, internal_unpack_r8, internal_unpack_r10, internal_unpack_r16, internal_unpack_c10 and internal_unpack_c16. * runtime/in_pack_generic.c (internal_pack): Use sizeof instead of hardwired sizes. Add calls to internal_pack_1, internal_pack_2, internal_pack_16, internal_pack_r4, internal_pack_r8, internal_pack_r10, internal_pack_r16, internal_pack_c10 and internal_pack_c16. * runtime/in_unpack_generic.c (internal_unpack): Use sizeof instead of hardwired sizes. Add calls to internal_unpack_1, internal_unpack_2, internal_unpack_16, internal_unpack_r4, internal_unpack_r8, internal_unpack_r10, internal_unpack_r16, internal_unpack_c10 and internal_unpack_c16. * generated/in_pack_r4.c: New file. * generated/in_pack_i2.c: New file. * generated/in_unpack_i1.c: New file. * generated/in_pack_r10.c: New file. * generated/in_unpack_r4.c: New file. * generated/in_unpack_i2.c: New file. * generated/in_unpack_r16.c: New file. * generated/in_pack_r8.c: New file. * generated/in_unpack_r10.c: New file. * generated/in_unpack_r8.c: New file. * generated/in_pack_r16.c: New file. * generated/in_pack_i1.c: New file. 2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 * gfortran.dg/internal_pack_1.f90: New test case. * gfortran.dg/internal_pack_2.f90: New test case. * gfortran.dg/internal_pack_3.f90: New test case. From-SVN: r133344
2008-03-03re PR fortran/33197 (Fortran 2008: math functions)François-Xavier Coudert1-0/+1
PR fortran/33197 gcc/fortran/ * intrinsic.c (add_functions): Modify intrinsics ACOSH, ASINH, ATANH, ERF, ERFC and GAMMA. Add intrinsics BESSEL_{J,Y}{0,1,N}, ERFC_SCALED, LOG_GAMMA and HYPOT. * intrinsic.h (gfc_check_hypot, gfc_simplify_hypot, gfc_resolve_hypot): New prototypes. * mathbuiltins.def: Add HYPOT builtin. Make complex versions of ACOSH, ASINH and ATANH available. * gfortran.h (GFC_ISYM_ERFC_SCALED, GFC_ISYM_HYPOT): New values. * lang.opt: Add -std=f2008 option. * libgfortran.h: Define GFC_STD_F2008. * lang-specs.h: Add .f08 and .F08 file suffixes. * iresolve.c (gfc_resolve_hypot): New function. * parse.c (parse_contained): Allow empty CONTAINS for Fortran 2008. * check.c (gfc_check_hypot): New function. * trans-intrinsic.c (gfc_intrinsic_map): Define ERFC_SCALE builtin. * options.c (set_default_std_flags): Allow Fortran 2008 by default. (form_from_filename): Add .f08 suffix. (gfc_handle_option): Handle -std=f2008 option. * simplify.c (gfc_simplify_hypot): New function. * gfortran.texi: Document Fortran 2008 status and file extensions. * intrinsic.texi: Document new BESSEL_{J,Y}{0,1,N} intrinsics, as well as HYPOT and ERFC_SCALED. Update documentation of ERF, ERFC, GAMMA, LGAMMA, ASINH, ACOSH and ATANH. * invoke.texi: Document the new -std=f2008 option. libgomp/ * testsuite/libgomp.fortran/fortran.exp: Add .f08 and .F08 file suffixes. gcc/testsuite/ * gfortran.dg/gomp/gomp.exp: Add .f08 and .F08 file suffixes. * gfortran.dg/dg.exp: Likewise. * gfortran.dg/vect/vect.exp: Likewise. * gfortran.fortran-torture/execute/execute.exp: Likewise. * gfortran.fortran-torture/compile/compile.exp: Likewise. * gfortran.dg/gamma_1.f90: Also check log_gamma. * gfortran.dg/invalid_contains_1.f90: Remove warning about empty CONTAINS. * gfortran.dg/gamma_2.f90: Add a few error messages. * gfortran.dg/invalid_contains_2.f90: Remove warning about empty CONTAINS. * gfortran.dg/gamma_3.f90: Adjust error message. * gfortran.dg/gamma_4.f90: Test for log_gamma instead of lgamma. * gfortran.dg/bind_c_usage_9.f03: Adjust error messages. * gfortran.dg/bessel_1.f90: New test. * gfortran.dg/recursive_check_3.f90: Remove warnings. * gfortran.dg/besxy.f90: Also check for new F2008 intrinsics. * gfortran.dg/derived_function_interface_1.f90: Remove warning. * gfortran.dg/contains_empty_1.f03: New test. * gfortran.dg/erfc_scaled_1.f90: New test. * gfortran.dg/hypot_1.f90: New test. * gfortran.dg/contains_empty_2.f03: New test. libgfortran/ * intrinsics/erfc_scaled_inc.c: New file. * intrinsics/erfc_scaled.c: New file. * gfortran.map (GFORTRAN_1.0): Add _gfortran_erfc_scaled_r*. * Makefile.am: Add intrinsics/erfc_scaled.c. * config.h.in: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. From-SVN: r132846
2008-02-25re PR fortran/29549 (matmul slow for complex matrices)Janne Blomqvist1-0/+3
2008-02-25 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/29549 * Makefile.am: Add -fcx-fortran-rules to AM_CFLAGS for all of libgfortran. * Makefile.in: Regenerated. From-SVN: r132638
2008-01-15re PR libfortran/34671 (any(kind=1) and all(kind=1))Thomas Koenig1-13/+14
2008-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/34671 * gfortran.am: Added _gfortran_all_l1, _gfortran_all_l2, _gfortran_any_l1, _gfortran_any_l2, -28,15 _gfortran_count_1_l, _gfortran_count_16_l, _gfortran_count_2_l, _gfortran_count_4_l and _gfortran_count_8_l Removed _gfortran_count_16_l16, _gfortran_count_16_l4, _gfortran_count_16_l8, _gfortran_count_4_l16, _gfortran_count_4_l4, _gfortran_count_4_l8, _gfortran_count_8_l16, _gfortran_count_8_l4 and _gfortran_count_8_l8. * Makefile.am: Added generated/any_l1.c and generated/any_l2.c to i_any_c. Added generated/all_l1. and generated/all_l2.c to i_all_c. Removed generated/count_4_l4.c, generated/count_8_l4.c, generated/count_16_l4.c, generated/count_4_l8.c, generated/count_8_l8.c, generated/count_16_l8.c, generated/count_4_l16.c, generated/count_8_l16.c, and generated/count_16_l16.c from i_count_c. Added count_1_l.c, count_2_l.c, count_4_l.c, count_8_l.c and count_16_l.c to i_count_c. I_M4_DEPS2 depends on ifunction_logical.m4, for any of the files generated from all.m4, any.m4 and count.m4. * Makefile.in: Regenerated. * m4/ifunction_logical.m4: New file. Use GFC_LOGICAL_1 pointer for access to source arrays. * m4/any.m4: Include ifunction_logical.m4 instead of ifunction.m4. Don't check atype_name. * m4/all.m4: Likewise. * m4/count.m4: Likewise. * generated/any_l1.c: New file. * generated/any_l2.c: New file. * generated/all_l1.c: New file. * generated/count_1_l.c: New file. * generated/count_2_l.c: New file. * generated/count_4_l.c: New file. * generated/count_8_l.c: New file. * generated/count_16_l.c: New file. * generated/any_l4.c: Regenerated. * generated/any_l8.c: Regenerated. * generated/any_l16.c: Regenerated. * generated/all_l4.c: Regenerated. * generated/all_l8.c: Regenerated. * generated/all_l16.c: Regenerated. * generated/count_4_l4.c: Removed. * generated/count_4_l8.c: Removed. * generated/count_4_l16.c: Removed. * generated/count_8_l4.c: Removed. * generated/count_8_l8.c: Removed. * generated/count_8_l16.c: Removed. * generated/count_16_l4.c: Removed. * generated/count_16_l8.c: Removed. * generated/count_16_l16.c: Removed. 2008-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/34671 * iresolve.c (gfc_resolve_all): Call resolve_mask_arg. (gfc_resolve_any): Likewise. (gfc_resolve_count): Likewise. Don't append kind of argument to function name. 2008-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/34671 * gfortran.dg/anyallcount_1.f90: New test. From-SVN: r131553
2007-12-25re PR fortran/34533 (DTIME returns total process time and not since last ↵Daniel Franke1-0/+1
invocation) gcc/fortran: 2007-12-25 Daniel Franke <franke.daniel@gmail.com> PR fortran/34533 * intrinsic.h (gfc_check_etime): Renamed to ... (gfc_check_dtime_etime): ... this. (gfc_check_etime_sub): Renamed to ... (gfc_check_dtime_etime_sub): ... this. (gfc_resolve_dtime_sub): New prototype. * check.c (gfc_check_etime): Renamed to ... (gfc_check_dtime_etime): ... this. (gfc_check_etime_sub): Renamed to ... (gfc_check_dtime_etime_sub): ... this. * iresolve.c (gfc_resolve_dtime_sub): New implementation. * intrinsic.c (add_functions): Removed alias from ETIME to DTIME, added stand-alone intrinsic DTIME. (add_subroutines): Adjusted check and resolve function names for DTIME and ETIME. * trans-intrinsic.c (gfc_conv_intrinsic_function): Added DTIME to known functions in switch. * intrinsic.texi (DTIME): Added paragraph about thread-safety, fixed return value section. (CPU_TIME): Clarified intent and added implementation notes. libgfortran: 2007-12-25 Daniel Franke <franke.daniel@gmail.com> PR fortran/34533 * intrinsics/cpu_time.c: Moved code commonly usable for CPU_TIME, DTIME and ETIME to ... * intrinsics/time_1.h: ... here. * intrinsics/dtime.c: New file. * intrinsics/etime.c: Newly implemented using the common time-aquisition function from time_1.h. * gfortran.map (_gfortran_dtime, _gfortran_dtime_sub): New. * Makefile.am: Added new file. * Makefile.in: Regenerated. * configure: Regenerated. From-SVN: r131168
2007-09-21re PR libfortran/31546 (add --enable-intermodule)Bernhard Fischer1-1/+33
PR fortran/31546 * (configure.ac): Add --enable-intermodule for onestep build. * (Makefile.am): Handle onestep build. * (configure, Makefile.in): Regenerate. From-SVN: r128654
2007-08-22Makefile.am (AM_CPPFLAGS): Commentary typo fix.Bernhard Fischer1-1/+1
2007-08-22 Bernhard Fischer <rep.dot.nop@gmail.com> * libgfortran/Makefile.am (AM_CPPFLAGS): Commentary typo fix. From-SVN: r127714
2007-07-02[multiple changes]Christopher D. Rickett1-1/+3
2007-07-01 Christopher D. Rickett <crickett@lanl.gov> * interface.c (gfc_compare_derived_types): Special case for comparing derived types across namespaces. (gfc_compare_types): Deal with BT_VOID. (compare_parameter): Use BT_VOID to accept ISO C Binding pointers. * trans-expr.c (gfc_conv_function_call): Remove setting parm_kind to SCALAR (gfc_conv_initializer): Deal with ISO C Binding NULL_PTR and NULL_FUNPTR. (gfc_conv_expr): Convert expressions for ISO C Binding derived types. * symbol.c (gfc_set_default_type): BIND(C) variables should not be implicitly declared. (check_conflict): Add BIND(C) and check for conflicts. (gfc_add_explicit_interface): Whitespace. (gfc_add_is_bind_c): New function. (gfc_copy_attr): Use it. (gfc_new_symbol): Initialize ISO C Binding objects. (get_iso_c_binding_dt): New function. (verify_bind_c_derived_type): Ditto. (gen_special_c_interop_ptr): Ditto. (add_formal_arg): Ditto. (gen_cptr_param): Ditto. (gen_fptr_param): Ditto. (gen_shape_param): Ditto. (add_proc_interface): Ditto. (build_formal_args): Ditto. (generate_isocbinding_symbol): Ditto. (get_iso_c_sym): Ditto. * decl.c (num_idents_on_line, has_name_equals): New variables. (verify_c_interop_param): New function. (build_sym): Finish binding labels and deal with COMMON blocks. (add_init_expr_to_sym): Check if the initialized expression is an iso_c_binding named constants (variable_decl): Set ISO C Binding type_spec components. (gfc_match_kind_spec): Check match for C interoperable kind. (match_char_spec): Fix comment. Chnage gfc_match_small_int to gfc_match_small_int_expr. Check for C interoperable kind. (match_type_spec): Clear the current binding label. (match_attr_spec): Add DECL_IS_BIND_C. If BIND(C) is found, use it to set attributes. (set_binding_label): New function. (set_com_block_bind_c): Ditto. (verify_c_interop): Ditto. (verify_com_block_vars_c_interop): Ditto. (verify_bind_c_sym): Ditto. (set_verify_bind_c_sym): Ditto. (set_verify_bind_c_com_block): Ditto. (get_bind_c_idents): Ditto. (gfc_match_bind_c_stmt): Ditto. (gfc_match_data_decl): Use num_idents_on_line. (match_result): Deal with right paren in BIND(C). (gfc_match_suffix): New function. (gfc_match_function_decl): Use it. Code is re-arranged to deal with ISO C Binding result clauses. (gfc_match_subroutine): Deal with BIND(C). (gfc_match_bind_c): New function. (gfc_get_type_attr_spec): New function. Code is re-arranged in and taken from gfc_match_derived_decl. (gfc_match_derived_decl): Add check for BIND(C). * trans-common.c: Forward declare gfc_get_common. (gfc_sym_mangled_common_id): Change arg from 'const char *name' to 'gfc_common_head *com'. Check for ISO C Binding of the common block. (build_common_decl): 'com->name' to 'com in SET_DECL_ASSEMBLER_NAME. * gfortran.h: Add GFC_MAX_BINDING_LABEL_LEN (bt): Add BT_VOID (sym_flavor): Add FL_VOID. (iso_fortran_env_symbol, iso_c_binding_symbol, intmod_id): New enum (CInteropKind_t): New struct. (c_interop_kinds_table): Use it. Declare an array of structs. (symbol_attribute): Add is_bind_c, is_c_interop, and is_iso_c bitfields. (gfc_typespec): Add is_c_interop; is_iso_c, and f90_type members. (gfc_symbol): Add from_intmod, intmod_sym_id, binding_label, and common_block members. (gfc_common_head): Add binding_label and is_bind_c members. (gfc_gsymbol): Add sym_name, mod_name, and binding_label members. Add prototypes for get_c_kind, gfc_validate_c_kind, gfc_check_any_c_kind, gfc_add_is_bind_c, gfc_add_value, verify_c_interop, verify_c_interop_param, verify_bind_c_sym, verify_bind_c_derived_type, verify_com_block_vars_c_interop, generate_isocbinding_symbol, get_iso_c_sym, gfc_iso_c_sub_interface * iso-c-binding.def: New file. This file contains the definitions of the types provided by the Fortran 2003 ISO_C_BINDING intrinsic module. * trans-const.c (gfc_conv_constant_to_tree): Deal with C_NULL_PTR or C_NULL_FUNPTR expressions. * expr.c (gfc_copy_expr): Add BT_VOID case. For BT_CHARACTER, the ISO C Binding requires a minimum string length of 1 for '\0'. * module.c (intmod_sym): New struct. (pointer_info): Add binding_label member. (write_atom): Set len to 0 for NULL pointers. Check for NULL p and *p. (ab_attribute): Add AB_IS_BIND_C, AB_IS_C_INTEROP and AB_IS_ISO_C. (attr_bits): Add "IS_BIND_C", "IS_C_INTEROP", and "IS_ISO_C". (mio_symbol_attribute): Deal with ISO C Binding attributes. (bt_types): Add "VOID". (mio_typespec): Deal with ISO C Binding components. (mio_namespace_ref): Add intmod variable. (mio_symbol): Check for symbols from an intrinsic module. (load_commons): Check for BIND(C) common block. (read_module): Read binding_label and use it. (write_common): Add label. Write BIND(C) info. (write_blank_common): Blank commons are not BIND(C). Explicitly set is_bind_c=0. (write_symbol): Deal with binding_label. (sort_iso_c_rename_list): New function. (import_iso_c_binding_module): Ditto. (create_int_parameter): Add to args. (use_iso_fortran_env_module): Adjust to deal with iso_c_binding intrinsic module. * trans-types.c (c_interop_kinds_table): new array of structs. (gfc_validate_c_kind): New function. (gfc_check_any_c_kind): Ditto. (get_real_kind_from_node): Ditto. (get_int_kind_from_node): Ditto. (get_int_kind_from_width): Ditto. (get_int_kind_from_minimal_width): Ditto. (init_c_interop_kinds): Ditto. (gfc_init_kinds): call init_c_interop_kinds. (gfc_typenode_for_spec): Adjust for BT_VOID and ISO C Binding pointers. Adjust handling of BT_DERIVED. (gfc_sym_type): Whitespace. (gfc_get_derived_type): Account for iso_c_binding derived types * resolve.c (is_scalar_expr_ptr): New function. (gfc_iso_c_func_interface): Ditto. (resolve_function): Use gfc_iso_c_func_interface. (set_name_and_label): New function. (gfc_iso_c_sub_interface): Ditto. (resolve_specific_s0): Use gfc_iso_c_sub_interface. (resolve_bind_c_comms): New function. (resolve_bind_c_derived_types): Ditto. (gfc_verify_binding_labels): Ditto. (resolve_fl_procedure): Check for ISO C interoperability. (resolve_symbol): Check C interoperability. (resolve_types): Walk the namespace. Check COMMON blocks. * trans-decl.c (gfc_sym_mangled_identifier): Prevent the mangling of identifiers that have an assigned binding label. (gfc_sym_mangled_function_id): Use the binding label rather than the mangled name. (gfc_finish_var_decl): Put variables that are BIND(C) into a common segment of the object file, because this is what C would do. (gfc_create_module_variable): Conver to proper types (set_tree_decl_type_code): New function. (generate_local_decl): Check dummy variables and derived types for ISO C Binding attributes. * match.c (gfc_match_small_int_expr): New function. (gfc_match_name_C): Ditto. (match_common_name): Deal with ISO C Binding in COMMON blocks * trans-io.c (transfer_expr): Deal with C_NULL_PTR or C_NULL_FUNPTR expressions * match.h: Add prototypes for gfc_match_small_int_expr, gfc_match_name_C, match_common_name, set_com_block_bind_c, set_binding_label, set_verify_bind_c_sym, set_verify_bind_c_com_block, get_bind_c_idents, gfc_match_bind_c_stmt, gfc_match_suffix, gfc_match_bind_c, gfc_get_type_attr_spec * parse.c (decode_statement): Use gfc_match_bind_c_stmt (parse_derived): Init *derived_sym = NULL, and gfc_current_block later for valiadation. * primary.c (got_delim): Set ISO C Binding components of ts. (match_logical_constant): Ditto. (match_complex_constant): Ditto. (match_complex_constant): Ditto. (gfc_match_rvalue): Check for existence of at least one arg for C_LOC, C_FUNLOC, and C_ASSOCIATED. * misc.c (gfc_clear_ts): Clear ISO C Bindoing components in ts. (get_c_kind): New function. 2007-07-01 Christopher D. Rickett <crickett@lanl.gov> * Makefile.in: Add support for iso_c_generated_procs.c and iso_c_binding.c. * Makefile.am: Ditto. * intrinsics/iso_c_generated_procs.c: New file containing helper functions. * intrinsics/iso_c_binding.c: Ditto. * intrinsics/iso_c_binding.h: New file * gfortran.map: Include the __iso_c_binding_c_* functions. * libgfortran.h: define GFC_NUM_RANK_BITS. 2007-06-23 Christopher D. Rickett <crickett@lanl.gov> * bind_c_array_params.f03: New files for Fortran 2003 ISO C Binding. * bind_c_coms.f90: Ditto. * bind_c_coms_driver.c: Ditto. * bind_c_dts.f90: Ditto. * bind_c_dts_2.f03: Ditto. * bind_c_dts_2_driver.c: Ditto. * bind_c_dts_3.f03: Ditto. * bind_c_dts_4.f03: Ditto. * bind_c_dts_driver.c: Ditto. * bind_c_implicit_vars.f03: Ditto. * bind_c_procs.f03: Ditto. * bind_c_usage_2.f03: Ditto. * bind_c_usage_3.f03: Ditto. * bind_c_usage_5.f03: Ditto. * bind_c_usage_6.f03: Ditto. * bind_c_usage_7.f03: Ditto. * bind_c_vars.f90: Ditto. * bind_c_vars_driver.c: Ditto. * binding_c_table_15_1.f03: Ditto. * binding_label_tests.f03: Ditto. * binding_label_tests_10.f03: Ditto. * binding_label_tests_10_main.f03: Ditto. * binding_label_tests_11.f03: Ditto. * binding_label_tests_11_main.f03: Ditto. * binding_label_tests_12.f03: Ditto. * binding_label_tests_13.f03: Ditto. * binding_label_tests_13_main.f03: Ditto. * binding_label_tests_14.f03: Ditto. * binding_label_tests_2.f03: Ditto. * binding_label_tests_3.f03: Ditto. * binding_label_tests_4.f03: Ditto. * binding_label_tests_5.f03: Ditto. * binding_label_tests_6.f03: Ditto. * binding_label_tests_7.f03: Ditto. * binding_label_tests_8.f03: Ditto. * binding_label_tests_9.f03: Ditto. * c_assoc.f90: Ditto. * c_assoc_2.f03: Ditto. * c_f_pointer_shape_test.f90: Ditto. * c_f_pointer_tests.f90: Ditto. * c_f_tests_driver.c: Ditto. * c_funloc_tests.f03: Ditto. * c_funloc_tests_2.f03: Ditto. * c_funloc_tests_3.f03: Ditto. * c_funloc_tests_3_funcs.c: Ditto. * c_kind_params.f90: Ditto. * c_kind_tests_2.f03: Ditto. * c_kinds.c: Ditto. * c_loc_driver.c: Ditto. * c_loc_test.f90: Ditto. * c_loc_tests_2.f03: Ditto. * c_loc_tests_2_funcs.c: Ditto. * c_loc_tests_3.f03: Ditto. * c_loc_tests_4.f03: Ditto. * c_loc_tests_5.f03: Ditto. * c_loc_tests_6.f03: Ditto. * c_loc_tests_7.f03: Ditto. * c_loc_tests_8.f03: Ditto. * c_ptr_tests.f03: Ditto. * c_ptr_tests_10.f03: Ditto. * c_ptr_tests_5.f03: Ditto. * c_ptr_tests_7.f03: Ditto. * c_ptr_tests_7_driver.c: Ditto. * c_ptr_tests_8.f03: Ditto. * c_ptr_tests_8_funcs.c: Ditto. * c_ptr_tests_9.f03: Ditto. * c_ptr_tests_driver.c: Ditto. * c_size_t_driver.c: Ditto. * c_size_t_test.f03: Ditto. * com_block_driver.f90: Ditto. * global_vars_c_init.f90: Ditto. * global_vars_c_init_driver.c: Ditto. * global_vars_f90_init.f90: Ditto. * global_vars_f90_init_driver.c: Ditto. * interop_params.f03: Ditto. * iso_c_binding_only.f03: Ditto. * iso_c_binding_rename_1.f03: Ditto. * iso_c_binding_rename_1_driver.c: Ditto. * iso_c_binding_rename_2.f03: Ditto. * iso_c_binding_rename_2_driver.c: Ditto. * kind_tests_2.f03: Ditto. * kind_tests_3.f03: Ditto. * module_md5_1.f90: Ditto. * only_clause_main.c: Ditto. * print_c_kinds.f90: Ditto. * test_bind_c_parens.f03: Ditto. * test_c_assoc.c: Ditto. * test_com_block.f90: Ditto. * test_common_binding_labels.f03: Ditto. * test_common_binding_labels_2.f03: Ditto. * test_common_binding_labels_2_main.f03: Ditto. * test_common_binding_labels_3.f03: Ditto. * test_common_binding_labels_3_main.f03: Ditto. * test_only_clause.f90: Ditto. * use_iso_c_binding.f90: Ditto. * value_5.f90: Ditto. * value_test.f90: Ditto. * value_tests_f03.f90: Ditto. From-SVN: r126185
2007-07-01re PR fortran/32239 (optimize power in loops, use __builtin_powi instead of ↵Janne Blomqvist1-4/+0
_gfortran_pow_r4_i4) gcc/fortran: 2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/32239 * trans-expr.c (gfc_conv_power_op): Use builtin_powi for real**int4 powers. * f95-lang.c (gfc_init_builtin_functions): Add builtin_powi to the builtins table. libgfortran: 2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/32239 * Makefile.am: Don't generate real**int4 pow functions. * gfortran.map: Remove real**int4 pow symbols. * Makefile.in: Regenerated. testsuite 2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/32239 * gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 (test_4): Use proper test for floating point equality. (test_8): Likewise. From-SVN: r126175
2007-04-24re PR libfortran/27740 (libgfortran should use versioned symbols)Janne Blomqvist1-1/+8
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-14Makefile.am: Add -I ..Steve Ellcey1-1/+2
* Makefile.am: Add -I .. to ACLOCAL_AMFLAGS. Add libgfortran_la_LINK. * Makefile.in: Regenerate. From-SVN: r123827
2007-03-15gfortran.h (gfc_option_t): Add flag_backtrace field.Francois-Xavier Coudert1-0/+1
* gfortran.h (gfc_option_t): Add flag_backtrace field. * lang.opt: Add -fbacktrace option. * invoke.texi: Document the new option. * trans-decl.c (gfc_build_builtin_function_decls): Add new option to the call to set_std. * options.c (gfc_init_options, gfc_handle_option): Handle the new option. * runtime/backtrace.c: New file. * runtime/environ.c (variable_table): New GFORTRAN_ERROR_BACKTRACE environment variable. * runtime/compile_options.c (set_std): Add new argument. * runtime/main.c (store_exe_path, full_exe_path): New functions. * runtime/error.c (sys_exit): Add call to show_backtrace. * libgfortran.h (options_t): New backtrace field. (store_exe_path, full_exe_path, show_backtrace): New prototypes. * configure.ac: Add checks for execinfo.h, execvp, pipe, dup2, close, fdopen, strcasestr, getrlimit, backtrace, backtrace_symbols and getppid. * Makefile.am: Add runtime/backtrace.c. * fmain.c (main): Add call to store_exe_path. * Makefile.in: Renegerate. * config.h.in: Renegerate. * configure: Regenerate. From-SVN: r122954
2007-03-01Makefile.am: Add dummy install-pdf target.Brooks Moses1-2/+3
* Makefile.am: Add dummy install-pdf target. * Makefile.in: Regenerate From-SVN: r122446
2007-02-19re PR libfortran/30533 ([4.1 only] minval, maxval missing for kind=1 and kind=2)Thomas Koenig1-395/+429
2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 PR libfortran/30765 * Makefile.am: Add $(srcdir) too all files in generated/. (i_maxloc0_c): Add maxloc0_4_i1.c, maxloc0_8_i1.c, maxloc0_16_i1.c, maxloc0_4_i2.c, maxloc0_8_i2.c and maxloc0_16_i2.c. (i_maxloc1_c): Add maxloc1_4_i1.c, maxloc1_8_i1.c, maxloc1_16_i1.c, maxloc1_4_i2.c, maxloc1_8_i2.c and maxloc1_16_i2.c. (i_maxval_c): Add maxval_i1.c and maxval_i2.c. (i_minloc0_c): Add minloc0_4_i1.c, minloc0_8_i1.c, minloc0_16_i1.c, minloc0_4_i2.c, minloc0_8_i2.c and minloc0_16_i2.c. (i_minloc_1.c): Add minloc1_4_i1.c, minloc1_8_i1.c, minloc1_16_i1.c, minloc1_4_i2.c, minloc1_8_i2.c and minloc1_16_i2.c. (i_minval_c): Add minval_i1.c and minval_i2.c. (i_sum_c): Add sum_i1.c and sum_i2.c. (i_product_c): Add product_i1.c and product_i2.c. (i_matmul_c): Add matmul_i1.c and matmul_i2.c. (gfor_built_specific_src): Remove $(srcdir) from target. (gfor_bulit_specific2_src): Likewise. Makefile.in: Regenerated. libgfortran.h: Add GFC_INTEGER_1_HUGE and GFC_INTEGER_2_HUGE. Add gfc_array_i1 and gfc_array_i2. * generated/matmul_i1.c: New file. * generated/matmul_i2.c: New file. * generated/maxloc0_16_i1.c: New file. * generated/maxloc0_16_i2.c: New file. * generated/maxloc0_4_i1.c: New file. * generated/maxloc0_4_i2.c: New file. * generated/maxloc0_8_i1.c: New file. * generated/maxloc0_8_i2.c: New file. * generated/maxloc1_16_i1.c: New file. * generated/maxloc1_16_i2.c: New file. * generated/maxloc1_4_i1.c: New file. * generated/maxloc1_4_i2.c: New file. * generated/maxloc1_8_i1.c: New file. * generated/maxloc1_8_i2.c: New file. * generated/maxval_i1.c: New file. * generated/maxval_i2.c: New file. * generated/minloc0_16_i1.c: New file. * generated/minloc0_16_i2.c: New file. * generated/minloc0_4_i1.c: New file. * generated/minloc0_4_i2.c: New file. * generated/minloc0_8_i1.c: New file. * generated/minloc0_8_i2.c: New file. * generated/minloc1_16_i1.c: New file. * generated/minloc1_16_i2.c: New file. * generated/minloc1_4_i1.c: New file. * generated/minloc1_4_i2.c: New file. * generated/minloc1_8_i1.c: New file. * generated/minloc1_8_i2.c: New file. * generated/minval_i1.c: New file. * generated/minval_i2.c: New file. * generated/product_i1.c: New file. * generated/product_i2.c: New file. * generated/sum_i1.c: New file. * generated/sum_i2.c: New file. 2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 * fortran/iresolve.c(gfc_resolve_maxloc): Remove coercion of argument to default integer. (gfc_resolve_minloc): Likewise. 2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 * gfortran.dg/intrinsic_intkinds_1.f90: New test. From-SVN: r122137
2007-02-10Makefile.am: Use $(M4) instead of m4.Thomas Koenig1-1/+1
2007-02-10 Thomas Koenig <Thomas.Koenig@online.de> * Makefile.am: Use $(M4) instead of m4. * Makefile.in: Regenerate. From-SVN: r121801
2007-02-10Makefile.am: Remove $(srcdir) from assorted targets in maintainer mode.Thomas Koenig1-28/+28
2007-02-10 Thomas Koenig <Thomas.Koenig@online.de> * Makefile.am: Remove $(srcdir) from assorted targets in maintainer mode. * Makefile.in: Regenerate. From-SVN: r121795
2007-01-20gfortran.h (gfc_options_t): Add flag_allow_leading_underscore.Francois-Xavier Coudert1-0/+4
* gfortran.h (gfc_options_t): Add flag_allow_leading_underscore. * lang.opt: Add -fallow-leading-underscore. * match.c (gfc_match_name): Allow leading underscore in symbol name if -fallow-leading-underscore is used. * symbol.c (gfc_get_default_type): Add special case for symbol names beginning with an underscore. * trans-decl.c (gfc_get_extern_function_decl, gfc_build_intrinsic_function_decls): Add _gfortran prefix to library symbols selected_int_kind, selected_real_kind and all specifics. * options.c (gfc_init_options, gfc_handle_option): Handle the new -fallow-leading-underscore option. * m4/misc_specifics.m4: Add _gfortran prefix to specific names. * m4/specific2.m4: Likewise. * m4/specific.m4: Likewise. * intrinsics/f2c_specifics.F90: Likewise. * intrinsics/selected_int_kind.f90: Add _gfortran prefix. * intrinsics/selected_real_kind.f90: Likewise. * intrinsics/dprod_r8.f90: Likewise. * Makefile.am: Add -fallow-leading-underscore to the gfor_specific_src files, as well as selected_real_kind.F90 and selected_int_kind.F90 * Makefile.in: Regenerate. * generated/_sqrt_c8.F90: Regenerate. * generated/_sign_r16.F90: Regenerate. * generated/_log_c16.F90: Regenerate. * generated/_sin_c10.F90: Regenerate. * generated/_tanh_r4.F90: Regenerate. * generated/_tanh_r8.F90: Regenerate. * generated/_log10_r10.F90: Regenerate. * generated/_aimag_c4.F90: Regenerate. * generated/_sign_r4.F90: Regenerate. * generated/_aimag_c8.F90: Regenerate. * generated/_sign_r8.F90: Regenerate. * generated/_mod_i4.F90: Regenerate. * generated/_cos_r16.F90: Regenerate. * generated/_aint_r10.F90: Regenerate. * generated/_mod_i8.F90: Regenerate. * generated/_abs_i16.F90: Regenerate. * generated/_sqrt_c10.F90: Regenerate. * generated/_atan2_r4.F90: Regenerate. * generated/_cos_c4.F90: Regenerate. * generated/_atan_r16.F90: Regenerate. * generated/_tanh_r10.F90: Regenerate. * generated/_atan2_r8.F90: Regenerate. * generated/_cos_c8.F90: Regenerate. * generated/_exp_r4.F90: Regenerate. * generated/_log_r10.F90: Regenerate. * generated/_exp_r8.F90: Regenerate. * generated/_abs_r4.F90: Regenerate. * generated/_abs_r8.F90: Regenerate. * generated/_sin_r16.F90: Regenerate. * generated/_tan_r4.F90: Regenerate. * generated/_tan_r8.F90: Regenerate. * generated/_sign_i4.F90: Regenerate. * generated/_sign_i8.F90: Regenerate. * generated/_exp_c16.F90: Regenerate. * generated/_sqrt_r16.F90: Regenerate. * generated/_conjg_c4.F90: Regenerate. * generated/_conjg_c8.F90: Regenerate. * generated/_dim_r16.F90: Regenerate. * generated/_mod_r10.F90: Regenerate. * generated/_abs_c10.F90: Regenerate. * generated/_conjg_c16.F90: Regenerate. * generated/_tan_r16.F90: Regenerate. * generated/_asinh_r10.F90: Regenerate. * generated/_abs_i4.F90: Regenerate. * generated/_abs_i8.F90: Regenerate. * generated/_acos_r10.F90: Regenerate. * generated/_exp_r10.F90: Regenerate. * generated/_acosh_r16.F90: Regenerate. * generated/_atan2_r16.F90: Regenerate. * generated/_cos_c16.F90: Regenerate. * generated/_mod_i16.F90: Regenerate. * generated/_asin_r4.F90: Regenerate. * generated/_anint_r16.F90: Regenerate. * generated/_asin_r8.F90: Regenerate. * generated/_aimag_c10.F90: Regenerate. * generated/_exp_c4.F90: Regenerate. * generated/_sinh_r10.F90: Regenerate. * generated/_exp_c8.F90: Regenerate. * generated/_log10_r4.F90: Regenerate. * generated/_log10_r8.F90: Regenerate. * generated/_abs_c4.F90: Regenerate. * generated/_abs_r16.F90: Regenerate. * generated/_abs_c8.F90: Regenerate. * generated/_asin_r10.F90: Regenerate. * generated/_sign_r10.F90: Regenerate. * generated/_atanh_r16.F90: Regenerate. * generated/_log_c10.F90: Regenerate. * generated/_cosh_r16.F90: Regenerate. * generated/_sin_c16.F90: Regenerate. * generated/_cos_r10.F90: Regenerate. * generated/_log10_r16.F90: Regenerate. * generated/_aint_r16.F90: Regenerate. * generated/_acos_r4.F90: Regenerate. * generated/_acos_r8.F90: Regenerate. * generated/_sqrt_c16.F90: Regenerate. * generated/_acosh_r4.F90: Regenerate. * generated/_atan_r10.F90: Regenerate. * generated/_acosh_r8.F90: Regenerate. * generated/_sign_i16.F90: Regenerate. * generated/_tanh_r16.F90: Regenerate. * generated/_log_r4.F90: Regenerate. * generated/_log_r8.F90: Regenerate. * generated/_sin_r4.F90: Regenerate. * generated/_sin_r8.F90: Regenerate. * generated/_log_r16.F90: Regenerate. * generated/_sin_r10.F90: Regenerate. * generated/_sqrt_r4.F90: Regenerate. * generated/_exp_c10.F90: Regenerate. * generated/_sqrt_r8.F90: Regenerate. * generated/_asinh_r4.F90: Regenerate. * generated/_sqrt_r10.F90: Regenerate. * generated/_asinh_r8.F90: Regenerate. * generated/_dim_r4.F90: Regenerate. * generated/_dim_r8.F90: Regenerate. * generated/_dim_r10.F90: Regenerate. * generated/_cosh_r4.F90: Regenerate. * generated/_conjg_c10.F90: Regenerate. * generated/_tan_r10.F90: Regenerate. * generated/_cosh_r8.F90: Regenerate. * generated/_mod_r16.F90: Regenerate. * generated/_abs_c16.F90: Regenerate. * generated/_cos_r4.F90: Regenerate. * generated/_asinh_r16.F90: Regenerate. * generated/_cos_r8.F90: Regenerate. * generated/_atanh_r4.F90: Regenerate. * generated/_atanh_r8.F90: Regenerate. * generated/_acos_r16.F90: Regenerate. * generated/_anint_r4.F90: Regenerate. * generated/_acosh_r10.F90: Regenerate. * generated/_anint_r8.F90: Regenerate. * generated/_exp_r16.F90: Regenerate. * generated/_mod_r4.F90: Regenerate. * generated/_cos_c10.F90: Regenerate. * generated/_atan2_r10.F90: Regenerate. * generated/_dim_i16.F90: Regenerate. * generated/_mod_r8.F90: Regenerate. * generated/_anint_r10.F90: Regenerate. * generated/_aint_r4.F90: Regenerate. * generated/_aint_r8.F90: Regenerate. * generated/_dim_i4.F90: Regenerate. * generated/_sinh_r4.F90: Regenerate. * generated/_log_c4.F90: Regenerate. * generated/_dim_i8.F90: Regenerate. * generated/_sinh_r8.F90: Regenerate. * generated/_log_c8.F90: Regenerate. * generated/_sin_c4.F90: Regenerate. * generated/_sin_c8.F90: Regenerate. * generated/misc_specifics.F90: Regenerate. * generated/_abs_r10.F90: Regenerate. * generated/_aimag_c16.F90: Regenerate. * generated/_atan_r4.F90: Regenerate. * generated/_sinh_r16.F90: Regenerate. * generated/_atan_r8.F90: Regenerate. * generated/_atanh_r10.F90: Regenerate. * generated/_cosh_r10.F90: Regenerate. * generated/_sqrt_c4.F90: Regenerate. * generated/_asin_r16.F90: Regenerate. From-SVN: r121007
2007-01-17re PR libfortran/27107 (Make dependency on io/io.h broken)Francois-Xavier Coudert1-6/+2
PR libfortran/27107 * runtime/environ.c: Don't include io/io.h. * runtime/string.c: Don't include io/io.h. (compare0): Add cast to avoid warning. * runtime/error.c: Don't include io/io.h. (st_printf): Move to io/unix.c. * intrinsics/flush.c: Delete, contents moved to io/intrinsics.c. * intrinsics/fget.c: Likewise. * intrinsics/ftell.c: Likewise. * intrinsics/tty.c: Likewise. * libgfortran.h (DEFAULT_RECL, notification_std, get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR): New declarations. * io/io.h (DEFAULT_RECL, notification_std, get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR): Move to libgfortran.h. * io/unix.c: Add io/unix.h content. (st_printf): New function. * io/intrinsics.c: New file. * io/unix.h: Remove, contents moved into unix.c. * libtool-version: Update library version to 3.0.0. * configure.ac: Update library version to 0.3. * Makefile.am (intrinsics/fget.c, intrinsics/flush.c, intrinsics/ftell.c, intrinsics/tty.c, libgfortran.h): Remove targets. * Makefile.in: Regenerate. * configure: Regenerate. From-SVN: r120869
2006-11-25Makefile.am: Remove intrinsics/erf.c and intrinsics/bessel.c.Francois-Xavier Coudert1-2/+0
* Makefile.am: Remove intrinsics/erf.c and intrinsics/bessel.c. * Makefile.in: Regenerate. * intrinsics/erf.c: Remove. * intrinsics/bessel.c: Remove. * c99_protos.h: Add prototypes for bessel and error functions. * intrinsics/c99_functions.c: Move content for intrinsics/erf.c and intrinsics/bessel.c here. From-SVN: r119204
2006-10-09re PR fortran/15441 (RRSPACING broken for denormals)Steven G. Kargl1-2/+20
2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-08Makefile.am: Add intrinsics/move_alloc.c, ommited in Paul's previous commit.François-Xavier Coudert1-0/+1
* Makefile.am: Add intrinsics/move_alloc.c, ommited in Paul's previous commit. * Makefile.in: Regenerate. From-SVN: r117561
2006-10-08hyper.c: Remove file.Francois-Xavier Coudert1-1/+0
* intrinsics/hyper.c: Remove file. * intrinsics/c99_functions.c: Add fallback functions asinhf, acoshf and atanhf. * Makefile.am: Remove file intrinsics/hyper.c. * Makefile.in: Regenerate. From-SVN: r117560
2006-10-07re PR fortran/16580 ([4.1 only] gfortran ICE on test ↵François-Xavier Coudert1-2/+25
g77.f-torture/execute/intrinsic77.f) PR fortran/16580 PR fortran/29288 * gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a gfc_intrinsic_sym structure is filled. (gfc_intrinsic_actual_ok): New function. (add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s, add_sym_5s): Intrinsic subroutines are not allowed as actual arguments, so we remove argument actual_ok. (add_functions): Correct the values for actual_ok of all intrinsics. (add_subroutines): Remove the actual_ok argument, which was never used. * gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype. * gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype. * gcc/fortran/resolve.c (resolve_actual_arglist): Check whether an intrinsic used as an argument list is allowed there. * gcc/fortran/iresolve.c (gfc_resolve_index_func): New function. (gfc_resolve_len): Change intrinsic function name to agree with libgfortran. * gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add new case, because some specific intrinsics take 3 arguments. * gcc/fortran/intrinsic.texi: DIMAG is a GNU extension. * libgfortran/Makefile.am: Add the new files to the build process, and rules to build them. * libgfortran/Makefile.in: Regenerate. * libgfortran/m4/misc_specifics.m4: New file. * libgfortran/m4/specific.m4: Add new special cases for function with complex argument and real result, like abs_c* and aimag_c*. * libgfortran/intrinsics/f2c_specifics.F90: Add specifics for AIMAG, ASINH, ACOSH and ATANH. * libgfortran/generated/_aimag_c4.F90: New file. * libgfortran/generated/_aimag_c8.F90: New file. * libgfortran/generated/_asinh_r10.F90: New file. * libgfortran/generated/_acosh_r16.F90: New file. * libgfortran/generated/_aimag_c10.F90: New file. * libgfortran/generated/_atanh_r16.F90: New file. * libgfortran/generated/_acosh_r4.F90: New file. * libgfortran/generated/_acosh_r8.F90: New file. * libgfortran/generated/_asinh_r4.F90: New file. * libgfortran/generated/_asinh_r8.F90: New file. * libgfortran/generated/_asinh_r16.F90: New file. * libgfortran/generated/_atanh_r4.F90: New file. * libgfortran/generated/_atanh_r8.F90: New file. * libgfortran/generated/_acosh_r10.F90: New file. * libgfortran/generated/misc_specifics.F90: New file. * libgfortran/generated/_aimag_c16.F90: New file. * libgfortran/generated/_atanh_r10.F90: New file. * gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90: Add tests for using all possible intrinsics as actual arguments. * gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using all possible intrinsics as actual arguments. * gcc/testsuite/gfortran.dg/specifics_2.f90: New file. * gcc/testsuite/gfortran.dg/specifics_3.f90: New file. From-SVN: r117534
2006-10-05Makefile.am: Use $(M4) instead of m4.Steven G. Kargl1-28/+28
2006-10-05 Steven G. Kargl <kargl@gcc.gnu.org> * Makefile.am: Use $(M4) instead of m4. * Makefile.in: Regenerated. From-SVN: r117467
2006-09-28Makefile.am: Install libgfortranbegin inside compiler libraries directory ↵Francois-Xavier Coudert1-3/+3
instead of system... * Makefile.am: Install libgfortranbegin inside compiler libraries directory instead of system libraries directory. * Makefile.in: Regenerate. From-SVN: r117273
2006-09-24Makefile.am: Remove dependency on gfortypes.h.Francois-Xavier Coudert1-1/+0
* Makefile.am: Remove dependency on gfortypes.h. * Makefile.in: Regenerate. From-SVN: r117178
2006-08-01re PR libfortran/28452 (__gfortran_random_r10 not found)Thomas Koenig1-2/+1
2006-08-01 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/28542 * Makefile.am: Remove normalize.c. * aclocal.m4: Regenerate using aclocal 1.9.3. * Makefile.in: Regenerate using automake 1.9.3. * libgfortran.h: #include <float.h>. Define GFC_REAL_*_DIGITS and GFC_REAL_*_RADIX. Remove prototypes for normalize_r4_i4 and normalize_r8_i8. * intrinsics/random.c (top level): Add prototypes for random_r10, arandom_r10, random_r16 and arandom_r16. (rnumber_4): New static function. (rnumber_8): New static function. (rnumber_10): New static function. (rnumber_16): New static function. (top level): Set to kiss_size to 12 if we have REAL(KIND=16), to 8 otherwise. Define KISS_DEFAULT_SEED_1, KISS_DEFAULT_SEED_2 and KISS_DEFAULT_SEED_3. (kiss_random_kernel): Take argument to differentiate between different random number generators. (random_r4): Add argument to call to kiss_random_kernel, use rnumber_*. (random_r8): Likewise. (random_r10): New function. (random_r16): New function. (arandom_r4): Add argument to call to kiss_random_kernel, use_rnumber_*. (arandom_r8): Likewise. (arandom_r10): New function. (arandom_r16): New function. * intrinsics/rand.c (rand): Use shift and mask. * runtime/normalize.c: Remove. 2006-08-01 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/28542 * gfortran.dg/random_3.f90: New test. From-SVN: r115858
2006-07-30intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.Francois-Xavier Coudert1-0/+2
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT. (add_subroutines): Add LTIME, GMTIME and CHMOD. * intrinsic.h (gfc_check_access_func, gfc_check_chmod, gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift, gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod, gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub, gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes. * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS, GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT. * iresolve.c (gfc_resolve_access, gfc_resolve_chmod, gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub, gfc_resolve_gmtime, gfc_resolve_ltime): New functions. * check.c (gfc_check_access_func, gfc_check_chmod, gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions. * trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function. (gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*. * intrinsics/date_and_time.c: Add functions for GMTIME and LTIME. * intrinsics/access.c: New file. * intrinsics/chmod.c: New file. * configure.ac: Add checks for <sys/wait.h>, access, fork,execl and wait. * Makefile.am: Add new files intrinsics/access.c and intrinsics/chmod.c. * configure: Regenerate. * config.h.in: Regenerate. * Makefile.in: Regenerate. * gcc/testsuite/gfortran.dg/chmod_3.f90: New test. * gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test. * gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test. * gcc/testsuite/gfortran.dg/lrshift_1.f90: New test. * gcc/testsuite/gfortran.dg/chmod_1.f90: New test. * gcc/testsuite/gfortran.dg/chmod_2.f90: New test. From-SVN: r115825
2006-07-26intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and ↵François-Xavier Coudert1-0/+1
MCLOCK8 intrinsic functions. * intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions. (add_subroutines): Add LSTAT intrinsic subroutine. * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2, GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK and GFC_ISYM_MCLOCK8. * iresolve.c (gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions. * check.c (gfc_check_intconv): New function. * trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for the added GFC_ISYM_*. * simplify.c (gfc_simplify_intconv, gfc_simplify_int2, gfc_simplify_int8, gfc_simplify_long): New functions. * intrinsic.h (gfc_check_intconv, gfc_simplify_int2, gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub): Add prototypes. * gfortran.dg/mclock.f90: New test. * gfortran.dg/int_conv_1.f90: New test. * gfortran.dg/stat_1.f90: New test. * gfortran.dg/stat_2.f90: New test. * configure.ac: Check for function clock. * Makefile.am: Compile new file intrinsics/clock.c. * intrinsics/clock.c: New file. * Makefile.in: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * intrinsics/stat.c: Rename the old stat_i?_sub functions to helper functions stat_i?_sub_0, and use them for both STAT and LSTAT. From-SVN: r115754
2006-07-19re PR libfortran/27919 (dot_product should be removed from the library)Janne Blomqvist1-31/+2
2006-07-19 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/27919 * m4/dotprodc.m4: Remove. * m4/dotprodl.m4: Remove. * m4/dotprod.m4: Remove. * generated/dotprod_*.c: Remove. * Makefile.am: Remove any references to dot_product implementation. * Makefile.in: Regenerated. From-SVN: r115593
2006-06-24re PR fortran/28094 (Modulo of real(kind=10) variables doesn't work)Francois-Xavier Coudert1-5/+3
PR fortran/28094 * trans-intrinsic.c (gfc_conv_intrinsic_mod): Support cases where there is no integer kind equal to the resulting real kind. * intrinsic.c (add_functions): MODULO is not allowed as an actual argument. * Makefile.am: Add _mod_r10.F90 and _mod_r16.F90. * Makefile.in: Regenerate. * generated/_mod_r10.F90: New file. * generated/_mod_r16.F90: New file. From-SVN: r114961
2006-06-22re PR fortran/26769 (Implement transpose() and reshape() for real instead of ↵Francois-Xavier Coudert1-0/+4
using integer) PR libfortran/26769 * iresolve.c (gfc_resolve_reshape): Call reshape_r4 and reshape_r8 instead of reshape_4 and reshape_8. (gfc_resolve_transpose): Likewise for transpose. * Makefile.am: Add r4 and r8 versions of reshape and transpose. * Makefile.in: Regenerate. * generated/reshape_r4.c: New file. * generated/reshape_r8.c: New file. * generated/transpose_r4.c: New file. * generated/transpose_r8.c: New file. From-SVN: r114880
2006-05-24Makefile.am: Add install-html target.Carlos O'Donell1-0/+4
2006-05-24 Carlos O'Donell <carlos@codesourcery.com> * Makefile.am: Add install-html target. Add install-html to .PHONY * Makefile.in: Regenerate. * aclocal.m4: Regenerate. From-SVN: r114049
2006-04-22re PR fortran/26769 (Implement transpose() and reshape() for real instead of ↵Jakub Jelinek1-0/+2
using integer) PR fortran/26769 * iresolve.c (gfc_resolve_reshape): Use reshape_r16 for real(16). (gfc_resolve_transpose): Use transpose_r16 for real(16). * Makefile.am (i_transpose_c): Add generated/transpose_r16.c. (i_reshape_c): Add generated/reshape_r16.c. * Makefile.in: Regenerated. * generated/transpose_r16.c: Generated new file. * generated/redhape_r16.c: Generated new file. From-SVN: r113169
2006-03-25re PR fortran/26769 (Implement transpose() and reshape() for real instead of ↵Thomas Koenig1-0/+2
using integer) 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/26769 * iresolve.c (gfc_resolve_reshape): Remove doubling of kind for complex. For real(kind=10), call reshape_r10. (gfc_resolve_transpose): For real(kind=10), call transpose_r10. 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de> 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-25 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/26769 * gfortran.dg/transpose_reshape_r10.f90: New test case. From-SVN: r112381
2005-12-10Makefile.am: Enable loop unrolling for matmul.Janne Blomqvist1-2/+4
2005-12-10 Janne Blomqvist <jb@gcc.gnu.org> * Makefile.am: Enable loop unrolling for matmul. * configure: Regenerated. * Makefile.in: Regenerated. * aclocal.m4: Regenerated. From-SVN: r108359
2005-12-09re PR libfortran/24991 (gfortran build fails with - error:gthr-default.h: No ↵Jakub Jelinek1-1/+1
such file or directory) PR libfortran/24991 * acinclude.m4: Include acx.m4 and no-executables.m4. * configure.ac: Add GCC_TOPLEVEL_SUBDIRS. * configure: Rebuilt. * Makefile.am (AM_CPPFLAGS): Use $(host_subdir) in build dir path. * Makefile.in: Rebuilt. From-SVN: r108280
2005-11-21re PR fortran/14943 (read/write code generation is not thread safe)Jakub Jelinek1-1/+3
gcc/fortran/ PR fortran/14943 PR fortran/21647 * Make-lang.in (fortran/trans-io.o): Depend on fortran/ioparm.def. * dump-parse-tree.c (gfc_show_code_node): Dump c->block for EXEC_{READ,WRITE,IOLENGTH} nodes. * io.c (terminate_io, match_io, gfc_match_inquire): Put data transfer commands into EXEC_{READ,WRITE,IOLENGTH}'s code->block. * resolve.c (resolve_blocks): Handle EXEC_{READ,WRITE,IOLENGTH}. * trans-io.c (ioparm_unit, ioparm_err, ioparm_end, ioparm_eor, ioparm_list_format, ioparm_library_return, ioparm_iostat, ioparm_exist, ioparm_opened, ioparm_number, ioparm_named, ioparm_rec, ioparm_nextrec, ioparm_size, ioparm_recl_in, ioparm_recl_out, ioparm_iolength, ioparm_file, ioparm_file_len, ioparm_status, ioparm_status_len, ioparm_access, ioparm_access_len, ioparm_form, ioparm_form_len, ioparm_blank, ioparm_blank_len, ioparm_position, ioparm_position_len, ioparm_action, ioparm_action_len, ioparm_delim, ioparm_delim_len, ioparm_pad, ioparm_pad_len, ioparm_format, ioparm_format_len, ioparm_advance, ioparm_advance_len, ioparm_name, ioparm_name_len, ioparm_internal_unit, ioparm_internal_unit_len, ioparm_internal_unit_desc, ioparm_sequential, ioparm_sequential_len, ioparm_direct, ioparm_direct_len, ioparm_formatted, ioparm_formatted_len, ioparm_unformatted, ioparm_unformatted_len, ioparm_read, ioparm_read_len, ioparm_write, ioparm_write_len, ioparm_readwrite, ioparm_readwrite_len, ioparm_namelist_name, ioparm_namelist_name_len, ioparm_namelist_read_mode, ioparm_iomsg, ioparm_iomsg_len, ioparm_var): Remove. (enum ioparam_type, enum iofield_type, enum iofield, enum iocall): New enums. (gfc_st_parameter_field, gfc_st_parameter): New typedefs. (st_parameter, st_parameter_field, iocall): New variables. (ADD_FIELD, ADD_STRING): Remove. (dt_parm, dt_post_end_block): New variables. (gfc_build_st_parameter): New function. (gfc_build_io_library_fndecls): Use it. Initialize iocall array rather than ioparm_*, add extra first arguments to the function types. (set_parameter_const): New function. (set_parameter_value): Add type argument, return a bitmask. Changed to set a field in automatic structure variable rather than set a field in a global _gfortran_ioparm variable. (set_parameter_ref): Likewise. If requested var has different size than what field should point to, call with a temporary and then copy into the user variable. Add postblock argument. (set_string): Remove var_len argument, add type argument, return a bitmask. Changed to set fields in automatic structure variable rather than set a field in a global _gfortran_ioparm variable. (set_internal_unit): Remove iunit, iunit_len, iunit_desc arguments, add var argument. Return a bitmask. Changed to set fields in automatic structure variable rather than set a field in a global _gfortran_ioparm variable. (set_flag): Removed. (io_result): Add var argument. Changed to read common.flags field from automatic structure variable and bitwise AND it with 3. (set_error_locus): Add var argument. Changed to set fields in automatic structure variable rather than set a field in a global _gfortran_{filename,line} variables. (gfc_trans_open): Use gfc_start_block rather than gfc_init_block. Create a temporary st_parameter_* structure. Adjust callers of all above mentioned functions. Pass address of the temporary variable as first argument to the generated function call. Use iocall array rather than ioparm_* separate variables. (gfc_trans_close, build_filepos, gfc_trans_inquire): Likewise. (build_dt): Likewise. Change first argument to tree from tree *. Don't dereference code->ext.dt if last_dt == INQUIRE. Emit IOLENGTH argument setup here. Set dt_parm/dt_post_end_block variables and gfc_trans_code the nested data transfer commands in code->block. (gfc_trans_iolength): Just set last_dt and call build_dt immediately. (transfer_namelist_element): Pass address of dt_parm variable to generated functions. Use iocall array rather than ioparm_* separate variables. (gfc_trans_backspace, gfc_trans_endfile, gfc_trans_rewind, gfc_trans_flush, gfc_trans_read, gfc_trans_write): Use iocall array rather than ioparm_* separate variables. (gfc_trans_dt_end): Likewise. Pass address of dt_parm variable as first argument to generated function. Adjust io_result caller. Prepend dt_post_end_block before io_result code. (transfer_expr): Use iocall array rather than ioparm_* separate variables. Pass address of dt_parm variables as first argument to generated functions. * ioparm.def: New file. gcc/testsuite/ PR fortran/24774 * gfortran.dg/inquire_9.f90: New test. PR fortran/21647 * gfortran.fortran-torture/execute/inquire_5.f90: New test. libgfortran/ PR fortran/24774 PR fortran/14943 PR fortran/21647 * Makefile.am (AM_CPPFLAGS): Add gcc directories as -I paths, add -D_GNU_SOURCE. * Makefile.in: Regenerated. * acinclude.m4 (LIBGFOR_CHECK_SYNC_FETCH_AND_ADD, LIBGFOR_CHECK_GTHR_DEFAULT, LIBGFOR_CHECK_PRAGMA_WEAK): New macros. * configure.ac: Add them. * configure: Rebuilt. * config.h.in: Rebuilt. * libtool-version: Bump libgfortran.so SONAME to libgfortran.so.1. * libgfortran.h (library_start, show_locus, internal_error, generate_error, find_option): Add st_parameter_common * argument. (library_end): Change into a dummy macro. * io/io.h: Include gthr.h. (SUPPORTS_WEAK): Define if HAVE_PRAGMA_WEAK. (CHARACTER): Remove define. (st_parameter, global_t): Remove typedef. (ioparm, g, ionml, current_unit): Remove variables. (init_error_stream): Remove prototype. (CHARACTER1, CHARACTER2): Define. (st_parameter_common, st_parameter_open, st_parameter_close, st_parameter_filepos, st_parameter_inquire, st_parameter_dt): New typedefs. (IOPARM_LIBRETURN_MASK, IOPARM_LIBRETURN_OK, IOPARM_LIBRETURN_ERROR, IOPARM_LIBRETURN_END, IOPARM_LIBRETURN_EOR, IOPARM_ERR, IOPARM_END, IOPARM_EOR, IOPARM_HAS_IOSTAT, IOPARM_HAS_IOMSG, IOPARM_COMMON_MASK, IOPARM_OPEN_HAS_RECL_IN, IOPARM_OPEN_HAS_FILE, IOPARM_OPEN_HAS_STATUS, IOPARM_OPEN_HAS_ACCESS, IOPARM_OPEN_HAS_FORM, IOPARM_OPEN_HAS_BLANK, IOPARM_OPEN_HAS_POSITION, IOPARM_OPEN_HAS_ACTION, IOPARM_OPEN_HAS_DELIM, IOPARM_OPEN_HAS_PAD, IOPARM_CLOSE_HAS_STATUS, IOPARM_INQUIRE_HAS_EXIST, IOPARM_INQUIRE_HAS_OPENED, IOPARM_INQUIRE_HAS_NUMBER, IOPARM_INQUIRE_HAS_NAMED, IOPARM_INQUIRE_HAS_NEXTREC, IOPARM_INQUIRE_HAS_RECL_OUT, IOPARM_INQUIRE_HAS_FILE, IOPARM_INQUIRE_HAS_ACCESS, IOPARM_INQUIRE_HAS_FORM, IOPARM_INQUIRE_HAS_BLANK, IOPARM_INQUIRE_HAS_POSITION, IOPARM_INQUIRE_HAS_ACTION, IOPARM_INQUIRE_HAS_DELIM, IOPARM_INQUIRE_HAS_PAD, IOPARM_INQUIRE_HAS_NAME, IOPARM_INQUIRE_HAS_SEQUENTIAL, IOPARM_INQUIRE_HAS_DIRECT, IOPARM_INQUIRE_HAS_FORMATTED, IOPARM_INQUIRE_HAS_UNFORMATTED, IOPARM_INQUIRE_HAS_READ, IOPARM_INQUIRE_HAS_WRITE, IOPARM_INQUIRE_HAS_READWRITE, IOPARM_DT_LIST_FORMAT, IOPARM_DT_NAMELIST_READ_MODE, IOPARM_DT_HAS_REC, IOPARM_DT_HAS_SIZE, IOPARM_DT_HAS_IOLENGTH, IOPARM_DT_HAS_FORMAT, IOPARM_DT_HAS_ADVANCE, IOPARM_DT_HAS_INTERNAL_UNIT, IOPARM_DT_HAS_NAMELIST_NAME, IOPARM_DT_IONML_SET): Define. (gfc_unit): Add lock, waiting and close fields. Change file from flexible array member into pointer to char. (open_external): Add st_parameter_open * argument. (find_file, file_exists): Add file and file_len arguments. (flush_all_units): New prototype. (max_offset, unit_root, unit_lock): New variable. (is_internal_unit, is_array_io, next_array_record, parse_format, next_format, unget_format, format_error, read_block, write_block, next_record, convert_real, read_a, read_f, read_l, read_x, read_radix, read_decimal, list_formatted_read, finish_list_read, namelist_read, namelist_write, write_a, write_b, write_d, write_e, write_en, write_es, write_f, write_i, write_l, write_o, write_x, write_z, list_formatted_write, get_unit): Add st_parameter_dt * argument. (insert_unit): Remove prototype. (find_or_create_unit, unlock_unit): New prototype. (new_unit): Return gfc_unit *. Add st_parameter_open * and gfc_unit * arguments. (free_fnodes): Remove prototype. (free_format_data): New prototype. (scratch): Remove. (init_at_eol): Remove prototype. (free_ionml): New prototype. (inc_waiting_locked, predec_waiting_locked, dec_waiting_unlocked): New inline functions. * io/unit.c (max_offset, unit_root, unit_lock): New variables. (insert): Adjust os_error caller. (insert_unit): Made static. Allocate memory here, initialize lock and after inserting it return it, locked. (delete_unit): Adjust for deletion of g. (find_unit_1): New function. (find_unit): Use it. (find_or_create_unit): New function. (get_unit): Add dtp argument, change meaning of the int argument as creation request flag. Adjust for different st_* calling conventions, lock internal unit's lock before returning it and removal of g. Call find_unit_1 instead of find_unit. (is_internal_unit, is_array_io): Add dtp argument, adjust for removal of most of global variables. (init_units): Initialize unit_lock. Adjust insert_unit callers and adjust for g removal. (close_unit_1): New function. (close_unit): Use it. (unlock_unit): New function. (close_units): Lock unit_lock, use close_unit_1 rather than close_unit. * io/close.c (st_close): Add clp argument. Adjust for new st_* calling conventions and internal function API changes. * io/file_pos.c (st_backspace, st_endfile, st_rewind, st_flush): Add fpp argument. Adjust for new st_* calling conventions and internal function API changes. (formatted_backspace, unformatted_backspace): Likewise. Add u argument. * io/open.c (edit_modes, st_open): Add opp argument. Adjust for new st_* calling conventions and internal function API changes. (already_open): Likewise. If not HAVE_UNLINK_OPEN_FILE, unlink scratch file. Instead of calling close_unit just call sclose, free u->file if any and clear a few u fields before calling new_unit. (new_unit): Return gfc_unit *. Add opp and u arguments. Adjust for new st_* calling conventions and internal function API changes. Don't allocate unit here, rather than work with already created unit u already locked on entry. In case of failure, close_unit it. * io/unix.c: Include unix.h. (BUFFER_SIZE, unix_stream): Moved to unix.h. (unit_to_fd): Add unlock_unit call. (tempfile): Add opp argument, use its fields rather than ioparm. (regular_file): Likewise. (open_external): Likewise. Only unlink file if fd >= 0. (init_error_stream): Add error argument, set structure it points to rather than filling static variable and returning its address. (FIND_FILE0_DECL, FIND_FILE0_ARGS): Define. (find_file0): Use them. Don't crash if u->s == NULL. (find_file): Add file and file_len arguments, use them instead of ioparm. Add locking. Pass either an array of 2 struct stat or file and file_len pair to find_file0. (flush_all_units_1, flush_all_units): New functions. (file_exists): Add file and file_len arguments, use them instead of ioparm. * io/unix.h: New file. * io/lock.c (ioparm, g, ionml): Remove variables. (library_start): Add cmp argument, adjust for new st_* calling conventions. (library_end): Remove. (free_ionml): New function. * io/inquire.c (inquire_via_unit, inquire_via_filename, st_inquire): Add iqp argument, adjust for new st_* calling conventions and internal function API changes. * io/format.c (FARRAY_SIZE): Decrease to 64. (fnode_array, format_data): New typedefs. (avail, array, format_string, string, error, saved_token, value, format_string_len, reversion_ok, saved_format): Remove variables. (colon_node): Add const. (free_fnode, free_fnodes): Remove. (free_format_data): New function. (next_char, unget_char, get_fnode, format_lex, parse_format_list, format_error, parse_format, revert, unget_format, next_test): Add fmt or dtp arguments, pass it all around, adjust for internal function API changes and adjust for removal of global variables. (next_format): Likewise. Constify return type. (next_format0): Constify return type. * io/transfer.c (current_unit, sf_seen_eor, eor_condition, max_pos, skips, pending_spaces, scratch, line_buffer, advance_status, transfer): Remove variables. (transfer_integer, transfer_real, transfer_logical, transfer_character, transfer_complex, transfer_array, current_mode, read_sf, read_block, read_block_direct, write_block, write_block_direct, unformatted_read, unformatted_write, type_name, write_constant_string, require_type, formatted_transfer_scalar, us_read, us_write, pre_position, data_transfer_init, next_record_r, next_record_w, next_record, finalize_transfer, iolength_transfer, iolength_transfer_init, st_iolength, st_iolength_done, st_read, st_read_done, st_write, st_write_done, st_set_nml_var, st_set_nml_var_dim, next_array_record): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. * io/list_read.c (repeat_count, saved_length, saved_used, input_complete, at_eol, comma_flag, last_char, saved_string, saved_type, namelist_mode, nml_read_error, value, parse_err_msg, nml_err_msg, prev_nl): Remove variables. (push_char, free_saved, next_char, unget_char, eat_spaces, eat_separator, finish_separator, nml_bad_return, convert_integer, parse_repeat, read_logical, read_integer, read_character, parse_real, read_complex, read_real, check_type, list_formatted_read_scalar, list_formatted_read, finish_list_read, find_nml_node, nml_untouch_nodes, nml_match_name, nml_query, namelist_read): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. (nml_parse_qualifier): Likewise. Add parse_err_msg argument. (nml_read_obj): Likewise. Add pprev_nl, nml_err_msg, clow and chigh arguments. (nml_get_obj_data): Likewise. Add pprev_nl and nml_err_msg arguments. (init_at_eol): Removed. * io/read.c (convert_real, read_l, read_a, next_char, read_decimal, read_radix, read_f, read_x): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. (set_integer): Adjust internal_error caller. * io/write.c (no_leading_blank, nml_delim): Remove variables. (write_a, calculate_sign, calculate_G_format, output_float, write_l, write_float, write_int, write_decimal, write_i, write_b, write_o, write_z, write_d, write_e, write_f, write_en, write_es, write_x, write_char, write_logical, write_integer, write_character, write_real, write_complex, write_separator, list_formatted_write_scalar, list_formatted_write, nml_write_obj, namelist_write): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. (extract_int, extract_uint, extract_real): Adjust internal_error callers. * runtime/fpu.c (_GNU_SOURCE): Don't define here. * runtime/error.c: Include ../io/unix.h. (filename, line): Remove variables. (st_printf): Pass address of a local variable to init_error_stream. (show_locus): Add cmp argument. Use fields it points to rather than filename and line variables. (os_error, runtime_error): Remove show_locus calls. (internal_error): Add cmp argument. Pass it down to show_locus. (generate_error): Likewise. Use flags bitmask instead of non-NULL check for iostat and iomsg parameter presence, adjust for st_* calling convention changes. * runtime/stop.c (stop_numeric, stop_string): Remove show_locus calls. * runtime/pause.c (pause_numeric, pause_string): Likewise. * runtime/string.c: Include ../io/io.h. (find_option): Add cmp argument. Pass it down to generate_error. * intrinsics/flush.c (recursive_flush): Remove. (flush_i4, flush_i8): Use flush_all_units. Add unlock_unit call. * intrinsics/rand.c: Include ../io/io.h. (rand_seed_lock): New variable. (srand, irand): Add locking. (init): New constructor function. * intrinsics/random.c: Include ../io/io.h. (random_lock): New variable. (random_r4, random_r8, arandom_r4, arandom_r8): Add locking. (random_seed): Likewise. open failed if fd < 0. Set i correctly. (init): New constructor function. * intrinsics/system_clock.c (tp0, t0): Remove. (system_clock_4, system_clock_8): Don't subtract tp0/t0 from current time, use just integer arithmetics. * intrinsics/tty.c (isatty_l4, isatty_l8, ttynam_sub): Add unlock_unit calls. From-SVN: r107328
2005-11-20Makefile.am: Revert 2005-11-14 change.Richard Henderson1-7/+4
* Makefile.am: Revert 2005-11-14 change. Enable -free-vectorize via gmake per-target variables. * Makefile.in, aclocal.m4: Regenerate. From-SVN: r107261
2005-11-14re PR libfortran/21468 (vectorizing libfortran)Janne Blomqvist1-2/+8
2005-11-14 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/21468 * Makefile.am: Add -ftree-vectorize for compiling matmul. * m4/matmul.m4: Add const and restrict to type declarations as appropriate. * m4/matmull.m4: Likewise. * Makefile.in: Regenerated. * generated/matmul_*.c: Likewise. From-SVN: r106898
2005-11-13fget.c: New file.Francois-Xavier Coudert1-0/+2
* intrinsics/fget.c: New file. * intrinsics/ftell.c: New file. * io/unix.c (stream_offset): New function. * io/io.h: Add prototype for stream_offset. * Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c. * Makefile.in: Regenerate. * intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET, FPUTC, FPUT, AND, XOR and OR intrinsic functions. (add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic subroutines. * gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR, GFC_ISYM_XOR. * iresolve.c (gfc_resolve_and, gfc_resolve_complex, gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget, gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell, gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub, gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub): New functions. * check.c (gfc_check_complex, gfc_check_fgetputc_sub, gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput, gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions. * simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or, gfc_simplify_xor): New functions. * trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and GFC_ISYM_XOR. * intrinsic.h: Add prototypes for all functions added to iresolve.c, simplify.c and check.c. * gfortran.dg/complex_intrinsic_1.f90: New test. * gfortran.dg/complex_intrinsic_2.f90: New test. * gfortran.dg/fgetc_1.f90: New test. * gfortran.dg/fgetc_2.f90: New test. * gfortran.dg/fgetc_3.f90: New test. * gfortran.dg/ftell_1.f90: New test. * gfortran.dg/ftell_2.f90: New test. * gfortran.dg/gnu_logical_1.F: New test. * gfortran.dg/gnu_logical_2.f90: New test. From-SVN: r106859
2005-11-06gfortran ChangeLogJanne Blomqvist1-0/+1
2005-11-06 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/24174 PR fortran/24305 * fortran/trans-io.c (gfc_build_io_library_fndecls): Add kind argument to transfer_array. (transfer_array_desc): Add kind argument. testsuite ChangeLog: 2005-11-06 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/24174 PR fortran/24305 * testsuite/gfortran.dg/large_real_kind_form_io_1.f90: New file. libgfortran Changelog: 2005-11-06 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/24174 PR fortran/24305 * io/io.h: Add argument to prototypes, add prototypes for size_from_*_kind functions. * io/list_read.c (read_complex): Add size argument, use it. (list_formatted_read): Add size argument, cleanup. (list_formatted_read_scalar): Add size argument. (nml_read_obj): Fix for padding. * io/transfer.c: Add argument to transfer function pointer. (unformatted_read): Add size argument. (unformatted_write): Likewise. (formatted_transfer_scalar): Fix for padding with complex(10). (formatted_transfer): Add size argument, cleanup. (transfer_integer): Add size argument to transfer call. (transfer_real): Likewise. (transfer_logical): Likewise. (transfer_character): Likewise. (transfer_complex): Likewise. (transfer_array): New kind argument, use it. (data_transfer_init): Add size argument to formatted_transfer call. (iolength_transfer): Add size argument, cleanup. * io/write.c (write_complex): Add size argument, fix for padding with complex(10). (list_formatted_write): Add size argument, cleanup. (list_formatted_write_scalar): Add size argument, use it. (nml_write_obj): Fix for size vs. kind issue. * io/size_from_kind.c: New file. * Makefile.am: Add io/size_from_kind.c. * configure: Regenerate. * Makefile.in: Regenerate. From-SVN: r106563