aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-21check.c (gfc_check_present): Allow coarrays.Tobias Burnus1-1/+3
2011-07-21 Tobias Burnus <burnus@net-b.de> * check.c (gfc_check_present): Allow coarrays. * trans-array.c (gfc_conv_array_ref): Avoid casting when a pointer is wanted. * trans-decl.c (create_function_arglist): For -fcoarray=lib, handle hidden token and offset arguments for nondescriptor coarrays. * trans-expr.c (get_tree_for_caf_expr): New function. (gfc_conv_procedure_call): For -fcoarray=lib pass the token and offset for nondescriptor coarray dummies. * trans.h (lang_type): Add caf_offset tree. (GFC_TYPE_ARRAY_CAF_OFFSET): New macro. 2011-07-21 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_lib_token_1.f90: New. From-SVN: r176562
2011-06-20re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-2/+2
2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_check_vardef_context): Update prototype. (iso_fortran_env_symbol): Handle derived types. (symbol_attribute): Add lock_comp. * expr.c (gfc_check_vardef_context): Add LOCK_TYPE check. * interface.c (compare_parameter, gfc_procedure_use): Handle LOCK_TYPE. (compare_actual_formal): Update gfc_check_vardef_context call. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. * iso-fortran-env.def (ISOFORTRAN_LOCK_TYPE): Add. * intrinsic.texi (ISO_FORTRAN_ENV): Document LOCK_TYPE. * module.c (mio_symbol_attribute): Handle lock_comp. (create_derived_type): New function. (use_iso_fortran_env_module): Call it to handle LOCK_TYPE. * parse.c (parse_derived): Add constraint check for LOCK_TYPE. * resolve.c (resolve_symbol, resolve_lock_unlock): Add * constraint checks for LOCK_TYPE. (gfc_resolve_iterator, resolve_deallocate_expr, resolve_allocate_expr, resolve_code, resolve_transfer): Update gfc_check_vardef_context call. * trans-stmt.h (gfc_trans_lock_unlock): New prototype. * trans-stmt.c (gfc_trans_lock_unlock): New function. * trans.c (trans_code): Handle LOCK and UNLOCK. 2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_lock_1.f90: Update dg-error. * gfortran.dg/coarray_lock_3.f90: New. * gfortran.dg/coarray/lock_1.f90: New. From-SVN: r175228
2011-06-17re PR fortran/48699 ([OOP] MOVE_ALLOC inside SELECT TYPE)Janus Weil1-0/+4
2011-06-17 Janus Weil <janus@gcc.gnu.org> PR fortran/48699 * check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic, make sure the vtab is present. 2011-06-17 Janus Weil <janus@gcc.gnu.org> PR fortran/48699 * gfortran.dg/move_alloc_5.f90: New. From-SVN: r175151
2011-05-31re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+66
2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * intrinsic.c (klass): Add CLASS_ATOMIC. (add_subroutines): Add atomic_ref/atomic_define. * intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document. * intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref, gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes. * gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF and GFC_ISYM_ATOMIC_REF. (gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars. * iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref): * New functions. * check.c (gfc_check_atomic, gfc_check_atomic_def, gfc_check_atomic_ref): New functions. * iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND, ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value. * trans-intrinsic.c (conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New functions. (conv_intrinsic_move_alloc) Renamed from gfc_conv_intrinsic_move_alloc - and made static. * trans.h (gfc_conv_intrinsic_move_alloc): Remove. (gfc_conv_intrinsic_subroutine) Add prototype. * trans.c (trans_code): Call gfc_conv_intrinsic_subroutine. From-SVN: r174510
2011-05-27re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+27
2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * check.c (gfc_check_associated, gfc_check_null): Add coindexed * check. * match.c (gfc_match_nullify): Ditto. * resolve.c (resolve_deallocate_expr): Ditto. * trans-types.c (gfc_get_nodesc_array_type): Don't set * restricted for nonpointers. 2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_22.f90: New. From-SVN: r174364
2011-05-27re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus1-0/+27
2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.h (gfc_isym_id): Add GFC_ISYM_RANK. * intrinsic.c (add_functions): Add rank intrinsic. (gfc_check_intrinsic_standard): Handle GFC_STD_F2008_TR. * intrinsic.h (gfc_simplify_rank, gfc_check_rank): Add * prototypes. * simplify.c (gfc_simplify_rank): New function. * intrinsic.texi (RANK): Add description for rank intrinsic. * check.c (gfc_check_rank): New function. 2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/rank_3.f90: New. * gfortran.dg/rank_4.f90: New. From-SVN: r174348
2011-04-18re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-0/+17
2011-04-18 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * array.c (gfc_match_array_ref): Check for too many * codimensions. * check.c (gfc_check_image_index): Check number of elements in SUB argument. * simplify.c (gfc_simplify_image_index): Remove unreachable * checks. 2011-04-18 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_17.f90: New. * gfortran.dg/coarray_10.f90: Update dg-error. From-SVN: r172658
2011-04-04re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-2/+8
2011-04-04 Tobias Burnus <burnus@net-b.de> Mikael Morin <mikael.morin@sfr.fr> PR fortran/18918 * check.c (is_coarray): Update - because of DIMEN_THIS_IMAGE. * expr.c (gfc_is_coindexed): Ditto. * gfortran.h (gfc_array_ref_dimen_type): Add DIMEN_THIS_IMAGE. * interface.c (compare_parameter): Use gfc_expr_attr and gfc_is_coindexed. * resolve.c (check_dimension, compare_spec_to_ref, resolve_allocate_expr, check_data_variable): Update for DIMEN_THIS_IMAGE. * simplify.c (gfc_simplify_lcobound, gfc_simplify_this_image, gfc_simplify_ucobound): Allow non-constant bounds. * trans-array.c (gfc_set_loop_bounds_from_array_spec, gfc_trans_create_temp_array, gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds, gfc_conv_array_index_offset, gfc_start_scalarized_body, gfc_trans_scalarizing_loops, gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride, gfc_conv_ss_startstride, gfc_conv_loop_setup, gfc_trans_array_bounds, gfc_conv_expr_descriptor, gfc_walk_variable_expr): Handle codimen. * trans-decl.c (gfc_build_qualified_array): Save cobounds. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use arg2. (conv_intrinsic_cobound): New function. (gfc_conv_intrinsic_function): Call it. (gfc_walk_intrinsic_function, gfc_add_intrinsic_ss_code): Handle ucobound, lcobound, this_image. * fortran/trans-types.c (gfc_build_array_type): Save cobounds. (gfc_get_dtype): Honour corank. (gfc_get_nodesc_array_type): Save corank and codimensions. (gfc_get_array_type_bounds): Save cobound. * fortran/trans.h (gfc_ss_info,gfc_loopinfo): Add codimen item. (gfc_array_kind): Add corank item. (GFC_TYPE_ARRAY_CORANK): New macro. 2011-04-04 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_10.f90: Add coarray descriptor diagnostic check. * gfortran.dg/coarray_13.f90: Add checks for run-time cobounds. * gfortran.dg/coarray_15.f90: New. Co-Authored-By: Mikael Morin <mikael.morin@sfr.fr> From-SVN: r171949
2011-01-29re PR fortran/47531 (SHAPE misses KIND= support)Tobias Burnus1-1/+8
2011-01-29 Tobias Burnus <burnus@net-b.de> PR fortran/47531 * check.c (gfc_check_shape): Support kind argument in SHAPE. * intrinsic.c (add_functions): Ditto. * resolve.c (gfc_resolve_shape): Ditto. * simplify.c (gfc_simplify_shape): Ditto. * intrinsic.h (gfc_check_shape, gfc_resolve_shape, gfc_simplify_shape): Update prototypes. * intrinisc.text (SHAPE): Document kind argument. 2011-01-29 Tobias Burnus <burnus@net-b.de> PR fortran/47531 * gfortran.dg/shape_6.f90: New. From-SVN: r169392
2010-12-24re PR fortran/31821 (character pointer => target(range) should detect if ↵Thomas Koenig1-24/+53
lengths don't match) 2010-12-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/31821 * check.c (gfc_var_strlen): New function, also including substring references. (gfc_check_same_strlen): Use gfc_var_strlen. 2010-12-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/31821 * gfortran.dg/char_pointer_assign_6.f90: New test. From-SVN: r168224
2010-12-09check.c (gfc_check_sngl): Insert missing space in error message.Steven G. Kargl1-1/+1
2010-12-09 Steven G. Kargl <kargl@gcc.gnu.org> * check.c (gfc_check_sngl): Insert missing space in error message. From-SVN: r167645
2010-12-09check.c (gfc_check_float): Insert missing space in error message.Steven G. Kargl1-1/+1
2010-12-09 Steven G. Kargl <kargl@gcc.gnu.org> * check.c (gfc_check_float): Insert missing space in error message. From-SVN: r167643
2010-11-15re PR fortran/46484 (Should reject ALLOCATED(non-variable expression ))Tobias Burnus1-27/+32
2010-11-15 Tobias Burnus <burnus@net.b.de> PR fortran/46484 * check.c (variable_check): Don't treat functions calls as * variables; optionally accept function themselves. (gfc_check_all_any, gfc_check_loc, gfc_check_move_alloc, gfc_check_null, gfc_check_present, gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits, gfc_check_random_number, gfc_check_random_seed, gfc_check_system_clock, gfc_check_dtime_etime, gfc_check_dtime_etime_sub, gfc_check_itime_idate,gfc_check_ltime_gmtime): Update call. 2010-11-15 Tobias Burnus <burnus@net.b.de> PR fortran/46484 * gfortran.dg/allocatable_scalar_11.f90: New. * gfortran.dg/allocatable_scalar_5.f90: Make test case standard * conform. From-SVN: r166769
2010-09-08re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)Francois-Xavier Coudert1-7/+150
PR fortran/38282 * intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R}, MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}. * gfortran.h: Define ISYM values for above intrinsics. * intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift, gfc_check_mask, gfc_check_merge_bits, gfc_check_shift, gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble, gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr, gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr, gfc_simplify_merge_bits, gfc_simplify_rshift, gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr, gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits, gfc_resolve_shift): New prototypes. * iresolve.c (gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits, gfc_resolve_shift): New functions. * check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift, gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New functions. * trans-intrinsic.c (gfc_conv_intrinsic_dshift, gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift, gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New functions. (gfc_conv_intrinsic_function): Call above static functions. * intrinsic.texi: Document new intrinsics. * simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble, gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr, gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr, gfc_simplify_merge_bits, gfc_simplify_rshift, gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr): New functions. * gfortran.dg/bit_comparison_1.F90: New test. * gfortran.dg/leadz_trailz_3.f90: New test. * gfortran.dg/masklr_2.F90: New test. * gfortran.dg/shiftalr_1.F90: New test. * gfortran.dg/merge_bits_2.F90: New test. * gfortran.dg/dshift_2.F90: New test. * gfortran.dg/bit_comparison_2.F90: New test. * gfortran.dg/masklr_1.F90: New test. * gfortran.dg/merge_bits_1.F90: New test. * gfortran.dg/dshift_1.F90: New test. * gfortran.dg/shiftalr_2.F90: New test. From-SVN: r164021
2010-09-06re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)Tobias Burnus1-0/+20
2010-09-06 Tobias Burnus <burnus@net-b.de> PR fortran/38282 * intrinsic.c (add_functions): Support IALL, IANY, IPARITY. (check_specific): Special case for those intrinsics. * gfortran.h (gfc_isym_id): Add new intrinsics * intrinsic.h (gfc_check_transf_bit_intrins, gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity, gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity): New prototypes. * iresolve.c (gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity, resolve_transformational): New functions. (gfc_resolve_product, gfc_resolve_sum, gfc_resolve_parity): Use resolve_transformational. * check.c (gfc_check_transf_bit_intrins): New function. * simplify.c (gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity, do_bit_any, do_bit_ior, do_bit_xor, simplify_transformation): New functions. (gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity, gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation. * trans-intrinsic.c (gfc_conv_intrinsic_arith, gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall): Handle IALL, IANY and IPARITY intrinsics. * intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic order. (IALL, IANY, IPARITY): Document new intrinsics. 2010-09-06 Tobias Burnus <burnus@net-b.de> PR fortran/38282 * gfortran.dg/iall_iany_iparity_1.f90: New. * gfortran.dg/iall_iany_iparity_2.f90: New. 2010-09-06 Tobias Burnus <burnus@net-b.de> PR fortran/38282 * gfortran.map: Add new iany, iall and iparity intrinsics. * Makefile.am: Ditto. * m4/iany.m4: New. * m4/iall.m4: New. * m4/iparity.m4: New. * Makefile.in: Regenerate. * generated/iall_i1.c: Generate. * generated/iall_i2.c: Generate. * generated/iall_i4.c: Generate. * generated/iall_i8.c: Generate. * generated/iall_i16.c: Generate. * generated/iany_i1.c: Generate. * generated/iany_i2.c: Generate. * generated/iany_i4.c: Generate. * generated/iany_i8.c: Generate. * generated/iany_i16.c: Generate. * generated/iparity_i1.c: Generate. * generated/iparity_i2.c: Generate. * generated/iparity_i4.c: Generate. * generated/iparity_i8.c: Generate. * generated/iparity_i16.c: Generate. From-SVN: r163898
2010-08-27re PR fortran/33197 (Fortran 2008: math functions)Tobias Burnus1-0/+31
gcc/fortran/ 2010-08-27 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity. * gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity): gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2, gfc_resolve_parity): New prototypes. * gcc/fortran/gfortran.h (gfc_isym_id): New enum items GFC_ISYM_NORM2 and GFC_ISYM_PARITY. * gcc/fortran/iresolve.c (gfc_resolve_norm2, gfc_resolve_parity): New functions. * gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity): New functions. * gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith, gfc_conv_intrinsic_function): Handle NORM2 and PARITY. * gcc/fortran/intrinsic.texi (NORM2, PARITY): Add. * gcc/fortran/simplify.c (simplify_transformation_to_array): Add post-processing opterator. (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count, gfc_simplify_product, gfc_simplify_sum): Update call. (add_squared, do_sqrt, gfc_simplify_norm2, do_xor, gfc_simplify_parity): New functions. gcc/testsuite/ 2010-08-27 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * gcc/testsuite/gfortran.dg/norm2_1.f90: New. * gcc/testsuite/gfortran.dg/norm2_2.f90: New. * gcc/testsuite/gfortran.dg/norm2_3.f90: New. * gcc/testsuite/gfortran.dg/norm2_4.f90: New. * gcc/testsuite/gfortran.dg/parity_1.f90: New. * gcc/testsuite/gfortran.dg/parity_2.f90: New. * gcc/testsuite/gfortran.dg/parity_3.f90: New. libgfortran/ 2010-08-27 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION, ARRAY_FUNCTION): Allow expression after loop. * libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}. * libgfortran/m4/parity.m4: New for * _gfortran_parity_l{1,2,4,8,16}. * libgfortran/gfortran.map: Add new functions. * libgfortran/Makefile.am: Ditto. * libgfortran/m4/minloc1.m4: Add empty argument for * ARRAY_FUNCTION. * libgfortran/m4/maxloc1.m4: Ditto. * libgfortran/m4/all.m4: Ditto. * libgfortran/m4/minval.m4: Ditto. * libgfortran/m4/maxval.m4: Ditto. * libgfortran/m4/count.m4: Ditto. * libgfortran/m4/product.m4: Ditto. * libgfortran/m4/any.m4: Ditto. * Makefile.in: Regenerated. * generated/minval_r8.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/any_l16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/any_l2.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/all_l1.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/all_l2.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/all_l16.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/any_l4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/count_4_l.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/count_8_l.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/all_l4.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/count_1_l.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/sum_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/count_16_l.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/any_l8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/count_2_l.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/any_l1.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/all_l8.c: Regenerated. * generated/maxval_r4.c: Regenerated. From-SVN: r163595
2010-08-19re PR fortran/36158 (Transformational function BESSEL_YN(n1,n2,x) and ↵Tobias Burnus1-0/+36
BESSEL_JN missing) 2010-08-19 Tobias Burnus <burnus@net-b.de> PR fortran/36158 PR fortran/33197 * check.c (gfc_check_bessel_n2): New function. * gfortran.h (gfc_isym_id): Add GFC_ISYM_JN2 and GFC_ISYM_YN2. * intrinsic.c (add_functions): Add transformational version of the Bessel_jn/yn intrinsics. * intrinsic.h (gfc_check_bessel_n2,gfc_simplify_bessel_jn2, gfc_simplify_bessel_yn2): New prototypes. * intrinsic.texi (Bessel_jn, Bessel_yn): Document transformational variant. * simplify.c (gfc_simplify_bessel_jn, gfc_simplify_bessel_yn): Check for negative order. (gfc_simplify_bessel_n2,gfc_simplify_bessel_jn2, gfc_simplify_bessel_yn2): New functions. 2010-08-19 Tobias Burnus <burnus@net-b.de> PR fortran/36158 PR fortran/33197 * gfortran.dg/bessel_3.f90: New. * gfortran.dg/bessel_4.f90: New. * gfortran.dg/bessel_5.f90: New. From-SVN: r163364
2010-08-11re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)Janus Weil1-223/+217
2010-08-11 Janus Weil <janus@gcc.gnu.org> PR fortran/44595 * intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to 'gfc_intrinsic_arg'. (check_arglist,check_specific): Add reference to 'name' field. (init_arglist): Remove reference to 'name' field. * intrinsic.h (gfc_current_intrinsic_arg): Modify prototype. * check.c (variable_check): Reverse order of checks. Respect intent of formal arg. (int_or_proc_check): New function. (coarray_check): New function. (allocatable_check): New function. (gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'. (gfc_check_complex): Use 'int_or_real_check'. (gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image, gfc_check_ucobound): Use 'coarray_check'. (gfc_check_pack): Use 'real_or_complex_check'. (gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use 'int_or_proc_check'. (scalar_check,type_check,numeric_check,int_or_real_check, real_or_complex_check,kind_check,double_check,logical_array_check, array_check,same_type_check,rank_check,nonoptional_check, kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx, gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod, gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind, gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null, gfc_check_present,gfc_check_reshape,gfc_check_same_type_as, gfc_check_spread,gfc_check_unpack,gfc_check_random_seed, gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference to 'name' field. 2010-08-11 Janus Weil <janus@gcc.gnu.org> Steve Kargl <kargl@gcc.gnu.org> PR fortran/44595 * gfortran.dg/move_alloc_3.f90: New. * gfortran.dg/random_seed_2.f90: New. Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org> From-SVN: r163096
2010-07-08re PR fortran/44649 ([OOP] F2008: storage_size intrinsic (also working for ↵Janus Weil1-0/+38
polymorphic types)) 2010-07-08 Janus Weil <janus@gcc.gnu.org> PR fortran/44649 * gfortran.h (gfc_isym_id): Add GFC_ISYM_C_SIZEOF,GFC_ISYM_STORAGE_SIZE. * intrinsic.h (gfc_check_c_sizeof,gfc_check_storage_size, gfc_resolve_storage_size): New prototypes. * check.c (gfc_check_c_sizeof,gfc_check_storage_size): New functions. * intrinsic.c (add_functions): Add STORAGE_SIZE. * iresolve.c (gfc_resolve_storage_size): New function. * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Handle polymorphic arguments. (gfc_conv_intrinsic_storage_size): New function. (gfc_conv_intrinsic_function): Handle STORAGE_SIZE. 2010-07-08 Janus Weil <janus@gcc.gnu.org> PR fortran/44649 * gfortran.dg/c_sizeof_1.f90: Modified. * gfortran.dg/storage_size_1.f08: New. * gfortran.dg/storage_size_2.f08: New. From-SVN: r161977
2010-07-06PR fortran/PR44693Thomas Koenig1-4/+7
2010-07-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/PR44693 * check.c (dim_rank_check): Also check intrinsic functions. Adjust permissible rank for functions which reduce the rank of their argument. Spread is an exception, where DIM can be one larger than the rank of array. 2010-07-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/PR44693 * gfortran.dg/dim_range_1.f90: New test. * gfortran.dg/minmaxloc_4.f90: Remove invalid test. From-SVN: r161884
2010-06-25intrinsic.h (gfc_check_selected_real_kind, [...]): Update prototypes.Tobias Burnus1-8/+20
2010-06-25 Tobias Burnus <burnus@net-b.de> * intrinsic.h (gfc_check_selected_real_kind, gfc_simplify_selected_real_kind): Update prototypes. * intrinsic.c (add_functions): Add radix support to selected_real_kind. * check.c (gfc_check_selected_real_kind): Ditto. * simplify.c (gfc_simplify_selected_real_kind): Ditto. * trans-decl.c (gfc_build_intrinsic_function_decls): Change call from selected_real_kind to selected_real_kind2008. * intrinsic.texi (SELECTED_REAL_KIND): Update for radix. (PRECISION, RANGE, RADIX): Add cross @refs. 2010-06-25 Tobias Burnus <burnus@net-b.de> * intrinsics/selected_real_kind.f90 (_gfortran_selected_real_kind2008): Add function. (_gfortran_selected_real_kind): Stub which calls _gfortran_selected_real_kind2008. * gfortran.map (GFORTRAN_1.4): Add _gfortran_selected_real_kind2008. * mk-srk-inc.sh: Save also RADIX. 2010-06-25 Tobias Burnus <burnus@net-b.de> * selected_real_kind_2.f90: New. * selected_real_kind_3.f90: New. From-SVN: r161411
2010-06-09re PR fortran/44347 (SELECT_REAL_KIND: Wrongly accepts non-scalar arguments)Daniel Franke1-4/+16
gcc/fortran/: 2010-06-09 Daniel Franke <franke.daniel@gmail.com> PR fortran/44347 * check.c (gfc_check_selected_real_kind): Verify that the actual arguments are scalar. gcc/testsuite/: 2010-06-09 Daniel Franke <franke.daniel@gmail.com> PR fortran/44347 * gfortran.dg/selected_real_kind_1.f90: New. From-SVN: r160506
2010-06-09mvbits_9.f90: New test.Steven G. Kargl1-22/+102
2010-06-09 Steven G. Kargl <kargl@gcc.gnu.org> * testsuite/gfortran.dg/mvbits_9.f90: New test. * testsuite/gfortran.dg/ibset_1.f90: Ditto. * testsuite/gfortran.dg/ibits_1.f90: Ditto. * testsuite/gfortran.dg/btest_1.f90: Ditto. * testsuite/gfortran.dg/ibclr_1.f90: Ditto. 2010-06-09 Steven G. Kargl <kargl@gcc.gnu.org> * fortran/intrinsic.c (add_functions): Change gfc_check_btest, gfc_check_ibclr, and gfc_check_ibset to gfc_check_bitfcn. * fortran/intrinsic.h: Remove prototypes for gfc_check_btest, gfc_check_ibclr, and gfc_check_ibset. Add prototype for gfc_check_bitfcn. * fortran/check.c (nonnegative_check, less_than_bitsize1, less_than_bitsize2): New functions. (gfc_check_btest): Renamed to gfc_check_bitfcn. Use nonnegative_check and less_than_bitsize1. (gfc_check_ibclr, gfc_check_ibset): Removed. (gfc_check_ibits,gfc_check_mvbits): Use nonnegative_check and less_than_bitsize1. From-SVN: r160492
2010-05-19re PR fortran/34505 (FLOAT/SNGL: Not accepted as actual argument; ↵Daniel Franke1-1/+28
diagnostics problems) gcc/fortran/: 2010-05-19 Daniel Franke <franke.daniel@gmail.com> PR fortran/34505 * intrinsic.h (gfc_check_float): New prototype. (gfc_check_sngl): New prototype. * check.c (gfc_check_float): New. (gfc_check_sngl): New. * intrinsic.c (add_functions): Moved DFLOAT from aliasing DBLE to be a specific for REAL. Added check routines for FLOAT, DFLOAT and SNGL. * intrinsic.texi: Removed individual nodes of FLOAT, DFLOAT and SNGL, added them to the list of specifics of REAL instead. gcc/testsuite/: 2010-05-19 Daniel Franke <franke.daniel@gmail.com> PR fortran/34505 * gfortran.dg/dfloat_1.f90: Add warnings for non-default kind arguments; add check for return value kind. * gfortran.dg/float_1.f90: Likewise. From-SVN: r159558
2010-04-14re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+187
2010-04-14 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * array.c (gfc_find_array_ref): Handle codimensions. (gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error. * check.c (is_coarray, dim_corank_check, gfc_check_lcobound, gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound): New functions. * gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX, GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE, GFC_ISYM_UCOBOUND. * intrinsic.h (add_functions): Add this_image, image_index, lcobound and ucobound intrinsics. * intrinsic.c (gfc_check_lcobound,gfc_check_ucobound, gfc_check_image_index, gfc_check_this_image, gfc_simplify_image_index, gfc_simplify_lcobound, gfc_simplify_this_image, gfc_simplify_ucobound): New function prototypes. * intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE IMAGE_INDEX): Document new intrinsic functions. * match.c (gfc_match_critical, sync_statement): Make * -fcoarray=none error fatal. * simplify.c (simplify_bound_dim): Handle coarrays. (simplify_bound): Update simplify_bound_dim call. (gfc_simplify_num_images): Add -fcoarray=none check. (simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound, gfc_simplify_ucobound, gfc_simplify_ucobound): New functions. 2010-04-14 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_9.f90: Update dg-errors. * gfortran.dg/coarray_10.f90: New test. * gfortran.dg/coarray_11.f90: New test. From-SVN: r158292
2010-04-13[multiple changes]Jerry DeLisle1-19/+14
2010-04-12 Jerry DeLisle <jvdelisle@gcc.gnu.org> * array.c (extract_element): Restore function from trunk. (gfc_get_array_element): Restore function from trunk. (gfc_expand_constructor): Restore check against flag_max_array_constructor. * constructor.c (node_copy_and_append): Delete unused. * gfortran.h: Delete comment and extra include. * constructor.h: Bump copyright and clean up TODO comments. * resolve.c: Whitespace. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * simplify.c (compute_dot_product): Replaced usage of ADVANCE macro with direct access access to elements. Adjusted prototype, fixed all callers. (gfc_simplify_dot_product): Removed duplicate check for zero-sized array. (gfc_simplify_matmul): Removed usage of ADVANCE macro. (gfc_simplify_spread): Removed workaround, directly insert elements at a given array position. (gfc_simplify_transpose): Likewise. (gfc_simplify_pack): Replaced usage of ADVANCE macro with corresponding function calls. (gfc_simplify_unpack): Likewise. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * simplify.c (only_convert_cmplx_boz): Renamed to ... (convert_boz): ... this and moved to start of file. (gfc_simplify_abs): Whitespace fix. (gfc_simplify_acos): Whitespace fix. (gfc_simplify_acosh): Whitespace fix. (gfc_simplify_aint): Whitespace fix. (gfc_simplify_dint): Whitespace fix. (gfc_simplify_anint): Whitespace fix. (gfc_simplify_and): Replaced if-gate by more common switch-over-type. (gfc_simplify_dnint): Whitespace fix. (gfc_simplify_asin): Whitespace fix. (gfc_simplify_asinh): Moved creation of result-expr out of switch. (gfc_simplify_atan): Likewise. (gfc_simplify_atanh): Whitespace fix. (gfc_simplify_atan2): Whitespace fix. (gfc_simplify_bessel_j0): Removed ATTRIBUTE_UNUSED. (gfc_simplify_bessel_j1): Likewise. (gfc_simplify_bessel_jn): Likewise. (gfc_simplify_bessel_y0): Likewise. (gfc_simplify_bessel_y1): Likewise. (gfc_simplify_bessel_yn): Likewise. (gfc_simplify_ceiling): Reorderd statements. (simplify_cmplx): Use convert_boz(), check for constant arguments. Whitespace fix. (gfc_simplify_cmplx): Use correct default kind. Removed check for constant arguments. (gfc_simplify_complex): Replaced if-gate. Removed check for constant arguments. (gfc_simplify_conjg): Whitespace fix. (gfc_simplify_cos): Whitespace fix. (gfc_simplify_cosh): Replaced if-gate by more common switch-over-type. (gfc_simplify_dcmplx): Removed check for constant arguments. (gfc_simplify_dble): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_digits): Whitespace fix. (gfc_simplify_dim): Whitespace fix. (gfc_simplify_dprod): Reordered statements. (gfc_simplify_erf): Whitespace fix. (gfc_simplify_erfc): Whitespace fix. (gfc_simplify_epsilon): Whitespace fix. (gfc_simplify_exp): Whitespace fix. (gfc_simplify_exponent): Use convert_boz(). (gfc_simplify_floor): Reorderd statements. (gfc_simplify_gamma): Whitespace fix. (gfc_simplify_huge): Whitespace fix. (gfc_simplify_iand): Whitespace fix. (gfc_simplify_ieor): Whitespace fix. (simplify_intconv): Use gfc_convert_constant(). (gfc_simplify_int): Use simplify_intconv(). (gfc_simplify_int2): Reorderd statements. (gfc_simplify_idint): Reorderd statements. (gfc_simplify_ior): Whitespace fix. (gfc_simplify_ishftc): Removed duplicate type check. (gfc_simplify_len): Use range_check() instead of manual range check. (gfc_simplify_lgamma): Removed ATTRIBUTE_UNUSED. Whitespace fix. (gfc_simplify_log): Whitespace fix. (gfc_simplify_log10): Whitespace fix. (gfc_simplify_minval): Whitespace fix. (gfc_simplify_maxval): Whitespace fix. (gfc_simplify_mod): Whitespace fix. (gfc_simplify_modulo): Whitespace fix. (simplify_nint): Reorderd statements. (gfc_simplify_not): Whitespace fix. (gfc_simplify_or): Replaced if-gate by more common switch-over-type. (gfc_simplify_radix): Removed unused result-variable. Whitespace fix. (gfc_simplify_range): Removed unused result-variable. Whitespace fix. (gfc_simplify_real): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_realpart): Whitespace fix. (gfc_simplify_selected_char_kind): Removed unused result-variable. (gfc_simplify_selected_int_kind): Removed unused result-variable. (gfc_simplify_selected_real_kind): Removed unused result-variable. (gfc_simplify_sign): Whitespace fix. (gfc_simplify_sin): Whitespace fix. (gfc_simplify_sinh): Replaced if-gate by more common switch-over-type. (gfc_simplify_sqrt): Avoided goto by inlining check. Whitespace fix. (gfc_simplify_tan): Replaced if-gate by more common switch-over-type. (gfc_simplify_tanh): Replaced if-gate by more common switch-over-type. (gfc_simplify_xor): Replaced if-gate by more common switch-over-type. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * gfortran.h (gfc_start_constructor): Removed. (gfc_get_array_element): Removed. * array.c (gfc_start_constructor): Removed, use gfc_get_array_expr instead. Fixed all callers. (extract_element): Removed. (gfc_expand_constructor): Temporarily removed check for max-array-constructor. Will be re-introduced later if still required. (gfc_get_array_element): Removed, use gfc_constructor_lookup_expr instead. Fixed all callers. * expr.c (find_array_section): Replaced manual lookup of elements by gfc_constructor_lookup. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * gfortran.h (gfc_get_null_expr): New prototype. (gfc_get_operator_expr): New prototype. (gfc_get_character_expr): New prototype. (gfc_get_iokind_expr): New prototype. * expr.c (gfc_get_null_expr): New. (gfc_get_character_expr): New. (gfc_get_iokind_expr): New. (gfc_get_operator_expr): Moved here from matchexp.c (build_node). * matchexp.c (build_node): Renamed and moved to expr.c (gfc_get_operator_expr). Reordered arguments to match other functions. Fixed all callers. (gfc_get_parentheses): Use specific function to build expr. * array.c (gfc_match_array_constructor): Likewise. * arith.c (eval_intrinsic): Likewise. (gfc_hollerith2int): Likewise. (gfc_hollerith2real): Likewise. (gfc_hollerith2complex): Likewise. (gfc_hollerith2logical): Likewise. * data.c (create_character_intializer): Likewise. * decl.c (gfc_match_null): Likewise. (enum_initializer): Likewise. * io.c (gfc_match_format): Likewise. (match_io): Likewise. * match.c (gfc_match_nullify): Likewise. * primary.c (match_string_constant): Likewise. (match_logical_constant): Likewise. (build_actual_constructor): Likewise. * resolve.c (build_default_init_expr): Likewise. * symbol.c (generate_isocbinding_symbol): Likewise. (gfc_build_class_symbol): Likewise. (gfc_find_derived_vtab): Likewise. * simplify.c (simplify_achar_char): Likewise. (gfc_simplify_adjustl): Likewise. (gfc_simplify_adjustr): Likewise. (gfc_simplify_and): Likewise. (gfc_simplify_bit_size): Likewise. (gfc_simplify_is_iostat_end): Likewise. (gfc_simplify_is_iostat_eor): Likewise. (gfc_simplify_isnan): Likewise. (simplify_bound): Likewise. (gfc_simplify_leadz): Likewise. (gfc_simplify_len_trim): Likewise. (gfc_simplify_logical): Likewise. (gfc_simplify_maxexponent): Likewise. (gfc_simplify_minexponent): Likewise. (gfc_simplify_new_line): Likewise. (gfc_simplify_null): Likewise. (gfc_simplify_or): Likewise. (gfc_simplify_precision): Likewise. (gfc_simplify_repeat): Likewise. (gfc_simplify_scan): Likewise. (gfc_simplify_size): Likewise. (gfc_simplify_trailz): Likewise. (gfc_simplify_trim): Likewise. (gfc_simplify_verify): Likewise. (gfc_simplify_xor): Likewise. * trans-io.c (build_dt): Likewise. (gfc_new_nml_name_expr): Removed. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * arith.h (gfc_constant_result): Removed prototype. * constructor.h (gfc_build_array_expr): Removed prototype. (gfc_build_structure_constructor_expr): Removed prototype. * gfortran.h (gfc_int_expr): Removed prototype. (gfc_logical_expr): Removed prototype. (gfc_get_array_expr): New prototype. (gfc_get_structure_constructor_expr): New prototype. (gfc_get_constant_expr): New prototype. (gfc_get_int_expr): New prototype. (gfc_get_logical_expr): New prototype. * arith.c (gfc_constant_result): Moved and renamed to expr.c (gfc_get_constant_expr). Fixed all callers. * constructor.c (gfc_build_array_expr): Moved and renamed to expr.c (gfc_get_array_expr). Split gfc_typespec argument to type and kind. Fixed all callers. (gfc_build_structure_constructor_expr): Moved and renamed to expr.c (gfc_get_structure_constructor_expr). Split gfc_typespec argument to type and kind. Fixed all callers. * expr.c (gfc_logical_expr): Renamed to ... (gfc_get_logical_expr): ... this. Added kind argument. Fixed all callers. (gfc_int_expr): Renamed to ... (gfc_get_int_expr): ... this. Added kind and where arguments. Fixed all callers. (gfc_get_constant_expr): New. (gfc_get_array_expr): New. (gfc_get_structure_constructor_expr): New. * simplify.c (int_expr_with_kind): Removed, callers use gfc_get_int_expr instead. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * constructor.h: New. * constructor.c: New. * Make-lang.in: Add new files to F95_PARSER_OBJS. * arith.c (reducy_unary): Use constructor API. (reduce_binary_ac): Likewise. (reduce_binary_ca): Likewise. (reduce_binary_aa): Likewise. * check.c (gfc_check_pack): Likewise. (gfc_check_reshape): Likewise. (gfc_check_unpack): Likewise. * decl.c (add_init_expr_to_sym): Likewise. (build_struct): Likewise. * dependency.c (gfc_check_dependency): Likewise. (contains_forall_index_p): Likewise. * dump-parse-tree.c (show_constructor): Likewise. * expr.c (free_expr0): Likewise. (gfc_copy_expr): Likewise. (gfc_is_constant_expr): Likewise. (simplify_constructor): Likewise. (find_array_element): Likewise. (find_component_ref): Likewise. (find_array_section): Likewise. (find_substring_ref): Likewise. (simplify_const_ref): Likewise. (scalarize_intrinsic_call): Likewise. (check_alloc_comp_init): Likewise. (gfc_default_initializer): Likewise. (gfc_traverse_expr): Likewise. * iresolve.c (check_charlen_present): Likewise. (gfc_resolve_reshape): Likewise. (gfc_resolve_transfer): Likewise. * module.c (mio_constructor): Likewise. * primary.c (build_actual_constructor): Likewise. (gfc_match_structure_constructor): Likewise. * resolve.c (resolve_structure_cons): Likewise. * simplify.c (is_constant_array_expr): Likewise. (init_result_expr): Likewise. (transformational_result): Likewise. (simplify_transformation_to_scalar): Likewise. (simplify_transformation_to_array): Likewise. (gfc_simplify_dot_product): Likewise. (simplify_bound): Likewise. (simplify_matmul): Likewise. (simplify_minval_maxval): Likewise. (gfc_simplify_pack): Likewise. (gfc_simplify_reshape): Likewise. (gfc_simplify_shape): Likewise. (gfc_simplify_spread): Likewise. (gfc_simplify_transpose): Likewise. (gfc_simplify_unpack): Likewise.q (gfc_convert_constant): Likewise. (gfc_convert_char_constant): Likewise. * target-memory.c (size_array): Likewise. (encode_array): Likewise. (encode_derived): Likewise. (interpret_array): Likewise. (gfc_interpret_derived): Likewise. (expr_to_char): Likewise. (gfc_merge_initializers): Likewise. * trans-array.c (gfc_get_array_constructor_size): Likewise. (gfc_trans_array_constructor_value): Likewise. (get_array_ctor_strlen): Likewise. (gfc_constant_array_constructor_p): Likewise. (gfc_build_constant_array_constructor): Likewise. (gfc_trans_array_constructor): Likewise. (gfc_conv_array_initializer): Likewise. * trans-decl.c (check_constant_initializer): Likewise. * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. (gfc_apply_interface_mapping_to_cons): Likewise. (gfc_trans_structure_assign): Likewise. (gfc_conv_structure): Likewise. * array.c (check_duplicate_iterator): Likewise. (match_array_list): Likewise. (match_array_cons_element): Likewise. (gfc_match_array_constructor): Likewise. (check_constructor_type): Likewise. (check_constructor): Likewise. (expand): Likewise. (expand_constructor): Likewise. (extract_element): Likewise. (gfc_expanded_ac): Likewise. (resolve_array_list): Likewise. (gfc_resolve_character_array_constructor): Likewise. (copy_iterator): Renamed to ... (gfc_copy_iterator): ... this. (gfc_append_constructor): Removed. (gfc_insert_constructor): Removed unused function. (gfc_get_constructor): Removed. (gfc_free_constructor): Removed. (qgfc_copy_constructor): Removed. * gfortran.h (struct gfc_expr): Removed member 'con_by_offset'. Removed all references. Replaced constructor list by splay-tree. (struct gfc_constructor): Removed member 'next', moved 'offset' from the inner struct, added member 'base'. (gfc_append_constructor): Removed prototype. (gfc_insert_constructor): Removed prototype. (gfc_get_constructor): Removed prototype. (gfc_free_constructor): Removed prototype. (qgfc_copy_constructor): Removed prototype. (gfc_copy_iterator): New prototype. * trans-array.h (gfc_constant_array_constructor_p): Adjusted prototype. From-SVN: r158253
2009-10-29re PR fortran/41777 (Wrong-code with POINTER-returning GENERIC function)Tobias Burnus1-8/+4
2009-10-29 Tobias Burnus <burnus@net-b.de> PR fortran/41777 * trans-expr.c * (gfc_conv_procedure_call,gfc_conv_expr_reference): Use for generic EXPR_FUNCTION the attributes of the specific function. 2009-10-29 Tobias Burnus <burnus@net-b.de> PR fortran/41777 gfortran.dg/associated_target_3.f90: New testcase. From-SVN: r153706
2009-09-30re PR fortran/40996 ([F03] ALLOCATABLE scalars)Tobias Burnus1-7/+41
fortran/ 2009-09-30 Janus Weil <janus@gcc.gnu.org> * check.c (gfc_check_same_type_as): New function for checking SAME_TYPE_AS and EXTENDS_TYPE_OF. * decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class container, if the contained type has it. Add an initializer for the class container. (add_init_expr_to_sym): Handle BT_CLASS. (vindex_counter): New counter for setting vindices. (gfc_match_derived_decl): Set vindex for all derived types, not only those which are being extended. * expr.c (gfc_check_assign_symbol): Handle NULL initialization of class pointers. * gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and GFC_ISYM_EXTENDS_TYPE_OF. (gfc_type_is_extensible): New prototype. * intrinsic.h (gfc_check_same_type_as): New prototype. * intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF. * primary.c (gfc_expr_attr): Handle CLASS-valued functions. * resolve.c (resolve_structure_cons): Handle BT_CLASS. (type_is_extensible): Make non-static and rename to 'gfc_type_is_extensible. (resolve_select_type): Renamed type_is_extensible. (resolve_class_assign): Handle NULL pointers. (resolve_fl_variable_derived): Renamed type_is_extensible. (resolve_fl_derived): Ditto. * trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL initialization of class pointer components. (gfc_conv_structure): Handle BT_CLASS. * trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of): New functions. (gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * gfortran.h (type_selector, select_type_tmp): New global variables. * match.c (type_selector, select_type_tmp): New global variables, used for SELECT TYPE statements. (gfc_match_select_type): Better error handling. Remember selector. (gfc_match_type_is): Create temporary variable. * module.c (ab_attribute): New value 'AB_IS_CLASS'. (attr_bits): New string. (mio_symbol_attribute): Handle 'is_class'. * resolve.c (resolve_select_type): Insert pointer assignment statement, to assign temporary to selector. * symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary in SELECT TYPE statements. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * dump-parse-tree.c (show_code_node): Renamed 'alloc_list'. * gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'. (gfc_expr_to_initialize): New prototype. * match.c (alloc_opt_list): Correctly check type compatibility. Renamed 'alloc_list'. (dealloc_opt_list): Renamed 'alloc_list'. * resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize' and make it non-static. (resolve_allocate_expr): Set vindex for CLASS variables correctly. Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'. (resolve_allocate_deallocate): Renamed 'alloc_list'. (check_class_pointer_assign): Rename to 'resolve_class_assign'. Change argument type. Adjust to work with ordinary assignments. (resolve_code): Call 'resolve_class_assign' for ordinary assignments. Renamed 'check_class_pointer_assign'. * st.c (gfc_free_statement): Renamed 'alloc_list'. * trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle size determination and initialization of CLASS variables. Bugfix for ALLOCATE statements with default initialization and SOURCE block. (gfc_trans_deallocate): Renamed 'alloc_list'. 2009-09-30 Paul Thomas <pault@gcc.gnu.org> * trans-expr.c (gfc_conv_procedure_call): Convert a derived type actual to a class object if the formal argument is a class. 2009-09-30 Janus Weil <janus@gcc.gnu.org> PR fortran/40996 * decl.c (build_struct): Handle allocatable scalar components. * expr.c (gfc_add_component_ref): Correctly set typespec of expression, after inserting component reference. * match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no variables are being used uninitialized. * primary.c (gfc_match_varspec): Handle CLASS array components. * resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to EXEC_SELECT. * trans-array.c (structure_alloc_comps,gfc_trans_deferred_array): Handle allocatable scalar components. * trans-expr.c (gfc_conv_component_ref): Ditto. * trans-types.c (gfc_get_derived_type): Ditto. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * decl.c (encapsulate_class_symbol): Modify names of class container components by prefixing with '$'. (gfc_match_end): Handle COMP_SELECT_TYPE. * expr.c (gfc_add_component_ref): Modify names of class container components by prefixing with '$'. * gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and ST_CLASS_IS. (gfc_case): New field 'ts'. (gfc_exec_op): Add EXEC_SELECT_TYPE. (gfc_type_is_extension_of): New prototype. * match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is): New prototypes. * match.c (match_derived_type_spec): New function. (match_type_spec): Use 'match_derived_type_spec'. (match_case_eos): Modify error message. (gfc_match_select_type): New function. (gfc_match_case): Modify error message. (gfc_match_type_is): New function. (gfc_match_class_is): Ditto. * parse.h (gfc_compile_state): Add COMP_SELECT_TYPE. * parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS statements. (next_statement): Handle ST_SELECT_TYPE. (gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS. (parse_select_type_block): New function. (parse_executable): Handle ST_SELECT_TYPE. * resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of class container components by prefixing with '$'. (resolve_allocate_expr): Ditto. (resolve_select_type): New function. (gfc_resolve_blocks): Handle EXEC_SELECT_TYPE. (check_class_pointer_assign): Modify names of class container components by prefixing with '$'. (resolve_code): Ditto. * st.c (gfc_free_statement): Ditto. * symbol.c (gfc_type_is_extension_of): New function. (gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix. * trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE. 2009-09-30 Janus Weil <janus@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> * check.c (gfc_check_move_alloc): Arguments don't have to be arrays. The second argument needs to be type-compatible with the first (not the other way around, which makes a difference for CLASS entities). * decl.c (encapsulate_class_symbol): New function. (build_sym,build_struct): Handle BT_CLASS, call 'encapsulate_class_symbol'. (gfc_match_decl_type_spec): Remove warning, use BT_CLASS. (gfc_match_derived_decl): Set vindex; * expr.c (gfc_add_component_ref): New function. (gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol): Handle BT_CLASS. * dump-parse-tree.c (show_symbol): Print vindex. * gfortran.h (bt): New basic type BT_CLASS. (symbol_attribute): New field 'is_class'. (gfc_typespec): Remove field 'is_class'. (gfc_symbol): New field 'vindex'. (gfc_get_ultimate_derived_super_type): New prototype. (gfc_add_component_ref): Ditto. * interface.c (gfc_compare_derived_types): Pointer equality check moved here from gfc_compare_types. (gfc_compare_types): Handle BT_CLASS and use gfc_type_compatible. * match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call): Handle BT_CLASS. * misc.c (gfc_clear_ts): Removed is_class. (gfc_basic_typename,gfc_typename): Handle BT_CLASS. * module.c (bt_types,mio_typespec): Handle BT_CLASS. (mio_symbol): Handle vindex. * primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS. * resolve.c (find_array_spec,check_typebound_baseobject): Handle BT_CLASS. (resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp' inside 'gcc_assert'. (resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS. (check_class_pointer_assign): New function. (resolve_code): Handle BT_CLASS, call check_class_pointer_assign. (resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived, resolve_fl_variable): Handle BT_CLASS. (check_generic_tbp_ambiguity): Add special case. (resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS. * symbol.c (gfc_get_ultimate_derived_super_type): New function. (gfc_type_compatible): Handle BT_CLASS. * trans-expr.c (conv_parent_component_references): Handle CLASS containers. (gfc_conv_initializer): Handle BT_CLASS. * trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type): Handle BT_CLASS. testsuite/ 2009-09-30 Janus Weil <janus@gcc.gnu.org> * gfortran.dg/same_type_as_1.f03: New test. * gfortran.dg/same_type_as_2.f03: Ditto. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * gfortran.dg/select_type_1.f03: Extended. * gfortran.dg/select_type_3.f03: New test. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * gfortran.dg/class_allocate_1.f03: New test. 2009-09-30 Janus Weil <janus@gcc.gnu.org> PR fortran/40996 * gfortran.dg/allocatable_scalar_3.f90: New test. * gfortran.dg/select_type_2.f03: Ditto. * gfortran.dg/typebound_proc_5.f03: Changed error messages. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * gfortran.dg/block_name_2.f90: Modified error message. * gfortran.dg/select_6.f90: Ditto. * gfortran.dg/select_type_1.f03: New test. 2009-09-30 Janus Weil <janus@gcc.gnu.org> * gfortran.dg/allocate_derived_1.f90: Remove -w option. * gfortran.dg/class_1.f03: Ditto. * gfortran.dg/class_2.f03: Ditto. * gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto. * gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto. * gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto. * gfortran.dg/typebound_call_10.f03: Ditto. * gfortran.dg/typebound_call_2.f03: Ditto. * gfortran.dg/typebound_call_3.f03: Ditto. * gfortran.dg/typebound_call_4.f03: Ditto. * gfortran.dg/typebound_call_9.f03: Ditto. * gfortran.dg/typebound_generic_3.f03: Ditto. * gfortran.dg/typebound_generic_4.f03: Ditto. * gfortran.dg/typebound_operator_1.f03: Ditto. * gfortran.dg/typebound_operator_2.f03: Ditto. * gfortran.dg/typebound_operator_3.f03: Ditto. * gfortran.dg/typebound_operator_4.f03: Ditto. * gfortran.dg/typebound_proc_1.f08: Ditto. * gfortran.dg/typebound_proc_5.f03: Ditto. * gfortran.dg/typebound_proc_6.f03: Ditto. From-SVN: r152345
2009-08-31re PR fortran/40996 ([F03] ALLOCATABLE scalars)Janus Weil1-3/+0
2009-08-31 Janus Weil <janus@gcc.gnu.org> PR fortran/40996 * check.c (gfc_check_allocated): Implement allocatable scalars. * resolve.c (resolve_allocate_expr,resolve_fl_var_and_proc): Ditto. * trans-intrinsic.c (gfc_conv_allocated): Ditto. 2009-08-31 Janus Weil <janus@gcc.gnu.org> PR fortran/40996 * gfortran.dg/allocatable_scalar_1.f90: New. * gfortran.dg/allocatable_scalar_2.f90: Renamed from finalize_9.f03. * gfortran.dg/finalize_9.f03: Renamed to allocatable_scalar_2.f90. * gfortran.dg/proc_ptr_comp_pass_4.f90: Modified. From-SVN: r151240
2009-08-13re PR fortran/40941 (gfc_typespec: put derived and cl into union)Janus Weil1-11/+11
2009-08-13 Janus Weil <janus@gcc.gnu.org> PR fortran/40941 * gfortran.h (gfc_typespec): Put 'derived' and 'cl' into union. * decl.c (build_struct): Make sure 'cl' is only used if type is BT_CHARACTER. * symbol.c (gfc_set_default_type): Ditto. * resolve.c (resolve_symbol, resolve_fl_derived): Ditto. (resolve_equivalence,resolve_equivalence_derived): Make sure 'derived' is only used if type is BT_DERIVED. * trans-io.c (transfer_expr): Make sure 'derived' is only used if type is BT_DERIVED or BT_INTEGER (special case: C_PTR/C_FUNPTR). * array.c: Mechanical replacements to accomodate union in gfc_typespec. * check.c: Ditto. * data.c: Ditto. * decl.c: Ditto. * dump-parse-tree.c: Ditto. * expr.c: Ditto. * interface.c: Ditto. * iresolve.c: Ditto. * match.c: Ditto. * misc.c: Ditto. * module.c: Ditto. * openmp.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * target-memory.c: Ditto. * trans-array.c: Ditto. * trans-common.c: Ditto. * trans-const.c: Ditto. * trans-decl.c: Ditto. * trans-expr.c: Ditto. * trans-intrinsic.c: Ditto. * trans-io.c: Ditto. * trans-stmt.c: Ditto. * trans-types.c: Ditto. From-SVN: r150725
2009-07-26re PR fortran/33197 (Fortran 2008: math functions)Tobias Burnus1-0/+13
2009-07-26 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * intrinsic.c (make_generic): Remove assert as "atan" can be both ISYM_ATAN and ISYM_ATAN2. (add_functions): Add two-argument variant of ATAN. * intrinsic.h (gfc_check_atan_2): Add check for it. * intrinsic.texi (ATAN2): Correct and enhance description. (ATAN): Describe two-argument variant of ATAN. 2009-07-26 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * gfortran.dg/atan2_1.f90: New test * gfortran.dg/atan2_2.f90: New test From-SVN: r150100
2009-07-19re PR fortran/40727 ([4.4] ICE gfc_simplify_dcmplx(): Bad type when passing ↵Steven G. Kargl1-0/+17
BT_COMPLEX to cmplx) 2009-07-18 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/40727 * fortran/check.c (gfc_check_cmplx, gfc_check_dcmplx): Add check that the optional second argument isn't of COMPLEX type. 2009-07-18 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/40727 * gfortran.dg/intrinsic_cmplx.f90: New test. From-SVN: r149793
2009-07-11re PR fortran/33197 (Fortran 2008: math functions)Tobias Burnus1-0/+17
2009-07-09 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * check.c (gfc_check_fn_rc2008): New function. * intrinsic.h (gfc_check_fn_rc2008): New prototype. * intrinsic.c (add_functions): Add complex tan, cosh, sinh, and tanh. 2009-07-09 Tobias Burnus <burnus@net-b.de> PR fortran/33197 * gfortran.dg/complex_intrinsic_3.f90: New test. * gfortran.dg/complex_intrinsic_4.f90: New test. From-SVN: r149503
2009-06-07re PR fortran/25104 ([F2003] Non-initialization expr. as case-selector)Daniel Franke1-5/+56
2009-06-07 Daniel Franke <franke.daniel@gmail.com> PR fortran/25104 PR fortran/29962 * array.c (gfc_append_constructor): Added NULL-check. * check.c (gfc_check_spread): Check DIM. (gfc_check_unpack): Check that the ARRAY arguments provides enough values for MASK. * intrinsic.h (gfc_simplify_spread): New prototype. (gfc_simplify_unpack): Likewise. * intrinsic.c (add_functions): Added new simplifier callbacks. * simplify.c (gfc_simplify_spread): New. (gfc_simplify_unpack): New. * expr.c (check_transformational): Allow additional * transformational intrinsics in initialization expression. 2009-06-07 Daniel Franke <franke.daniel@gmail.com> PR fortran/25104 PR fortran/29962 * gfortran.dg/spread_init_expr.f03: New. * gfortran.dg/unpack_init_expr.f03: New. * gfortran.dg/intrinsic_argument_conformance_2.f90: Adjusted error message. From-SVN: r148250
2009-06-07re PR fortran/25104 ([F2003] Non-initialization expr. as case-selector)Daniel Franke1-0/+5
2009-06-07 Daniel Franke <franke.daniel@gmail.com> PR fortran/25104 PR fortran/29962 * check.c (gfc_check_all_any): Check rank of DIM. (gfc_check_count): Likewise. * intrinsic.h (gfc_simplify_all): New prototype. (gfc_simplify_any): Likewise. (gfc_simplify_count): Likewise. (gfc_simplify_sum): Likewise. (gfc_simplify_product): Likewise. * intrinsic.c (add_functions): Added new simplifier callbacks. * simplify.c (transformational_result): New. (simplify_transformation_to_scalar): New. (simplify_transformation_to_array): New. (gfc_count): New. (gfc_simplify_all): New. (gfc_simplify_any): New. (gfc_simplify_count): New. (gfc_simplify_sum): New. (gfc_simplify_product): New. * expr.c (check_transformational): Allow additional * transformational intrinsics in initialization expression. 2009-06-07 Daniel Franke <franke.daniel@gmail.com> PR fortran/25104 PR fortran/29962 * gfortran.dg/count_init_expr.f03 * gfortran.dg/product_init_expr.f03 * gfortran.dg/sum_init_expr.f03 From-SVN: r148249
2009-06-07re PR fortran/36874 (Add shape checks to cshift/eoshift)Daniel Franke1-92/+141
2009-06-07 Daniel Franke <franke.daniel@gmail.com> * check.c (dim_rank_check): Return SUCCESS if DIM=NULL. (gfc_check_lbound): Removed (now) redundant check for DIM=NULL. (gfc_check_minloc_maxloc): Likewise. (check_reduction): Likewise. (gfc_check_size): Likewise. (gfc_check_ubound): Likewise. (gfc_check_cshift): Added missing shape-conformance checks. (gfc_check_eoshift): Likewise. * gfortran.h (gfc_check_conformance): Modified prototype to printf-style. * expr.c (gfc_check_conformance): Accept error-message chunks in printf-style. Changed all callers. 2009-06-07 Daniel Franke <franke.daniel@gmail.com> PR fortran/36874 * gfortran.dg/intrinsic_argument_conformance_2.f90: Adjusted error message. * gfortran.dg/zero_sized_1.f90: Removed checks with incompatible shapes. * gfortran.dg/zero_sized_5.f90: Likewise. From-SVN: r148247
2009-06-06re PR fortran/32890 (Compile-time detect of LHS/RHS missmatch for PACK)Daniel Franke1-1/+51
fortran/ 2009-06-06 Daniel Franke <franke.daniel@gmail.com> PR fortran/32890 * intrinsic.h (gfc_simplify_pack): New prototype. * intrinsic.c (add_functions): Added simplifier-callback to PACK. * simplify.c (is_constant_array_expr): Moved to beginning of file. (gfc_simplify_pack): New. * check.c (gfc_check_pack): Check that VECTOR has enough elements. Added safeguards for empty arrays. testsuite/ 2009-06-06 Daniel Franke <franke.daniel@gmail.com> PR fortran/32890 * gfortran.dg/pack_assign_1.f90: New. * gfortran.dg/pack_vector_1.f90: New. From-SVN: r148237
2009-06-04re PR fortran/37203 (Check ORDER= of RESHAPE)Daniel Franke1-5/+100
gcc/fortran/ 2009-06-04 Daniel Franke <franke.daniel@gmail.com> PR fortran/37203 * check.c (gfc_check_reshape): Additional checks for the SHAPE and ORDER arguments. * simplify.c (gfc_simplify_reshape): Converted argument checks to asserts. gcc/testsuite/ 2009-06-04 Daniel Franke <franke.daniel@gmail.com> PR fortran/37203 * gfortran.dg/reshape_order_5.f90: New. * gfortran.dg/reshape_shape_1.f90: New. From-SVN: r148190
2009-01-09check.c: Update copyright year.Paul Thomas1-1/+1
2009-01-10 Paul Thomas <pault@gcc.gnu.org> * check.c : Update copyright year. * dependency.c : Update copyright year. * interface.c : ditto. * intrinsic.c : ditto. * intrinsic.h : ditto. * module.c : ditto. * simplify.c : ditto. * symbol.c : ditto. * trans-stmt.c : ditto. * trans-types.c : ditto. From-SVN: r143236
2009-01-05re PR fortran/37159 (RANDOM_SEED: GET= check array size at compile time ↵Daniel Franke1-7/+16
and respect -fdefault-integer-*) gcc/fortran: 2009-01-05 Daniel Franke <franke.daniel@gmail.com> PR fortran/37159 * check.c (gfc_check_random_seed): Added size check for GET dummy argument, reworded error messages to follow common pattern. gcc/testsuite: 2009-01-05 Daniel Franke <franke.daniel@gmail.com> PR fortran/37159 * gfortran.dg/random_seed_1.f90: Updated. From-SVN: r143089
2008-12-31check.c (dim_rank_check): Fixed checking of dimension argument if array is ↵Daniel Franke1-7/+12
of type EXPR_ARRAY. gcc/fortran: 2008-12-31 Daniel Franke <franke.daniel@gmail.com> * check.c (dim_rank_check): Fixed checking of dimension argument if array is of type EXPR_ARRAY. gcc/testsuite: 2008-12-31 Daniel Franke <franke.daniel@gmail.com> * gfortran.dg/mapping_2.f90: Fixed testcase. From-SVN: r142981
2008-12-18re PR fortran/31822 (Missing run-time bound checks for character pointer => ↵Daniel Kraft1-5/+5
target) 2008-12-18 Daniel Kraft <d@domob.eu> PR fortran/31822 * gfortran.h (gfc_check_same_strlen): Made public. * trans.h (gfc_trans_same_strlen_check): Made public. * check.c (gfc_check_same_strlen): Made public and adapted error message output to be useful not only for intrinsics. (gfc_check_merge): Adapt to gfc_check_same_strlen change. * expr.c (gfc_check_pointer_assign): Use gfc_check_same_strlen for string length compile-time check. * trans-expr.c (gfc_trans_pointer_assignment): Add runtime-check for equal string lengths using gfc_trans_same_strlen_check. * trans-intrinsic.c (gfc_trans_same_strlen_check): Renamed and made public from conv_same_strlen_check. (gfc_conv_intrinsic_merge): Adapted accordingly. 2008-12-18 Daniel Kraft <d@domob.eu> PR fortran/31822 * gfortran.dg/char_pointer_assign_2.f90: Updated expected error message to be more detailed. * gfortran.dg/char_pointer_assign_4.f90: New test. * gfortran.dg/char_pointer_assign_5.f90: New test. From-SVN: r142808
2008-12-12re PR fortran/36355 (matmul argument-check: wrong error messages)Daniel Franke1-2/+11
gcc/fortran: 2008-12-12 Daniel Franke <franke.daniel@gmail.com> PR fortran/36355 * check.c (gfc_check_matmul): Fixed error message for invalid types to correctly identify the offending argument, added check for mismatching types. gcc/testsuite: 2008-12-12 Daniel Franke <franke.daniel@gmail.com> PR fortran/36355 * gfortran.dg/matmul_argument_types.f90: New. From-SVN: r142709
2008-11-01re PR fortran/37159 (RANDOM_SEED: GET= check array size at compile time ↵Dennis Wassel1-1/+14
and respect -fdefault-integer-*) 2008-11-01 Dennis Wassel <dennis.wassel@gmail.com> PR fortran/37159 * fortran/check.c (gfc_check_random_seed): Check PUT size at compile time. 2008-11-01 Dennis Wassel <dennis.wassel@gmail.com> PR fortran/37159 * intrinsics/random.c: Added comment to adapt check.c, should kiss_size change. Few cosmetic changes to existing comments. 2008-11-01 Dennis Wassel <dennis.wassel@gmail.com> PR fortran/37159 * gfortran.dg/random_seed_1.f90: New testcase. From-SVN: r141511
2008-07-29gfortran.h (try): Remove macro.Kaveh R. Ghazi1-179/+179
* gfortran.h (try): Remove macro. Replace try with gfc_try throughout. * array.c: Likewise. * check.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.h: Likewise. * parse.c: Likewise. * parse.h: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-openmp.c: Likewise. * trans-types.c: Likewise. From-SVN: r138226
2008-07-19check.c (gfc_check_cshift,gfc_check_eoshift,gfc_check_unpack): Add rank ↵Tobias Burnus1-5/+57
checks for cshift's shift and eoshift's shift and boundary args. 2008-07-19 Tobias Burnus <burnus@net-b.de> * check.c (gfc_check_cshift,gfc_check_eoshift,gfc_check_unpack): Add rank checks for cshift's shift and eoshift's shift and boundary args. (gfc_check_unpack): Add rank and shape tests for unpack. 2008-07-19 Tobias Burnus <burnus@net-b.de> * gfortran.dg/intrinsic_argument_conformance_2.f90: New. * gfortran.dg/zero_sized_1.f90: Fix conformance bugs. From-SVN: r137983
2008-07-02re PR fortran/32580 (iso_c_binding c_f_procpointer / procedure pointers)Janus Weil1-8/+8
2008-07-02 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> Paul Thomas <pault@gcc.gnu.org> PR fortran/32580 * gfortran.h (struct gfc_symbol): New member "proc_pointer". * check.c (gfc_check_associated,gfc_check_null): Implement procedure pointers. * decl.c (match_procedure_decl): Ditto. * expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto. * interface.c (compare_actual_formal): Ditto. * match.h: Ditto. * match.c (gfc_match_pointer_assignment): Ditto. * parse.c (parse_interface): Ditto. * primary.c (gfc_match_rvalue,match_variable): Ditto. * resolve.c (resolve_fl_procedure): Ditto. * symbol.c (check_conflict,gfc_add_external,gfc_add_pointer, gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto. * trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl, create_function_arglist): Ditto. * trans-expr.c (gfc_conv_variable,gfc_conv_function_val, gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto. 2008-07-02 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32580 * gfortran.dg/c_f_pointer_tests_3.f90: Updated. * gfortran.dg/proc_decl_1.f90: Updated. * gfortran.dg/proc_ptr_1.f90: New. * gfortran.dg/proc_ptr_2.f90: New. * gfortran.dg/proc_ptr_3.f90: New. * gfortran.dg/proc_ptr_4.f90: New. * gfortran.dg/proc_ptr_5.f90: New. * gfortran.dg/proc_ptr_6.f90: New. * gfortran.dg/proc_ptr_7.f90: New. * gfortran.dg/proc_ptr_8.f90: New. Co-Authored-By: Paul Thomas <pault@gcc.gnu.org> Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r137386
2008-05-18intrinsic.c (char_conversions, ncharconv): New static variables.Francois-Xavier Coudert1-2/+97
* intrinsic.c (char_conversions, ncharconv): New static variables. (find_char_conv): New function. (add_functions): Add simplification functions for ADJUSTL and ADJUSTR. Don't check the kind of their argument. Add checking for LGE, LLE, LGT and LLT. (add_subroutines): Fix argument type for SLEEP. Fix argument name for SYSTEM. (add_char_conversions): New function. (gfc_intrinsic_init_1): Call add_char_conversions. (gfc_intrinsic_done_1): Free char_conversions. (check_arglist): Use kind == 0 as a signal that we don't want the kind value to be checked. (do_simplify): Also simplify character functions. (gfc_convert_chartype): New function * trans-array.c (gfc_trans_array_ctor_element): Don't force the use of default character type. (gfc_trans_array_constructor_value): Likewise. (get_array_ctor_var_strlen): Use integer kind to build an integer instead of a character kind! (gfc_build_constant_array_constructor): Don't force the use of default character type. (gfc_conv_loop_setup): Likewise. * trans-expr.c (gfc_conv_string_tmp): Don't force the use of default character type. Allocate enough memory for wide strings. (gfc_conv_concat_op): Make sure operand kind are the same. (string_to_single_character): Remove gfc_ prefix. Reindent. Don't force the use of default character type. (gfc_conv_scalar_char_value): Likewise. (gfc_build_compare_string): Call string_to_single_character. (fill_with_spaces): New function (gfc_trans_string_copy): Add kind arguments. Use them to deal with wide character kinds. (gfc_conv_statement_function): Whitespace fix. Call gfc_trans_string_copy with new kind arguments. (gfc_conv_substring_expr): Call gfc_build_wide_string_const instead of using gfc_widechar_to_char. (gfc_conv_string_parameter): Don't force the use of default character type. (gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy. * intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant, gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes. * decl.c (gfc_set_constant_character_len): Don't assert the existence of a single character kind. * trans-array.h (gfc_trans_string_copy): New prototype. * gfortran.h (gfc_check_character_range, gfc_convert_chartype): New prototypes. * error.c (print_wide_char_into_buffer): New function lifting code from gfc_print_wide_char. Fix order to output '\x??' instead of 'x\??'. (gfc_print_wide_char): Call print_wide_char_into_buffer. (show_locus): Call print_wide_char_into_buffer with buffer local to this function. * trans-const.c (gfc_build_wide_string_const): New function. (gfc_conv_string_init): Deal with wide characters strings constructors. (gfc_conv_constant_to_tree): Call gfc_build_wide_string_const. * trans-stmt.c (gfc_trans_label_assign): Likewise. (gfc_trans_character_select): Deal with wide strings. * expr.c (gfc_check_assign): Allow conversion between character kinds on assignment. * trans-const.h (gfc_build_wide_string_const): New prototype. * trans-types.c (gfc_get_character_type_len_for_eltype, gfc_get_character_type_len): Create too variants of the old gfc_get_character_type_len, one getting kind argument and the other one directly taking a type tree. * trans.h (gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4, gfor_fndecl_convert_char4_to_char1): New prototypes. * trans-types.h (gfc_get_character_type_len_for_eltype): New prototype. * resolve.c (resolve_operator): Exit early when kind mismatches are detected, because that makes us issue an error message later. (validate_case_label_expr): Fix wording of error message. * iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New functions. (gfc_resolve_pack): Call _char4 variants of library function when dealing with wide characters. (gfc_resolve_reshape): Likewise. (gfc_resolve_spread): Likewise. (gfc_resolve_transpose): Likewise. (gfc_resolve_unpack): Likewise. * target-memory.c (size_character): Take character kind bit size correctly into account (not that it changes anything for now, but it's more generic). (gfc_encode_character): Added gfc_ prefix. Encoding each character of a string by calling native_encode_expr for the corresponding unsigned integer. (gfc_target_encode_expr): Add gfc_ prefix to encode_character. * trans-decl.c (gfc_build_intrinsic_function_decls): Build gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4 and gfor_fndecl_convert_char4_to_char1. * target-memory.h (gfc_encode_character): New prototype. * arith.c (gfc_check_character_range): New function. (eval_intrinsic): Allow non-default character kinds. * check.c (gfc_check_access_func): Only allow default character kind arguments. (gfc_check_chdir): Likewise. (gfc_check_chdir_sub): Likewise. (gfc_check_chmod): Likewise. (gfc_check_chmod_sub): Likewise. (gfc_check_lge_lgt_lle_llt): New function. (gfc_check_link): Likewise. (gfc_check_link_sub): Likewise. (gfc_check_symlnk): Likewise. (gfc_check_symlnk_sub): Likewise. (gfc_check_rename): Likewise. (gfc_check_rename_sub): Likewise. (gfc_check_fgetputc_sub): Likewise. (gfc_check_fgetput_sub): Likewise. (gfc_check_stat): Likewise. (gfc_check_stat_sub): Likewise. (gfc_check_date_and_time): Likewise. (gfc_check_ctime_sub): Likewise. (gfc_check_fdate_sub): Likewise. (gfc_check_gerror): Likewise. (gfc_check_getcwd_sub): Likewise. (gfc_check_getarg): Likewise. (gfc_check_getlog): Likewise. (gfc_check_hostnm): Likewise. (gfc_check_hostnm_sub): Likewise. (gfc_check_ttynam_sub): Likewise. (gfc_check_perror): Likewise. (gfc_check_unlink): Likewise. (gfc_check_unlink_sub): Likewise. (gfc_check_system_sub): Likewise. * primary.c (got_delim): Perform correct character range checking for all kinds. * trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate calls to library functions convert_char4_to_char1 and convert_char1_to_char4 for character conversions. (gfc_conv_intrinsic_char): Allow all character kings. (gfc_conv_intrinsic_strcmp): Fix whitespace. (gfc_conv_intrinsic_repeat): Take care of all character kinds. * intrinsic.texi: For all GNU intrinsics accepting character arguments, mention that they're restricted to the default kind. * simplify.c (simplify_achar_char): New function. (gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char. gfc_simplify_ichar): Don't error out for wide characters. (gfc_convert_char_constant): New function. * gfortran.dg/achar_3.f90: Adjust error messages. * gfortran.dg/achar_5.f90: New test. * gfortran.dg/achar_6.F90: New test. * gfortran.dg/widechar_1.f90: New test. * gfortran.dg/widechar_2.f90: New test. * gfortran.dg/widechar_3.f90: New test. * gfortran.dg/widechar_4.f90: New test. * gfortran.dg/widechar_intrinsics_1.f90: New test. * gfortran.dg/widechar_intrinsics_2.f90: New test. * gfortran.dg/widechar_intrinsics_3.f90: New test. * gfortran.dg/widechar_intrinsics_4.f90: New test. * gfortran.dg/widechar_intrinsics_5.f90: New test. * gfortran.dg/widechar_select_1.f90: New test. * gfortran.dg/widechar_select_2.f90: New test. From-SVN: r135515
2008-05-06check.c (gfc_check_sizeof): Switch to ATTRIBUTE_UNUSED.Francois-Xavier Coudert1-1/+1
* check.c (gfc_check_sizeof): Switch to ATTRIBUTE_UNUSED. * simplify.c (gfc_simplify_lgamma): Likewise. From-SVN: r134997
2008-04-30intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.François-Xavier Coudert1-0/+16
* 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