1. 21 Jun, 2006 1 commit
  2. 15 Jun, 2006 1 commit
    • tkoenig's avatar
      2006-06-15 Thomas Koenig <Thomas.Koenig@online.de> · 97944d89
      tkoenig authored
      	* trans-array.h (gfc_trans_create_temp_array):  Add bool
      	argument.
      	* trans-arrray.c (gfc_trans_create_temp_array): Add extra
      	argument "function" to show if we are translating a function.
      	If we are translating a function, perform checks whether
      	the size along any argument is negative.  In that case,
      	allocate size 0.
      	(gfc_trans_allocate_storage):  Add function argument (as
      	false) to gfc_trans_create_temp_array call.
      	* trans-expr.c (gfc_conv_function_call):  Add function
      	argument (as true) to gfc_trans_create_temp_array call.
      	* trans-stmt.c (gfc_conv_elemental_dependencies): Add
      	function argument (as false) to gfc_trans_create_temp_array
      	call.
      	* trans-intrinsic.c:  Likewise.
      
      2006-06-15  Thomas Koenig <Thomas.Koenig@online.de>
      
      	* gfortran.dg/allocate_zerosize_2.f90:  New test case.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114677 138bc75d-0d04-0410-961f-82ee72b054a4
      97944d89
  3. 09 Jun, 2006 1 commit
    • pault's avatar
      2006-06-10 Paul Thomas <pault@gcc.gnu.org> · d77f260f
      pault authored
      	PR fortran/24558
      	PR fortran/20877
      	PR fortran/25047
      	* decl.c (get_proc_name): Add new argument to flag that a
      	module function entry is being treated. If true, correct
      	error condition, add symtree to module namespace and add
      	a module procedure.
      	(gfc_match_function_decl, gfc_match_entry,
      	gfc_match_subroutine): Use the new argument in calls to
      	get_proc_name.
      	* resolve.c (resolve_entries): ENTRY symbol reference to
      	to master entry namespace if a module function.
      	* trans-decl.c (gfc_create_module_variable): Return if
      	the symbol is an entry.
      	* trans-exp.c (gfc_conv_variable): Check that parent_decl
      	is not NULL.
      
      2006-06-10  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/24558
      	* gfortran.dg/entry_6.f90: New test.
      
      	PR fortran/20877
      	PR fortran/25047
      	* gfortran.dg/entry_7.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114526 138bc75d-0d04-0410-961f-82ee72b054a4
      d77f260f
  4. 08 Jun, 2006 1 commit
    • fxcoudert's avatar
      PR fortran/27958 · 2810b378
      fxcoudert authored
      	* trans-expr.c (gfc_conv_substring): If the substring start is
      	greater than its end, the length of the substring is zero, and
      	not negative.
      	(gfc_trans_string_copy): Don't generate a call to
      	_gfortran_copy_string when destination length is zero.
      
      	* gcc/testsuite/gfortran.dg/substr_2.f: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114496 138bc75d-0d04-0410-961f-82ee72b054a4
      2810b378
  5. 03 Jun, 2006 1 commit
    • fxcoudert's avatar
      * trans.c (gfc_msg_bounds, gfc_msg_fault, gfc_msg_wrong_return): · 97c2a00c
      fxcoudert authored
      	Add strings for common runtime error messages.
      	(gfc_trans_runtime_check): Add a locus argument, use a string
      	and not a string tree for the message.
      	* trans.h (gfc_trans_runtime_check): Change prototype accordingly.
      	(gfc_msg_bounds, gfc_msg_fault, gfc_msg_wrong_return): Add proto.
      	* trans-const.c (gfc_strconst_bounds, gfc_strconst_fault,
      	gfc_strconst_wrong_return, gfc_strconst_current_filename): Remove.
      	(gfc_init_constants): Likewise.
      	* trans-const.h: Likewise.
      	* trans-decl.c (gfc_build_builtin_function_decls): Call to
      	_gfortran_runtime_error has only one argument, the message string.
      	* trans-array.h (gfc_conv_array_ref): Add a symbol argument and a
      	locus.
      	* trans-array.c (gfc_trans_array_bound_check): Build precise
      	error messages.
      	(gfc_conv_array_ref): Use the new symbol argument and the locus
      	to build more precise error messages.
      	(gfc_conv_ss_startstride): More precise error messages.
      	* trans-expr.c (gfc_conv_variable): Give symbol reference and
      	locus to gfc_conv_array_ref.
      	(gfc_conv_function_call): Use the new prototype for
      	gfc_trans_runtime_check.
      	* trans-stmt.c (gfc_trans_goto): Build more precise error message.
      	* trans-io.c (set_string): Likewise.
      	* trans-intrinsic.c (gfc_conv_intrinsic_bound): Use new prototype
      	for gfc_trans_runtime_check.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114346 138bc75d-0d04-0410-961f-82ee72b054a4
      97c2a00c
  6. 30 May, 2006 1 commit
    • kargl's avatar
      2006-05-30 Asher Langton <langton2@llnl.gov> · a7c1e504
      kargl authored
      	* symbol.c (check_conflict): Allow external, function, and
      	subroutine attributes with Cray pointees.
      	* trans-expr.c (gfc_conv_function_val): Translate Cray pointees
      	that point to procedures.
      	* gfortran.texi: Document new feature.
      
      	* gfortran.dg/cray_pointers_7.f90: New test.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114252 138bc75d-0d04-0410-961f-82ee72b054a4
      a7c1e504
  7. 20 May, 2006 1 commit
    • hjl's avatar
      gcc/fortran/ · 97f99a6c
      hjl authored
      2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>
      
      	PR fortran/27662
      	* trans-array.c (gfc_conv_expr_descriptor): Don't zere the
      	first stride to indicate a temporary.
      	* trans-expr.c (gfc_conv_function_call): Likewise.
      
      gcc/testsuite/
      
      2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>
      
      	PR fortran/27662
      	* gfortran.dg/temporary_1.f90: New file.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113922 138bc75d-0d04-0410-961f-82ee72b054a4
      97f99a6c
  8. 16 Apr, 2006 1 commit
    • pault's avatar
      2006-04-16 Paul Thomas <pault@gcc.gnu.org> · 10b07432
      pault authored
      	PR fortran/26822
      	* intrinsic.c (add_functions): Mark LOGICAL as elemental.
      
      	PR fortran/26787
      	* expr.c (gfc_check_assign): Extend scope of error to include
      	assignments to a procedure in the main program or, from a
      	module or internal procedure that is not that represented by
      	the lhs symbol. Use VARIABLE rather than l-value in message.
      
      	PR fortran/27096
      	* trans-array.c (gfc_trans_deferred_array): If the backend_decl
      	is not a descriptor, dereference and then test and use the type.
      
      	PR fortran/25597
      	* trans-decl.c (gfc_trans_deferred_vars): Check if an array
      	result, is also automatic character length.  If so, process
      	the character length.
      
      	PR fortran/18803
      	PR fortran/25669
      	PR fortran/26834
      	* trans_intrinsic.c (gfc_walk_intrinsic_bound): Set
      	data.info.dimen for bound intrinsics.
      	* trans_array.c (gfc_conv_ss_startstride): Pick out LBOUND and
      	UBOUND intrinsics and supply their shape information to the ss
      	and the loop.
      
      	PR fortran/27124
      	* trans_expr.c (gfc_trans_function_call):  Add a new block, post,
      	in to which all the argument post blocks are put.  Add this block
      	to se->pre after a byref call or to se->post, otherwise.
      
      2006-04-16  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/26787
      	* gfortran.dg/proc_assign_1.f90: New test.
      	* gfortran.dg/procedure_lvalue.f90: Change message.
      	* gfortran.dg/namelist_4.f90: Add new error.
      
      	PR fortran/27096
      	* gfortran.dg/auto_pointer_array_result_1.f90
      
      	PR fortran/27089
      	* gfortran.dg/specification_type_resolution_1.f90
      
      	PR fortran/18803
      	PR fortran/25669
      	PR fortran/26834
      	* gfortran.dg/bounds_temporaries_1.f90: New test.
      
      	PR fortran/27124
      	* gfortran.dg/array_return_value_1.f90: New test.
      
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112981 138bc75d-0d04-0410-961f-82ee72b054a4
      10b07432
  9. 08 Apr, 2006 1 commit
  10. 03 Apr, 2006 1 commit
    • pault's avatar
      2006-04-03 Paul Thomas <pault@gcc.gnu.org> · bd24f178
      pault authored
      	PR fortran/26981
      	* trans.h : Prototype for gfc_conv_missing_dummy.
      	* trans-expr (gfc_conv_missing_dummy): New function
      	(gfc_conv_function_call): Call it and tidy up some of the code.
      	* trans-intrinsic (gfc_conv_intrinsic_function_args): The same.
      
      	PR fortran/26976
      	* array.c (gfc_array_dimen_size): If available, return shape[dimen].
      	* resolve.c (resolve_function): If available, use the argument shape for the
      	function expression.
      	* iresolve.c (gfc_resolve_transfer): Set shape[0] = size.
      
      2006-04-03  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/26981
      	* gfortran.dg/missing_optional_dummy_1.f90: New test.
      
      	PR fortran/26976
      	* gfortran.dg/compliant_elemental_intrinsics_1.f90: New test.
      	* gfortran.dg/initialization_1.f90: Make assignment compliant.
      	* gfortran.dg/transfer_array_intrinsic_1.f90: Simplify.
      	* gfortran.dg/transfer_array_intrinsic_2.f90: Make assignments compliant and detect
      	bigendian-ness.
      
      
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112634 138bc75d-0d04-0410-961f-82ee72b054a4
      bd24f178
  11. 02 Apr, 2006 1 commit
    • eedelman's avatar
      2006-04-02 Erik Edelmann <eedelman@gcc.gnu.org> · f135d1ce
      eedelman authored
              * trans-array.c (gfc_trans_dealloc_allocated): Take a
              tree representation of the array to be deallocated as argument
              instead of its gfc_symbol.
              (gfc_trans_deferred_array): Update call to
              gfc_trans_dealloc_allocated.
              * trans-array.h (gfc_trans_dealloc_allocated): Update prototype.
              * trans-expr.c (gfc_conv_function_call): Update call to
              gfc_trans_dealloc_allocated, get indirect reference to dummy
              arguments.
      
      
      2006-04-02  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * gfortran.dg/allocatable_dummy_1.f90: Also check that allocatable
              dummy arguments work when the actual argument is itself a dummy
              argument of the caller.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112625 138bc75d-0d04-0410-961f-82ee72b054a4
      f135d1ce
  12. 13 Mar, 2006 1 commit
  13. 10 Mar, 2006 1 commit
    • eedelman's avatar
      fortran/ · d4ef6f9d
      eedelman authored
      2006-03-11  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * symbol.c (check_conflict): Allow allocatable function results,
              except for elemental functions.
              * trans-array.c (gfc_trans_allocate_temp_array): Rename to ...
              (gfc_trans_create_temp_array): ... this, and add new argument callee_alloc.
              (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call
              to gfc_trans_allocate_temp_array.
              * trans-array.h (gfc_trans_allocate_temp_array): Update prototype.
              * trans-expr.c (gfc_conv_function_call): Use new arg of
              gfc_trans_create_temp_array avoid pre-allocation of temporary
              result variables of pointer AND allocatable functions.
              (gfc_trans_arrayfunc_assign): Return NULL for allocatable functions.
              * resolve.c (resolve_symbol): Copy value of 'allocatable' attribute
              from sym->result to sym.
      
      testsuite/
      2006-03-08  Paul Thomas  <pault@gcc.gnu.org>
                  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * gfortran.dg/allocatable_function_1.f90: New.
              * gfortran.dg/allocatable_function_2.f90: New.
      
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111951 138bc75d-0d04-0410-961f-82ee72b054a4
      d4ef6f9d
  14. 09 Mar, 2006 1 commit
    • eedelman's avatar
      fortran/ · 76845580
      eedelman authored
      2006-03-09  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
              attribute from sym to new_sym.  Call build_fold_indirect_ref()
              for allocatable arguments.
      
      testsuite/
      2006-03-09  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * gfortran.dg/allocatable_dummy_1.f90: Test for functions returning
              arrays too.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111910 138bc75d-0d04-0410-961f-82ee72b054a4
      76845580
  15. 06 Mar, 2006 2 commits
    • eedelman's avatar
      fortran/ · ab19f982
      eedelman authored
      2005-03-06  Paul Thomas  <pault@gcc.gnu.org>
                  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * trans-array.c (gfc_trans_dealloc_allocated): New function.
              (gfc_trans_deferred_array): Use it, instead of inline code.
              * trans-array.h: Prototype for gfc_trans_dealloc_allocated().
              * trans-expr.c (gfc_conv_function_call): Deallocate allocated
              ALLOCATABLE, INTENT(OUT) arguments upon procedure entry.
      
      
      testsuite/
      2005-03-06  Paul Thomas  <pault@gcc.gnu.org>
                  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              * gfortran.dg/allocatable_dummy_1.f90: Take into account that
              INTENT(OUT) arguments shall be deallocated upon procedure entry.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111795 138bc75d-0d04-0410-961f-82ee72b054a4
      ab19f982
    • pault's avatar
      2006-03-06 Paul Thomas <pault@gcc.gnu.org> · c750cc52
      pault authored
      	PR fortran/26107
      	* resolve.c (resolve_function): Add name after test for pureness.
      
      	PR fortran/19546
      	* trans-expr.c (gfc_conv_variable): Detect reference to parent result,
      	store current_function_decl, replace with parent, whilst calls are
      	made to gfc_get_fake_result_decl, and restore afterwards. Signal this
      	to gfc_get_fake_result_decl with a new argument, parent_flag.
      	* trans-stmt.c (gfc_trans_return): gfc_get_fake_result_decl 2nd arg
      	is set to zero.
      	* trans.h: Add parent_flag to gfc_get_fake_result_decl prototype.
      	* trans-decl.c (gfc_get_fake_result_decl): On parent_flag, being set,
      	add decl to parent function. Replace refs to current_fake_result_decl
      	with refs to this_result_decl.
      	(gfc_generate_function_code): Null parent_fake_result_decl before the
      	translation of code for contained procedures. Set parent_flag to zero
      	in call to gfc_get_fake_result_decl.
      	* trans-intrinsic.c (gfc_conv_intrinsic_len): The same.
      
      2006-03-06  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/26107
      	* pure_dummy_length_1.f90: New test.
      
      	PR fortran/19546
      	* gfortran.dg/parent_result_ref_1.f90: New test.
      	* gfortran.dg/parent_result_ref_2.f90: New test.
      	* gfortran.dg/parent_result_ref_3.f90: New test.
      	* gfortran.dg/parent_result_ref_4.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111793 138bc75d-0d04-0410-961f-82ee72b054a4
      c750cc52
  16. 05 Mar, 2006 1 commit
    • eedelman's avatar
      fortran/ · 7d19e94d
      eedelman authored
      2005-03-05  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              PR fortran/16136
              * symbol.c (conf_std): New macro.
              (check_conflict): Use it to allow ALLOCATABLE dummy
              arguments for F2003.
              * trans-expr.c (gfc_conv_function_call): Pass the
              address of the array descriptor when dummy argument is
              ALLOCATABLE.
              * interface.c (compare_allocatable): New function.
              (compare_actual_formal): Use it.
              resolve.c (resolve_deallocate_expr,
              resolve_allocate_expr): Check that INTENT(IN) variables
              aren't (de)allocated.
              * gfortran.texi (Fortran 2003 status): List ALLOCATABLE
              dummy arguments as supported.
      
      testsuite/
      2005-03-05  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              PR fortran/16136
              * allocatable_dummy_1.f90: New.
              * allocatable_dummy_2.f90: New.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111741 138bc75d-0d04-0410-961f-82ee72b054a4
      7d19e94d
  17. 16 Feb, 2006 1 commit
    • pault's avatar
      2005-02-16 Paul Thomas <pault@gcc.gnu.org> · e3071e62
      pault authored
      	PR fortran/24557
      	* trans-expr.c (gfc_add_interface_mapping): Use the actual argument
      	for character(*) arrays, rather than casting to the type and kind
      	parameters of the formal argument.
      
      2005-02-16  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/24557
              * gfortran.dg/assumed_charlen_needed_1.f90: New test.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111130 138bc75d-0d04-0410-961f-82ee72b054a4
      e3071e62
  18. 12 Feb, 2006 1 commit
    • eedelman's avatar
      fortran/ · 34da51b6
      eedelman authored
      2006-02-12  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              PR fortran/25806
              * trans-array.c (gfc_trans_allocate_array_storage): New argument
              dealloc; free the temporary only if dealloc is true.
              (gfc_trans_allocate_temp_array): New argument bool dealloc, to be 
              passed onwards to gfc_trans_allocate_array_storage.
              (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
              gfc_trans_allocate_temp_array.
              * trans-array.h (gfc_trans_allocate_temp_array): Update function
              prototype.
              * trans-expr.c (gfc_conv_function_call): Set new argument 'dealloc'
              to gfc_trans_allocate_temp_array to false in case of functions
              returning pointers.
              (gfc_trans_arrayfunc_assign): Return NULL for functions returning
              pointers.
      
      
      testsuite/
      2006-02-12  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              PR fortran/25806
              * gfortran.dg/ret_pointer_2.f90: New test.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110893 138bc75d-0d04-0410-961f-82ee72b054a4
      34da51b6
  19. 10 Feb, 2006 1 commit
    • tobi's avatar
      fortran/ · 42b215cc
      tobi authored
      2006-02-09  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
      
              PR fortran/14771
              * gfortran.h (gfc_intrinsic_op): Add INTRINSIC_PARENTHESES.
              * dump-parse-tree (gfc_show_expr): Handle INTRINSIC_PARENTHESES.
              * expr.c (simplify_intrinsic_op): Treat INTRINSIC_PARENTHESES as
              if it were INTRINSIC_UPLUS.
              * resolve.c (resolve_operator): Handle INTRINSIC_PARENTHESES.
              * match.c (intrinsic_operators): Add INTRINSIC_PARENTHESES.
              * matchexp.c (match_primary): Record parentheses surrounding
              numeric expressions.
              * module.c (intrinsics): Add INTRINSIC_PARENTHESES for module
              dumping.
              * trans-expr.c (gfc_conv_expr_op): Handle INTRINSIC_PARENTHESES.
      
      testsuite/
      2006-02-09  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
              Paul Thomas  <pault@gcc.gnu.org>
      
              PR fortran/14771
              * gfortran.dg/parens_1.f90: New.
              * gfortran.dg/parens_2.f90: New.
              * gfortran.dg/parens_3.f90: New.
      
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110819 138bc75d-0d04-0410-961f-82ee72b054a4
      42b215cc
  20. 06 Feb, 2006 1 commit
    • jakub's avatar
      Backport from gomp-20050608-branch · d4163395
      jakub authored
      	* trans-decl.c (create_function_arglist): Handle dummy functions.
      
      	* trans-decl.c (gfc_get_symbol_decl): Revert explicit setting of
      	TYPE_SIZE_UNIT.
      	(gfc_trans_vla_type_sizes): Also "gimplify"
      	GFC_TYPE_ARRAY_DATAPTR_TYPE for GFC_DESCRIPTOR_TYPE_P types.
      	* trans-array.c (gfc_trans_deferred_array): Call
      	gfc_trans_vla_type_sizes.
      
      	* trans-decl.c (saved_function_decls, saved_parent_function_decls):
      	Remove unnecessary initialization.
      	(create_function_arglist): Make sure __result has complete type.
      	(gfc_get_fake_result_decl): Change current_fake_result_decl into
      	a tree chain.  For entry master, create a separate variable
      	for each result name.  For BT_CHARACTER results, call
      	gfc_finish_var_decl on length even if it has been already created,
      	but not pushdecl'ed.
      	(gfc_trans_vla_type_sizes): For function/entry result, adjust
      	result value type, not the FUNCTION_TYPE.
      	(gfc_generate_function_code): Adjust for current_fake_result_decl
      	changes.
      	(gfc_trans_deferred_vars): Likewise.  Call gfc_trans_vla_type_sizes
      	even on result if it is assumed-length character.
      
      	* trans-decl.c (gfc_trans_dummy_character): Add SYM argument.
      	Call gfc_trans_vla_type_sizes.
      	(gfc_trans_auto_character_variable): Call gfc_trans_vla_type_sizes.
      	(gfc_trans_vla_one_sizepos, gfc_trans_vla_type_sizes_1,
      	gfc_trans_vla_type_sizes): New functions.
      	(gfc_trans_deferred_vars): Adjust gfc_trans_dummy_character
      	callers.  Call gfc_trans_vla_type_sizes on assumed-length
      	character parameters.
      	* trans-array.c (gfc_trans_array_bounds,
      	gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias): Call
      	gfc_trans_vla_type_sizes.
      	* trans.h (gfc_trans_vla_type_sizes): New prototype.
      
      	* trans-decl.c (gfc_build_qualified_array): For non-assumed-size
      	arrays without constant size, create also an index var for
      	GFC_TYPE_ARRAY_SIZE (type).  If the type is incomplete, complete
      	it as 0..size-1.
      	(gfc_create_string_length): Don't call gfc_defer_symbol_init
      	if just creating DECL_ARGUMENTS.
      	(gfc_get_symbol_decl): Call gfc_finish_var_decl and
      	gfc_defer_symbol_init even if ts.cl->backend_decl is already
      	set to a VAR_DECL that doesn't have DECL_CONTEXT yet.
      	(create_function_arglist): Rework, so that hidden length
      	arguments for CHARACTER parameters are created together with
      	the parameters.  Resolve ts.cl->backend_decl for CHARACTER
      	parameters.  If the argument is a non-constant length array
      	or CHARACTER, ensure PARM_DECL has different type than
      	its DECL_ARG_TYPE.
      	(generate_local_decl): Call gfc_get_symbol_decl even
      	for non-referenced non-constant length CHARACTER parameters
      	after optionally issuing warnings.
      	* trans-array.c (gfc_trans_array_bounds): Set last stride
      	to GFC_TYPE_ARRAY_SIZE (type) to initialize it as well.
      	(gfc_trans_dummy_array_bias): Initialize GFC_TYPE_ARRAY_SIZE (type)
      	variable as well.
      
      	* trans-expr.c (gfc_conv_expr_val): Fix comment typo.
      
      	* trans-stmt.c (gfc_trans_simple_do): Fix comment.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110653 138bc75d-0d04-0410-961f-82ee72b054a4
      d4163395
  21. 26 Jan, 2006 1 commit
    • pault's avatar
      2005-01-26 Paul Thomas <pault@gcc.gnu.org> · 5e8cd291
      pault authored
      	PR fortran/25964
      	* resolve.c (resolve_function): Exclude statement functions from
      	global reference checking.
      
      	PR fortran/25084
      	PR fortran/20852
      	PR fortran/25085
      	PR fortran/25086
      	* resolve.c (resolve_function): Declare a gfc_symbol to replace the
      	references through the symtree to the symbol associated with the
      	function expresion. Give error on reference to an assumed character
      	length function is defined in an interface or an external function
      	that is not a dummy argument.
      	(resolve_symbol): Give error if an assumed character length function
      	is array-valued, pointer-valued, pure or recursive. Emit warning
      	that character(*) value functions are obsolescent in F95.
      
      	PR fortran/25416
      	* trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
      	prevents any assumed character length function call from getting here
      	except intrinsics such as SPREAD. In this case, ensure that no
      	segfault occurs from referencing non-existent charlen->length->
      	expr_type and provide a backend_decl for the charlen from the charlen
      	of the first actual argument.
      
      	Cure temp name confusion.
      	* trans-expr.c (gfc_get_interface_mapping_array): Change name of
      	temporary from "parm" to "ifm" to avoid clash with temp coming from
      	trans-array.c.
      
      2005-01-26  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/25964
      	* gfortran.dg/global_references_2.f90: New test.
      
      	PR fortran/25084
      	PR fortran/20852
      	PR fortran/25085
      	PR fortran/25086
      	* gfortran.dg/assumed_charlen_function_1.f90: New test.
      	* gfortran.dg/assumed_charlen_function_3.f90: New test.
      
      	PR fortran/25416
      	* gfortran.dg/assumed_charlen_function_2.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110269 138bc75d-0d04-0410-961f-82ee72b054a4
      5e8cd291
  22. 21 Jan, 2006 1 commit
    • pault's avatar
      2005-01-21 Paul Thomas <pault@gcc.gnu.org> · 858f9894
      pault authored
      	PR fortran/25124
      	PR fortran/25625
      	* decl.c (get_proc_name): If there is an existing
      	symbol in the encompassing namespace, call errors
      	if it is a procedure of the same name or the kind
      	field is set, indicating a type declaration.
      
      	PR fortran/20881
      	PR fortran/23308
      	PR fortran/25538
      	PR fortran/25710
      	* decl.c (add_global_entry): New function to check
      	for existing global symbol with this name and to
      	create new one if none exists.
      	(gfc_match_entry): Call add_global_entry before
      	matching argument lists for subroutine and function
      	entries.
      	* gfortran.h: Prototype for existing function,
      	global_used.
      	* resolve.c (resolve_global_procedure): New function
      	to check global symbols for procedures.
      	(resolve_call, resolve_function): Calls to this
      	new function for non-contained and non-module
      	procedures.
      	* match.c (match_common): Add check for existing
      	global symbol, creat one if none exists and emit
      	error if there is a clash.
      	* parse.c (global_used): Remove static and use the
      	gsymbol name rather than the new_block name, so that
      	the function can be called from resolve.c.
      	(parse_block_data, parse_module, add_global_procedure):
      	Improve checks for existing gsymbols.  Emit error if
      	already defined or if references were to another type.
      	Set defined flag.
      
      	PR fortran/PR24276
      	* trans-expr.c (gfc_conv_aliased_arg): New function called by 
      	gfc_conv_function_call that coverts an expression for an aliased
      	component reference to a derived type array into a temporary array
      	of the same type as the component.  The temporary is passed as an
      	actual argument for the procedure call and is copied back to the
      	derived type after the call.
      	(is_aliased_array): New function that detects an array reference
      	that is followed by a component reference.
      	(gfc_conv_function_call): Detect an aliased actual argument with
      	is_aliased_array and convert it to a temporary and back again
      	using gfc_conv_aliased_arg.
      
      2005-01-21  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/25124
      	PR fortran/25625
      	* gfortran.dg/internal_references_1.f90: New test.
      	  PR fortran/20881
      	PR fortran/23308
      	PR fortran/25538
      	PR fortran/25710
      	* gfortran.dg/global_references_1.f90: New test.
      	* gfortran.dg/g77/19990905-1.f: Restore the error that
      	there is a clash between the common block name and
      	the name of a subroutine reference.
      
      	PR fortran/PR24276
      	* gfortran.dg/aliasing_dummy_1.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110063 138bc75d-0d04-0410-961f-82ee72b054a4
      858f9894
  23. 16 Jan, 2006 1 commit
  24. 09 Jan, 2006 2 commits
    • fengwang's avatar
      Add 2006 copyright year. · 55aef564
      fengwang authored
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109490 138bc75d-0d04-0410-961f-82ee72b054a4
      55aef564
    • fengwang's avatar
      fortran ChangeLog entry: · 77100724
      fengwang authored
      2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>
      
      	PR fortran/12456
      	* trans-expr.c (gfc_to_single_character): New function that converts
      	string to single character if its length is 1.
      	(gfc_build_compare_string):New function that compare string and handle
      	single character specially.
      	(gfc_conv_expr_op): Use gfc_build_compare_string.
      	(gfc_trans_string_copy): Use gfc_to_single_character.
      	* trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
      	gfc_build_compare_string.
      	* trans.h (gfc_build_compare_string): Add prototype.
      
      testsuite ChangeLog entry:
      2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>
      
      	PR fortran/12456
      	* gfortran.dg/single_char_string.f90: New test.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109489 138bc75d-0d04-0410-961f-82ee72b054a4
      77100724
  25. 16 Dec, 2005 3 commits
    • rguenth's avatar
      2005-12-16 Richard Guenther <rguenther@suse.de> · ac47d547
      rguenth authored
      	* trans.h (tree): Remove declaration of gfc_build_function_call.
      	* trans.c (gfc_build_function_call): Remove.
      	(gfc_build_array_ref): Use build_function_call_expr.
      	(gfc_trans_runtime_check): Likewise.
      	* trans-array.c (gfc_trans_allocate_array_storage): Likewise.
      	(gfc_grow_array): Likewise.
      	(gfc_trans_array_ctor_element): Likewise.
      	(gfc_trans_array_constructor_value): Likewise.
      	(gfc_array_allocate): Likewise.
      	(gfc_array_deallocate): Likewise.
      	(gfc_trans_auto_array_allocation): Likewise.
      	(gfc_trans_dummy_array_bias): Likewise.
      	(gfc_conv_array_parameter): Likewise.
      	* trans-expr.c (gfc_conv_power_op): Likewise.
      	(gfc_conv_string_tmp): Likewise.
      	(gfc_conv_concat_op): Likewise.
      	(gfc_conv_expr_op): Likewise.
      	(gfc_trans_string_copy): Likewise.
      	* trans-decl.c (build_entry_thunks): Likewise.
      	(gfc_generate_function_code): Likewise.
      	(gfc_generate_constructors): Likewise.
      	* trans-io.c (gfc_trans_open): Likewise.
      	(gfc_trans_close): Likewise.
      	(build_filepos): Likewise.
      	(gfc_trans_inquire): Likewise.
      	(transfer_namelist_element): Likewise.
      	(build_dt): Likewise.
      	(gfc_trans_dt_end): Likewise.
      	(transfer_expr): Likewise.
      	(transfer_array_desc): Likewise.
      	* trans-stmt.c (gfc_trans_pause): Likewise.
      	(gfc_trans_stop): Likewise.
      	(gfc_trans_character_select): Likewise.
      	(gfc_do_allocate): Likewise.
      	(gfc_trans_assign_need_temp): Likewise.
      	(gfc_trans_pointer_assign_need_temp): Likewise.
      	(gfc_trans_forall_1): Likewise.
      	(gfc_trans_where): Likewise.
      	(gfc_trans_allocate): Likewise.
      	(gfc_trans_deallocate): Likewise.
      	* trans-intrinsic.c (gfc_conv_intrinsic_aint): Likewise.
      	(gfc_conv_intrinsic_lib_function): Likewise.
      	(gfc_conv_intrinsic_exponent): Likewise.
      	(gfc_conv_intrinsic_abs): Likewise.
      	(gfc_conv_intrinsic_sign): Likewise.
      	(gfc_conv_intrinsic_ctime): Likewise.
      	(gfc_conv_intrinsic_fdate): Likewise.
      	(gfc_conv_intrinsic_ttynam): Likewise.
      	(gfc_conv_intrinsic_ishftc): Likewise.
      	(gfc_conv_intrinsic_len_trim): Likewise.
      	(gfc_conv_intrinsic_index): Likewise.
      	(gfc_conv_intrinsic_size): Likewise.
      	(gfc_conv_intrinsic_strcmp): Likewise.
      	(gfc_conv_intrinsic_adjust): Likewise.
      	(gfc_conv_associated): Likewise.
      	(gfc_conv_intrinsic_scan): Likewise.
      	(gfc_conv_intrinsic_verify): Likewise.
      	(call_builtin_clz): Likewise.
      	(gfc_conv_intrinsic_si_kind): Likewise.
      	(gfc_conv_intrinsic_sr_kind): Likewise.
      	(gfc_conv_intrinsic_trim): Likewise.
      	(gfc_conv_intrinsic_repeat): Likewise.
      	(gfc_conv_intrinsic_iargc): Likewise.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108687 138bc75d-0d04-0410-961f-82ee72b054a4
      ac47d547
    • rguenth's avatar
      2005-12-16 Richard Guenther <rguenther@suse.de> · 4fa2c167
      rguenth authored
      	* trans.h (gfc_build_indirect_ref): Remove declaration.
      	* trans.c (gfc_build_indirect_ref): Remove.
      	* trans-array.c (gfc_trans_array_ctor_element): Use
      	build_fold_indirect_ref instead of gfc_build_indirect_ref.
      	(gfc_trans_array_constructor_value): Likewise.
      	(gfc_conv_array_index_offset): Likewise.
      	(gfc_conv_scalarized_array_ref): Likewise.
      	(gfc_conv_array_ref): Likewise.
      	(gfc_trans_dummy_array_bias): Likewise.
      	(gfc_conv_expr_descriptor): Likewise.
      	(gfc_conv_array_parameter): Likewise.
      	* trans-decl.c (gfc_finish_cray_pointee): Likewise.
      	(gfc_get_symbol_decl): Likewise.
      	* trans-expr.c (gfc_conv_substring): Likewise.
      	(gfc_conv_component_ref): Likewise.
      	(gfc_conv_variable): Likewise.
      	(gfc_add_interface_mapping): Likewise.
      	(gfc_conv_function_call): Likewise.
      	* trans-intrinsic.c (gfc_conv_intrinsic_ichar): Likewise.
      	(gfc_conv_intrinsic_transfer): Likewise.
      	* trans-io.c (nml_get_addr_expr): Likewise.
      	(transfer_namelist_element): Likewise.
      	(transfer_expr): Likewise.
      	* trans-stmt.c (gfc_trans_nested_forall_loop): Likewise.
      	(allocate_temp_for_forall_nest_1): Likewise.
      	(gfc_trans_forall_1): Likewise.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108678 138bc75d-0d04-0410-961f-82ee72b054a4
      4fa2c167
    • rguenth's avatar
      2005-12-16 Richard Guenther <rguenther@suse.de> · 9596685a
      rguenth authored
      	(gfc_conv_descriptor_data_addr): Use build_fold_addr_expr where
      	appropriate.
      	(gfc_trans_allocate_array_storage): Likewise.
      	(gfc_trans_array_constructor_value): Likewise.
      	(gfc_conv_array_data): Likewise.
      	(gfc_conv_expr_descriptor): Likewise.
      	(gfc_conv_array_parameter): Likewise.
      	(gfc_conv_variable): Likewise.
      	(gfc_conv_function_val): Likewise.
      	(gfc_conv_function_call): Likewise.
      	(gfc_conv_expr_reference): Likewise.
      	(gfc_conv_intrinsic_ctime): Likewise.
      	(gfc_conv_intrinsic_fdate): Likewise.
      	(gfc_conv_intrinsic_ttynam): Likewise.
      	(gfc_conv_intrinsic_si_kind): Likewise.
      	(gfc_conv_intrinsic_trim): Likewise.
      	(set_parameter_ref): Likewise.
      	(gfc_convert_array_to_string): Likewise.
      	(gfc_trans_open): Likewise.
      	(gfc_trans_close): Likewise.
      	(build_filepos): Likewise.
      	(gfc_trans_inquire): Likewise.
      	(nml_get_addr_expr): Likewise.
      	(transfer_namelist_element): Likewise.
      	(build_dt): Likewise.
      	(gfc_trans_dt_end): Likewise.
      	(transfer_array_component): Likewise.
      	(transfer_expr): Likewise.
      	(transfer_array_desc): Likewise.
      	(gfc_trans_transfer): Likewise.
      	(gfc_trans_allocate): Likewise.
      	(gfc_trans_deallocate): Likewise.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108633 138bc75d-0d04-0410-961f-82ee72b054a4
      9596685a
  26. 13 Dec, 2005 2 commits
    • rguenth's avatar
      2005-12-13 Richard Guenther <rguenther@suse.de> · ce825331
      rguenth authored
      	* trans-expr.c (gfc_conv_substring): Use fold_build2 and
      	build_int_cst.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108476 138bc75d-0d04-0410-961f-82ee72b054a4
      ce825331
    • rsandifo's avatar
      gcc/fortran/ · 018ef8b8
      rsandifo authored
      	* Make-lang.in (fortran/trans-resolve.o): Depend on
      	fortran/dependency.h.
      	* gfortran.h (gfc_expr): Add an "inline_noncopying_intrinsic" flag.
      	* dependency.h (gfc_get_noncopying_intrinsic_argument): Declare.
      	(gfc_check_fncall_dependency): Change prototype.
      	* dependency.c (gfc_get_noncopying_intrinsic_argument): New function.
      	(gfc_check_argument_var_dependency): New function, split from
      	gfc_check_fncall_dependency.
      	(gfc_check_argument_dependency): New function.
      	(gfc_check_fncall_dependency): Replace the expression parameter with
      	separate symbol and argument list parameters.  Generalize the function
      	to handle dependencies for any type of expression, not just variables.
      	Accept a further argument giving the intent of the expression being
      	tested.  Ignore	intent(in) arguments if that expression is also
      	intent(in).
      	* resolve.c: Include dependency.h.
      	(find_noncopying_intrinsics): New function.
      	(resolve_function, resolve_call): Call it on success.
      	* trans-array.h (gfc_conv_array_transpose): Declare.
      	(gfc_check_fncall_dependency): Remove prototype.
      	* trans-array.c (gfc_conv_array_transpose): New function.
      	* trans-intrinsic.c (gfc_conv_intrinsic_function): Don't use the
      	libcall handling if the expression is to be evaluated inline.
      	Add a case for handling inline transpose()s.
      	* trans-expr.c (gfc_trans_arrayfunc_assign): Adjust for the new
      	interface provided by gfc_check_fncall_dependency.
      
      libgfortran/
      	* m4/matmul.m4: Use a different order in the special case of a
      	transposed first argument.
      	* generated/matmul_c4.c, generated/matmul_c8.c, generated/matmul_c10.c,
      	* generated/matmul_c16.c, generated/matmul_i4.c, generated/matmul_i8.c,
      	* generated/matmul_i10.c, generated/matmul_r4.c, generated/matmul_r8.c
      	* generated/matmul_r10.c, generated/matmul_r16.c: Regenerated.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108459 138bc75d-0d04-0410-961f-82ee72b054a4
      018ef8b8
  27. 02 Nov, 2005 1 commit
    • pinskia's avatar
      2005-11-02 Andrew Pinski <pinskia@physics.uc.edu> · 376a3611
      pinskia authored
              PR fortran/18157
              * gfortran.fortran-torture/compile/defined_type_1.f90: New test.
              * gfortran.fortran-torture/compile/defined_type_2.f90: New
              test.   
              * gfortran.fortran-torture/compile/defined_type_3.f90:
              New test.
      
      2005-11-02  Andrew Pinski  <pinskia@physics.uc.edu>
      
              PR fortran/18157
              * trans-array.c (gfc_conv_resolve_dependencies): Use the correct
              type for the temporary array.
              * trans-expr.c (gfc_trans_assignment): Pass lss
              instead of lss_section
              to gfc_conv_resolve_dependencies to get the
              correct type.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106396 138bc75d-0d04-0410-961f-82ee72b054a4
      376a3611
  28. 30 Oct, 2005 1 commit
    • eedelman's avatar
      fortran/ · 7af6a4af
      eedelman authored
      2005-10-30  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              PR fortran/18883
              * trans-decl.c (gfc_finish_var_decl): Add decl to the
              current function, rather than the parent.  Make
              assertion accept fake result variables.
              * trans-expr.c (gfc_conv_variable): If the character
              length of an ENTRY isn't set, get the length from
              the master function instead.
      
      testsuite
      2005-10-30  Erik Edelmann  <eedelman@gcc.gnu.org>
      
              PR fortran/18883
              * gfortran.dg/char_result_9.f90: New.
              * gfortran.dg/char_result_10.f90: New.
      
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106254 138bc75d-0d04-0410-961f-82ee72b054a4
      7af6a4af
  29. 25 Oct, 2005 1 commit
    • jakub's avatar
      * trans.h (gfc_conv_cray_pointee): Remove. · b7bf3f81
      jakub authored
      	* trans-expr.c (gfc_conv_variable): Revert 2005-10-24 change.
      	* trans-array.c (gfc_conv_array_parameter): Likewise.
      	* trans-decl.c (gfc_conv_cray_pointee): Remove.
      	(gfc_finish_cray_pointee): New function.
      	(gfc_finish_var_decl): Use it.  Don't return early for Cray
      	pointees.
      	(gfc_create_module_variable): Revert 2005-10-24 change.
      	* decl.c (cray_pointer_decl): Update comment.
      	* gfortran.texi: Don't mention Cray pointees aren't visible in the
      	debugger.
      
      	* symbol.c (check_conflict): Add conflict between cray_pointee
      	and in_common resp. in_equivalence.
      	* resolve.c (resolve_equivalence): Revert 2005-10-24 change.
      testsuite/
      	* gfortran.dg/cray_pointers_4.f90: New test.
      
      	* module.c (ab_attribute): Add AB_CRAY_POINTER and AB_CRAY_POINTEE.
      	(attr_bits): Likewise.
      	(mio_symbol_attribute): Save and restore cray_pointe{r,e} attributes.
      	(mio_symbol): For cray_pointee write/read cp_pointer reference.
      testsuite/
      	* gfortran.dg/cray_pointers_5.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105891 138bc75d-0d04-0410-961f-82ee72b054a4
      b7bf3f81
  30. 24 Oct, 2005 1 commit
    • steven's avatar
      Commit for Asher Langton · b549d2a5
      steven authored
      	PR fortran/17031
      	PR fortran/22282
      
      fortran/
      	* check.c (gfc_check_loc) : New function
      	* decl.c (variable_decl): New variables cp_as and sym. Added a
      	check for variables that have already been declared as Cray
      	Pointers, so we can get the necessary attributes without adding
      	a new symbol.
      	(attr_decl1): Added code to catch pointee symbols and "fix"
      	their array specs.
      	(cray_pointer_decl): New method.
      	(gfc_match_pointer): Added Cray pointer parsing code.
      	(gfc_mod_pointee_as): New method.
      	* expr.c (gfc_check_assign): added a check to catch vector-type
      	assignments to pointees with an unspecified final dimension.
      	* gfortran.h: (GFC_ISYM_LOC): New.
      	(symbol_attribute): Added cray_pointer and cray_pointee bits.
      	(gfc_array_spec): Added cray_pointee and cp_was_assumed bools.
      	(gfc_symbol): Added gfc_symbol *cp_pointer.
      	(gfc_option): Added flag_cray_pointer.
      	(gfc_add_cray_pointee): Declare.
      	(gfc_add_cray_pointer ): Declare.
      	(gfc_mod_pointee_as): Declare.
      	* intrinsic.c (add_functions): Add code for loc() intrinsic.
      	* intrinsic.h (gfc_check_loc): Declare.
      	(gfc_resolve_loc): Declare.
      	* iresolve.c (gfc_resolve_loc): New.
      	* lang.opt: Added fcray-pointer flag.
      	* options.c (gfc_init_options): Intialized
      	gfc_match_option.flag_cray_pointer.
      	(gfc_handle_option): Deal with -fcray-pointer.
      	* parse.c:(resolve_equivalence): Added code prohibiting Cray
      	pointees in equivalence statements.
      	* resolve.c (resolve_array_ref): Added code to prevent bounds
      	checking for Cray Pointee arrays.
      	(resolve_equivalence): Prohibited pointees in equivalence
      	statements.
      	* symbol.c (check_conflict): Added Cray pointer/pointee
      	attribute checking.
      	(gfc_add_cray_pointer): New
      	(gfc_add_cray_pointee): New
      	(gfc_copy_attr): New code for Cray pointers and pointees
      	* trans-array.c (gfc_trans_auto_array_allocation): Added code to
      	prevent space from being allocated for pointees.
      	(gfc_conv_array_parameter): Added code to catch pointees and
      	correctly set their base address.
      	* trans-decl.c (gfc_finish_var_decl): Added code to prevent
      	pointee declarations from making it to the back end.
      	(gfc_create_module_variable): Same.
      	* trans-expr.c (gfc_conv_variable): added code to detect and
      	translate pointees.
      	(gfc_conv_cray_pointee): New.
      	* trans-intrinsic.c (gfc_conv_intrinsic_loc): New.
      	(gfc_conv_intrinsic_function): added entry point for loc
      	translation.
      	* trans.h (gfc_conv_cray_pointee): Declare.
      
      	* gfortran.texi: Added section on Cray pointers, removed Cray
      	pointers from list of proposed extensions
      	* intrinsic.texi: Added documentation for loc intrinsic.
      	* invoke.texi: Documented -fcray-pointer flag
      
      testsuite/
      	PR fortran/17031
      	PR fortran/22282
      	* gfortran.dg/cray_pointers_1.f90: New test.
      	* gfortran.dg/cray_pointers_2.f90: New test.
      	* gfortran.dg/cray_pointers_3.f90: New test.
      	* gfortran.dg/loc_1.f90: New test.
      	* gfortran.dg/loc_2.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105859 138bc75d-0d04-0410-961f-82ee72b054a4
      b549d2a5
  31. 23 Oct, 2005 1 commit
    • pault's avatar
      2005-10-23 Paul Thomas <pault@gcc.gnu.org> · 70464f87
      pault authored
      	PR fortran/18022
      	* trans-expr.c (gfc_trans_arrayfunc_assign): Return NULL
      	if there is a component ref during an array ref to force
      	use of temporary in assignment.
      
      	PR fortran/24311
      	PR fortran/24384
      	* fortran/iresolve.c (check_charlen_present): New function to
      	add a charlen to the typespec, in the case of constant
      	expressions.
      	(gfc_resolve_merge, gfc_resolve_spread): Call.the above.
      	(gfc_resolve_spread): Make calls to library functions that
      	handle the case of the spread intrinsic with a scalar source.
      	* libgfortran/intrinsics/spread_generic.c (spread_internal
      	_scalar): New function that handles the special case of spread
      	with a scalar source. This has interface functions -
      	(spread_scalar, spread_char_scalar): New functions to interface
      	with the calls specified in gfc_resolve_spread.
      
      2005-10-23  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/18022
      	gfortran.dg/assign_func_dtcomp_1.f90: New test.
      
      	PR fortran/24311
      	gfortran.dg/merge_char_const.f90: New test.
      
      	PR fortran/24384
      	gfortran.dg/spread_scalar_source.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105810 138bc75d-0d04-0410-961f-82ee72b054a4
      70464f87
  32. 03 Oct, 2005 1 commit
    • fxcoudert's avatar
      PR libfortran/19308 · 920e54ef
      fxcoudert authored
      	PR fortran/20120
      	PR libfortran/22437
      
      	* Makefile.am: Add generated files for large real and integers
      	kinds. Add a rule to create the kinds.inc c99_protos.inc files.
      	Use kinds.inc to preprocess Fortran generated files.
      	* libgfortran.h: Add macro definitions for GFC_INTEGER_16_HUGE,
      	GFC_REAL_10_HUGE and GFC_REAL_16_HUGE. Add types gfc_array_i16,
      	gfc_array_r10, gfc_array_r16, gfc_array_c10, gfc_array_c16,
      	gfc_array_l16.
      	* mk-kinds-h.sh: Define macros HAVE_GFC_LOGICAL_* and
      	HAVE_GFC_COMPLEX_* when these types are available.
      	* intrinsics/ishftc.c (ishftc16): New function for GFC_INTEGER_16.
      	* m4/all.m4, m4/any.m4, m4/count.m4, m4/cshift1.m4, m4/dotprod.m4,
      	m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, m4/eoshift3.m4,
      	m4/exponent.m4, m4/fraction.m4, m4/in_pack.m4, m4/in_unpack.m4,
      	m4/matmul.m4, m4/matmull.m4, m4/maxloc0.m4, m4/maxloc1.m4,
      	m4/maxval.m4, m4/minloc0.m4, m4/minloc1.m4, m4/minval.m4, m4/mtype.m4,
      	m4/nearest.m4, m4/pow.m4, m4/product.m4, m4/reshape.m4,
      	m4/set_exponent.m4, m4/shape.m4, m4/specific.m4, m4/specific2.m4,
      	m4/sum.m4, m4/transpose.m4: Protect generated functions with
      	appropriate "#if defined (HAVE_GFC_type_kind)" preprocessor directives.
      	* Makefile.in: Regenerate.
      	* all files in generated/: Regenerate.
      
      	* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Add support for long
      	double builtin function.
      	(gfc_init_builtin_functions): Add mfunc_longdouble,
      	mfunc_clongdouble and func_clongdouble_longdouble trees. Build
      	them for round, trunc, cabs, copysign and pow functions.
      	* iresolve.c (gfc_resolve_reshape, gfc_resolve_transpose): Add
      	case for kind 10 and 16.
      	* trans-decl.c: Add trees for cpowl10, cpowl16, ishftc16,
      	exponent10 and exponent16.
      	(gfc_build_intrinsic_function_decls): Build nodes for int16,
      	real10, real16, complex10 and complex16 types. Build all possible
      	combinations for function _gfortran_pow_?n_?n. Build function
      	calls cpowl10, cpowl16, ishftc16, exponent10 and exponent16.
      	* trans-expr.c (gfc_conv_power_op): Add case for integer(16),
      	real(10) and real(16).
      	* trans-intrinsic.c: Add suppport for long double builtin
      	functions in BUILT_IN_FUNCTION, LIBM_FUNCTION and LIBF_FUNCTION
      	macros.
      	(gfc_conv_intrinsic_aint): Add case for integer(16), real(10) and
      	real(16) kinds.
      	(gfc_build_intrinsic_lib_fndecls): Add support for real10_decl
      	and real16_decl in library functions.
      	(gfc_get_intrinsic_lib_fndecl): Add cases for real and complex
      	kinds 10 and 16.
      	(gfc_conv_intrinsic_exponent): Add cases for real(10) and real(16)
      	kinds.
      	(gfc_conv_intrinsic_sign): Likewise.
      	(gfc_conv_intrinsic_ishftc): Add case for integer(16) kind.
      	* trans-types.c (gfc_get_int_type, gfc_get_real_type,
      	gfc_get_complex_type, gfc_get_logical_type): Doesn't error out in
      	the case of kinds not available.
      	* trans.h: Declare trees for cpowl10, cpowl16, ishftc16,
      	exponent10 and exponent16.
      
      	* gfortran.dg/large_real_kind_2.F90: New test.
      	* gfortran.dg/large_integer_kind_2.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104889 138bc75d-0d04-0410-961f-82ee72b054a4
      920e54ef
  33. 13 Sep, 2005 1 commit
    • tobi's avatar
      · 08349c53
      tobi authored
      2005-09-13  Erik Edelmann  <erik.edelmann@iki.fi>
      fortran/
      	PR fortran/17740
      	* trans-expr.c (gfc_trans_arrayfunc_assign): Check value
      	of attr.elemental for specific function instead of generic name.
      testsuite/
      	PR fortran/17740
      	* gfortran.dg/generic_4.f90: New test.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104240 138bc75d-0d04-0410-961f-82ee72b054a4
      08349c53
  34. 09 Sep, 2005 2 commits
    • rsandifo's avatar
      PR fortran/19239 · c99d633f
      rsandifo authored
      	* Makefile.in (fortran/trans-expr.o): Depend on dependency.h.
      	* dependency.h (gfc_ref_needs_temporary_p): Declare.
      	* dependency.c (gfc_ref_needs_temporary_p): New function.
      	(gfc_check_fncall_dependency): Use it instead of inlined check.
      	By so doing, take advantage of the fact that character substrings
      	within an array reference also need a temporary.
      	* trans.h (GFC_SS_VECTOR): Adjust comment.
      	* trans-array.c (gfc_free_ss): Remove GFC_SS_VECTOR case.
      	(gfc_set_vector_loop_bounds): New function.
      	(gfc_add_loop_ss_code): Call it after evaluating the subscripts of
      	a GFC_SS_SECTION.  Deal with the GFC_SS_VECTOR case by evaluating
      	the vector expression and caching its descriptor for use within
      	the loop.
      	(gfc_conv_array_index_ref, gfc_conv_vector_array_index): Delete.
      	(gfc_conv_array_index_offset): Handle scalar, vector and range
      	dimensions as separate cases of a switch statement.  In the vector
      	case, use the loop variable to calculate a vector index and use the
      	referenced element as the dimension's index.  Perform bounds checking
      	on this final index.
      	(gfc_conv_section_upper_bound): Return null for vector indexes.
      	(gfc_conv_section_startstride): Give vector indexes a start value
      	of 0 and a stride of 1.
      	(gfc_conv_ss_startstride): Adjust for new GFC_SS_VECTOR representation.
      	(gfc_conv_expr_descriptor): Expand comments.  Generalize the
      	handling of the !want_pointer && !direct_byref case.  Use
      	gfc_ref_needs_temporary_p to decide whether the variable case
      	needs a temporary.
      	(gfc_walk_variable_expr): Handle DIMEN_VECTOR by creating a
      	GFC_SS_VECTOR index.
      	* trans-expr.c: Include dependency.h.
      	(gfc_trans_arrayfunc_assign): Fail if the target needs a temporary.
      
      2005-09-09  Richard Sandiford  <richard@codesourcery.com>
      
      	PR fortran/21104
      	* trans.h (gfc_interface_sym_mapping, gfc_interface_mapping): Moved
      	from trans-expr.c.
      	(gfc_init_interface_mapping, gfc_free_interface_mapping)
      	(gfc_add_interface_mapping, gfc_finish_interface_mapping)
      	(gfc_apply_interface_mapping): Declare.
      	* trans-array.h (gfc_set_loop_bounds_from_array_spec): Declare.
      	(gfc_trans_allocate_temp_array): Add pre and post block arguments.
      	* trans-array.c (gfc_set_loop_bounds_from_array_spec): New function.
      	(gfc_trans_allocate_array_storage): Replace loop argument with
      	separate pre and post blocks.
      	(gfc_trans_allocate_temp_array): Add pre and post block arguments.
      	Update call to gfc_trans_allocate_array_storage.
      	(gfc_trans_array_constructor, gfc_conv_loop_setup): Adjust for new
      	interface to gfc_trans_allocate_temp_array.
      	* trans-expr.c (gfc_interface_sym_mapping, gfc_interface_mapping):
      	Moved to trans.h.
      	(gfc_init_interface_mapping, gfc_free_interface_mapping)
      	(gfc_add_interface_mapping, gfc_finish_interface_mapping)
      	(gfc_apply_interface_mapping): Make extern.
      	(gfc_conv_function_call): Build an interface mapping for array
      	return values too.  Call gfc_set_loop_bounds_from_array_spec.
      	Adjust call to gfc_trans_allocate_temp_array so that code is
      	added to SE rather than LOOP.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104077 138bc75d-0d04-0410-961f-82ee72b054a4
      c99d633f
    • rsandifo's avatar
      PR fortran/21104 · f45a476e
      rsandifo authored
      	* trans.h (gfc_interface_sym_mapping, gfc_interface_mapping): Moved
      	from trans-expr.c.
      	(gfc_init_interface_mapping, gfc_free_interface_mapping)
      	(gfc_add_interface_mapping, gfc_finish_interface_mapping)
      	(gfc_apply_interface_mapping): Declare.
      	* trans-array.h (gfc_set_loop_bounds_from_array_spec): Declare.
      	(gfc_trans_allocate_temp_array): Add pre and post block arguments.
      	* trans-array.c (gfc_set_loop_bounds_from_array_spec): New function.
      	(gfc_trans_allocate_array_storage): Replace loop argument with
      	separate pre and post blocks.
      	(gfc_trans_allocate_temp_array): Add pre and post block arguments.
      	Update call to gfc_trans_allocate_array_storage.
      	(gfc_trans_array_constructor, gfc_conv_loop_setup): Adjust for new
      	interface to gfc_trans_allocate_temp_array.
      	* trans-expr.c (gfc_interface_sym_mapping, gfc_interface_mapping):
      	Moved to trans.h.
      	(gfc_init_interface_mapping, gfc_free_interface_mapping)
      	(gfc_add_interface_mapping, gfc_finish_interface_mapping)
      	(gfc_apply_interface_mapping): Make extern.
      	(gfc_conv_function_call): Build an interface mapping for array
      	return values too.  Call gfc_set_loop_bounds_from_array_spec.
      	Adjust call to gfc_trans_allocate_temp_array so that code is
      	added to SE rather than LOOP.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104075 138bc75d-0d04-0410-961f-82ee72b054a4
      f45a476e