Commit Graph

2107 Commits

Author SHA1 Message Date
Kaveh R. Ghazi 36c713e04c configure.ac (MPFR check): Bump minimum version to 2.3.0 and recommended version to 2.3.2.
* configure.ac (MPFR check): Bump minimum version to 2.3.0 and
	recommended version to 2.3.2.

	* configure: Regenerate.

gcc:
	* builtins.c: Remove MPFR_VERSION_NUM(2,3,0) conditionals.
	* doc/install.texi: Bump recommended MPFR to 2.3.2.
	
fortran:
	* simplify.c: Remove MPFR_VERSION_NUM(2,3,0) conditionals.

From-SVN: r141085
2008-10-13 08:05:25 +00:00
Daniel Kraft ed42adef44 re PR fortran/37688 (Relax "Symbol is used before it is typed" checking)
2008-10-12  Daniel Kraft  <d@domob.eu>

	PR fortran/37688
	* expr.c (gfc_expr_check_typed): Extend permission of untyped
	expressions to both top-level variable and basic arithmetic expressions.

2008-10-12  Daniel Kraft  <d@domob.eu>

	PR fortran/37688
	* gfortran.dg/used_before_typed_6.f90: New test.

From-SVN: r141074
2008-10-12 12:51:11 +02:00
Paul Thomas b803690ae1 re PR fortran/37787 (right-left hand side overlap not recognized with EQUIVALENCEd array assignment)
2008-10-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37787
	* dependency.c (gfc_are_equivalenced_arrays): Look in symbol
	namespace rather than current namespace, if it is available.

2008-10-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37787
	* gfortran.dg/module_equivalence_5.f90: New test.

From-SVN: r141073
2008-10-12 10:46:14 +00:00
Steven G. Kargl 7a99defe0d re PR fortran/37792 (ICE in gfc_conv_array_initializer; works with -fno-range-check)
2008-10-12  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/37792
	* fortran/resolve.c (resolve_fl_variable): Simplify the
	initializer if there is one.

2008-10-12  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/37792
	* gfortran.dg/arithmetic_overflow_1.f90: New test.

From-SVN: r141072
2008-10-12 09:38:18 +00:00
Paul Thomas 91a9632ca5 re PR fortran/37794 (Fortran module overloading regression)
2008-10-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37794
	* module.c (check_for_ambiguous): Remove redundant code.

2008-10-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37794
	* gfortran.dg/used_types_24.f90: New test.

From-SVN: r141057
2008-10-11 12:09:23 +00:00
Daniel Kraft a3d3c0f5fa re PR fortran/35723 (Can't use run-time array element in character declaration)
2008-10-09  Daniel Kraft  <d@domob.eu>

	PR fortran/35723
	* gfortran.h (gfc_suppress_error): Removed from header.
	(gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
	* array.c (gfc_array_size): Use new gfc_push/pop_suppress_errors
	instead of directly changing gfc_suppress_error.
	* intrinsic.c (gfc_intrinsic_func_interface): Ditto.
	(gfc_intrinsic_sub_interface): Ditto.
	* error.c (suppress_errors): Made static from `gfc_suppress_error'.
	(gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
	(gfc_notify_std), (gfc_error): Use new static name of global.
	* expr.c (check_arglist), (check_references): New methods.
	(check_restricted): Check arglists and references of EXPR_FUNCTIONs
	and EXPR_VARAIBALEs, respectively.  Allow PARAMETER symbols.

2008-10-09  Daniel Kraft  <d@domob.eu>

	PR fortran/35723
	* gfortran.dg/restricted_expression_1.f90: New test.
	* gfortran.dg/restricted_expression_2.f90: New test.
	* gfortran.dg/restricted_expression_3.f90: New test.

From-SVN: r141001
2008-10-09 09:28:22 +02:00
Jakub Jelinek c7c79a09d6 f95-lang.c (poplevel): Don't clear BLOCK_VARS if functionbody.
* f95-lang.c (poplevel): Don't clear BLOCK_VARS if functionbody.
	* trans-decl.c (gfc_build_qualified_array): Build accurate debug type
	even if nest.
	(build_entry_thunks, gfc_generate_function_code,
	gfc_generate_constructors): Ensure DECL_SAVED_TREE is a BIND_EXPR
	with DECL_INITIAL as its BLOCK.

From-SVN: r140945
2008-10-07 20:15:32 +02:00
Paul Thomas ebb479cd4d re PR fortran/35680 (ICE on invalid transfer in variable declaration)
2008-10-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/35680
	* gfortran.h : Add 'error' bit field to gfc_expr structure.
	* expr.c (check_inquiry): When checking a restricted expression
	check that arguments are either variables or restricted.
	(check_restricted): Do not emit error if the expression has
	'error' set.  Clean up detection of host-associated variable.

2008-10-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/35680
	* gfortran.dg/transfer_array_intrinsic_5.f90: New test.

From-SVN: r140892
2008-10-05 18:53:19 +00:00
Daniel Kraft b82657f4a8 re PR fortran/37638 (ICE in update_arglist_pass)
2008-10-05  Daniel Kraft  <d@domob.eu>

	PR fortran/37638
	* gfortran.h (struct gfc_typebound_proc): New flag `error'.
	* resolve.c (update_arglist_pass): Added assertion.
	(update_compcall_arglist): Fail early for erraneous procedures to avoid
	confusion later.
	(resolve_typebound_generic_call): Ignore erraneous specific targets
	and added assertions.
	(resolve_typebound_procedure): Set new `error' flag.

2008-10-05  Daniel Kraft  <d@domob.eu>

	PR fortran/37638
	* gfortran.dg/typebound_call_9.f03: New test.

From-SVN: r140880
2008-10-05 08:39:37 +02:00
Paul Thomas ee9ef10338 re PR fortran/37706 (ICE with use only and equivalent)
2008-10-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37706
	* module.c (load_equiv): Check the module before negating the
	unused flag.

2008-10-04  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37706
	* gfortran.dg/module_equivalence_4.f90: New test.

From-SVN: r140879
2008-10-05 05:50:00 +00:00
Steven Bosscher 414f00e997 re PR fortran/37635 (Fortran 2008: Support LEADZ / TRAILZ)
testsuite
	* gfortran.fortran-torture/execute/intrinsic_leadz.f90: New test.
	* gfortran.fortran-torture/execute/intrinsic_trailz.f90: New test.

fortran/
	PR fortran/37635
	* intrinsic.c (add_functions): Add LEADZ and TRAILZ as generics.
	* intrinsic.h (gfc_simplify_leadz, gfc_simplify_trailz): New protos.
	* gfortran.h <enum gfc_isym_id>: (GFC_ISYM_LEADZ, GFC_ISYM_TRAILZ): New.
	* f95-lang (gfc_init_builtin_functions): Add BUILT_IN_CLZ,
	BUILT_IN_CLZL, BUILT_IN_CLZLL, BUILT_IN_CTZ, BUILT_IN_CTZL, and
	BUILT_IN_CTZLL.
	* trans-intrinsic.c (gfc_conv_intrinsic_leadz,
	gfc_conv_intrinsic_trails): New code-generation functions for LEADZ
	and TRAILZ intrinsics.
	(gfc_conv_intrinsic_function): Use them
	* intrinsic.texi: Add documentation for LEADZ and TRAILZ.
	* simplify.c (gfc_simplify_leadz, gfc_simplify_trailz): New functions.

From-SVN: r140837
2008-10-02 18:51:12 +00:00
Janus Weil 00625faea4 re PR fortran/36592 (F2003: Procedure pointer in COMMON)
2008-09-30  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/36592
        * symbol.c (check_conflict): If a symbol in a COMMON block is a
        procedure, it must be a procedure pointer.
        (gfc_add_in_common): Symbols in COMMON blocks may be variables or
        procedure pointers.
        * trans-types.c (gfc_sym_type): Make procedure pointers in
        * COMMON
        blocks work.


2008-09-30  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/36592
        * gfortran.dg/proc_ptr_common_1.f90: New.
        * gfortran.dg/proc_ptr_common_2.f90: New.

From-SVN: r140790
2008-09-30 17:19:25 +02:00
Jerry DeLisle 5e1bdeb75f re PR fortran/37498 (Incorrect array value returned - 4.3 ABI Broken)
2008-09-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR fortran/37498
	* trans-io.c (build_dt): Revert previous patch..
	* ioparm.def: Delete IOPARM_dt_f2003.

From-SVN: r140683
2008-09-26 06:15:21 +00:00
Tobias Burnus 3dcc3ef2a1 re PR fortran/37504 (Wrongly rejects: unprotected_pointer => protected_pointer)
2008-09-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37504
        * expr.c (gfc_check_pointer_assign): Allow assignment of
        protected pointers.
        * match.c (gfc_match_assignment,gfc_match_pointer_assignment):
        Remove unreachable code.

2008-09-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37504
        * gfortran.dg/protected_7.f90: New test.

From-SVN: r140663
2008-09-25 17:01:16 +02:00
Tobias Burnus 5fb41e29c6 options.c (set_default_std_flags,gfc_init_options): Add comment: keep in sync with libgfortran.
2008-09-24  Tobias Burnus  <burnus@net-b.de>

        * options.c (set_default_std_flags,gfc_init_options):
        Add comment: keep in sync with libgfortran.

2008-09-24  Tobias Burnus  <burnus@net-b.de>

        * runtime/compile_options.c (init_compile_options):
        Sync flags with front end.

From-SVN: r140625
2008-09-24 09:08:22 +02:00
Tobias Burnus a9b98c2c55 re PR fortran/37626 (ICE for automatic deallocation of character result variable)
2008-09-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37626
        * trans-array.c (gfc_trans_deferred_array): Don't auto-deallocate
        result variables.

2008-09-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37626
        * gfortran.dg/allocatable_function_4.f90: New test.

From-SVN: r140624
2008-09-24 09:01:18 +02:00
Daniel Kraft f0ac18b799 re PR fortran/37588 (GENERIC type-bound procedure is not resolved)
2008-09-23  Daniel Kraft  <d@domob.eu>

	PR fortran/37588
	* gfortran.h (gfc_compare_actual_formal): Removed, made private.
	(gfc_arglist_matches_symbol): New method.
	* interface.c (compare_actual_formal): Made static.
	(gfc_procedure_use): Use new name of compare_actual_formal.
	(gfc_arglist_matches_symbol): New method.
	(gfc_search_interface): Moved code partially to new
	gfc_arglist_matches_symbol.
	* resolve.c (resolve_typebound_generic_call): Resolve actual arglist
	before checking against formal and use new gfc_arglist_matches_symbol
	for checking.
	(resolve_compcall): Set type-spec of generated expression.

2008-09-23  Daniel Kraft  <d@domob.eu>

	PR fortran/37588
	* gfortran.dg/typebound_generic_4.f03: New test.
	* gfortran.dg/typebound_generic_5.f03: New test.

From-SVN: r140594
2008-09-23 16:26:47 +02:00
Tobias Burnus 54799fcd03 re PR fortran/37580 (Accepts "pointer(:) => target" without lower bound)
2008-09-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37580
        * expr.c (gfc_check_pointer_assign): Add checks for pointer
        remapping.

2008-09-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37580
        * gfortran.dg/pointer_assign_5.f90: New test.
        * gfortran.dg/pointer_assign_6.f90: New test.

From-SVN: r140580
2008-09-23 10:00:01 +02:00
Jerry DeLisle d7445152be re PR fortran/37498 (Incorrect array value returned - 4.3 ABI Broken)
2008-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR fortran/37498
	* trans-io.c (gfc_build_io_library_fndecls): Bump pad size.
	(build_dt): Set mask bit for IOPARM_dt_f2003.
	* ioparm.def: Add IOPARM_dt_f2003.

2008-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37498
	* file_pos (st_endfile): Clear memory only for libfortran 4.3 private
	area.
	* list_read.c (eat_separator): Only access F2003 I/O parameters if
	IOPARM_DT_HAS_F2003 bit is set. (parse_real): Ditto.
	(read_real): Ditto.
	* read.c (read_a): Likewise. (read_a_char4): Likewise though not
	strictly necessary. (read_f): Likewise.
	* io.h (unit_sign_s): New enumerator to allow duplication of
	st_parameter structures. (IOPARM_DT_HAS_F2003): New mask bit.
	(st_parameter_43): New structure copied from 4.3 version of 
	st_paramater_dt private section. (st_parameter_44): New structure with
	F2003 items added. (st_parameter_dt): Modified to create union of new
	and old structures to allow correct memory setting for 4.3 ABI
	compatibility. Bumped the pad size.
	* transfer.c (read_sf): Do not use F2003 I/O memory areas unless
	IOPARM_DT_HAS_F2003 bit has been set. (read_block_form): Ditto.
	(formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto and
	add comment, fix formatting.
	* write.c (write_default_char4): Likewise though not strictly necessary.
	(write_utf8_char4): Ditto. (write_character): Ditto.
	(write_real_g0): Ditto. (list_formatted_write_scalar): Ditto.
	(nml_write_obj): Ditto. (namelist_write): Ditto.
	* write_float.def (calculate_sign): Eliminate warning by including all
	cases in switch. (output_float): Output only decimal point of F2003 flag
	is not set.

From-SVN: r140576
2008-09-23 03:52:19 +00:00
Janus Weil f613cea7fc re PR fortran/37486 (alignment of data in COMMON blocks)
2008-09-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/37486
	* gfortran.h (gfc_option_t): New members flag_align_commons and
	warn_align_commons. 
	* lang.opt: New options falign-commons and Walign-commons.
	* invoke.texi: Documentation for new options.
	* options.c (gfc_init_options): Initialize new options.
	(gfc_handle_options): Handle new options.
	* trans-common.c (translate_common): Implement new options.
	(gfc_trans_common): Set correct locus.


2008-09-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/37486
	* gfortran.dg/common_align_1.f90: New.
	* gfortran.dg/warn_align_commons.f90: New.

From-SVN: r140546
2008-09-22 13:45:02 +02:00
Paul Thomas ecd3b73c6d re PR fortran/37583 (ICE "insert_bbt(): Duplicate key" for self-calling ENTRY subprogram)
2008-09-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37583
	* decl.c (scalarize_intrinsic_call): Both subroutines and
	functions can give a true for get_proc_mame's last argument so
	remove the &&gfc_current_ns->proc_name->attr.function.
	resolve.c (resolve_actual_arglist): Add check for recursion by
	reference to procedure as actual argument.

2008-09-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37583
	* gfortran.dg/entry_18.f90: New test.

From-SVN: r140532
2008-09-21 19:58:23 +00:00
Daniel Kraft 4b7f8314ba re PR fortran/35846 (ICE on nested character constructors)
2008-09-21  Daniel Kraft  <d@domob.eu>

	PR fortran/35846
	* trans.h (gfc_conv_string_length): New argument `expr'.
	* trans-expr.c (flatten_array_ctors_without_strlen): New method.
	(gfc_conv_string_length): New argument `expr' that is used in a new
	special case handling if cl->length is NULL.
	(gfc_conv_subref_array_arg): Pass expr to gfc_conv_string_length.
	* trans-array.c (gfc_conv_expr_descriptor): Ditto.
	(gfc_trans_auto_array_allocation): Pass NULL as new expr.
	(gfc_trans_g77_array), (gfc_trans_dummy_array_bias): Ditto.
	(gfc_trans_deferred_array): Ditto.
	(gfc_trans_array_constructor): Save and restore old values of globals
	used for bounds checking.
	* trans-decl.c (gfc_trans_dummy_character): Ditto.
	(gfc_trans_auto_character_variable): Ditto.

2008-09-21  Daniel Kraft  <d@domob.eu>

	PR fortran/35846
	* gfortran.dg/nested_array_constructor_1.f90: New test.
	* gfortran.dg/nested_array_constructor_2.f90: New test.
	* gfortran.dg/nested_array_constructor_3.f90: New test.
	* gfortran.dg/nested_array_constructor_4.f90: New test.
	* gfortran.dg/nested_array_constructor_5.f90: New test.
	* gfortran.dg/nested_array_constructor_6.f90: New test.

From-SVN: r140529
2008-09-21 17:33:37 +02:00
Daniel Kraft 74a9b89764 decl.c (match_procedure_in_type): Changed misleading error message for not yet implemented PROCEDURE(interface)...
2008-09-21  Daniel Kraft  <d@domob.eu>

	* decl.c (match_procedure_in_type): Changed misleading error message
	for not yet implemented PROCEDURE(interface) syntax.

2008-09-21  Daniel Kraft  <d@domob.eu>

	* gfortran.dg/typebound_proc_4.f03: Changed expected error for not
	yet implemented PROCEDURE(interface).

From-SVN: r140528
2008-09-21 17:24:55 +02:00
Paul Thomas 334e912a93 re PR fortran/35945 (Complex module-based overloading fails)
2008-09-18  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/35945
       * resolve.c (resolve_fl_variable_derived):  Remove derived type
       comparison for use associated derived types.  Host association
       of a derived type will not arise if there is a local derived type
       whose use name is the same.

       PR fortran/36700
       * match.c (gfc_match_call):  Use the existing symbol even if
       it is a function.

2008-09-18  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/35945
       * gfortran.dg/host_assoc_types_2.f90: New test.

       PR fortran/36700
       * gfortran.dg/host_assoc_call_2.f90: New test.

From-SVN: r140474
2008-09-18 20:21:03 +00:00
Daniel Kraft f25a62a5f3 re PR fortran/37507 (Print location in (DE)ALLOCATION errors)
2008-09-18  Daniel Kraft  <d@domob.eu>

	PR fortran/37507
	* trans.h (gfc_trans_runtime_error): New method.
	(gfc_trans_runtime_error_vararg): New method.
	(gfc_allocate_array_with_status): New argument `expr' for locus/varname.
	(gfc_deallocate_array_with_status): Ditto.
	* trans-array.h (gfc_array_deallocate): Ditto.
	* trans.c (gfc_trans_runtime_error): New method.
	(gfc_trans_runtime_error_vararg): New method, moved parts of the code
	from gfc_trans_runtime_check here.
	(gfc_trans_runtime_error_check): Moved code partly to new method.
	(gfc_call_malloc): Fix tab-indentation.
	(gfc_allocate_array_with_status): New argument `expr' and call
	gfc_trans_runtime_error for error reporting to include locus.
	(gfc_deallocate_with_status): Ditto.
	* trans-stmt.c (gfc_trans_deallocate): Pass expr as new argument.
	* trans-array.c (gfc_array_allocate): Ditto.
	(gfc_array_deallocate): New argument `expr', passed on.
	(gfc_trans_dealloc_allocated): Pass NULL for expr.
	* trans-openmp.c (gfc_omp_clause_default): Ditto.

2008-09-18  Daniel Kraft  <d@domob.eu>

	PR fortran/37507
	* gfortran.dg/allocate_error_1.f90: New test.
	* gfortran.dg/deallocate_error_1.f90: New test.
	* gfortran.dg/deallocate_error_2.f90: New test.

From-SVN: r140451
2008-09-18 14:02:50 +02:00
Paul Thomas 0b4e2af765 re PR fortran/37274 ([Regression on 4.3?] error: type name is ambiguous.)
2008-09-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37274
	PR fortran/36374
	* module.c (check_for_ambiguous): New function to test loaded
	symbol for ambiguity with fixup symbol.
	(read_module): Call check_for_ambiguous.
	(write_symtree): Do not write the symtree for symbols coming
	from an interface body.

	PR fortran/36374
	* resolve.c (count_specific_procs ): New function to count the
	number of specific procedures with the same name as the generic
	and emit appropriate errors for and actual argument reference.
	(resolve_assumed_size_actual): Add new argument no_formal_args.
	Correct logic around passing generic procedures as arguments.
	Call count_specific_procs from two locations.
	(resolve_function): Evaluate and pass no_formal_args.
	(resolve call): The same and clean up a bit by using csym more
	widely.

	PR fortran/36454
	* symbol.c (gfc_add_access): Access can be updated if use
	associated and not private.

2008-09-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37274
	* gfortran.dg/used_types_22.f90: New test.
	* gfortran.dg/used_types_23.f90: New test.

	PR fortran/36374
	* gfortran.dg/generic_17.f90: New test.
	* gfortran.dg/ambiguous_specific_2.f90: New test.
	* gfortran.dg/generic_actual_arg.f90: Add test for case that is
	not ambiguous.

	PR fortran/36454
	* gfortran.dg/access_spec_3.f90: New test.

From-SVN: r140434
2008-09-17 22:23:51 +00:00
Jakub Jelinek c0b290997f re PR fortran/37536 (a mfcr is produced instead of branches for DO loops)
PR fortran/37536
	* trans-stmt.c (gfc_trans_do): Optimize integer type non-simple
	do loop initialization.

From-SVN: r140433
2008-09-17 23:51:50 +02:00
Jerry DeLisle 3446fc502a re PR fortran/35840 (ICE for character expression in I/O specifier)
2008-09-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Tobias Burnus  <burnus@net.b.de>

	PR fortran/35840
	* io.c (match_vtag): Add tag name to error message.
	(match_out_tag): Cleanup whitespace.
	(gfc_resolve_dt): Resolve id and async tags. 

Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r140366
2008-09-14 19:00:26 +00:00
Daniel Kraft 858f1fa2a3 re PR fortran/35770 (implicit character(s) hides type of internal function)
2008-09-13  Daniel Kraft  <d@domob.eu>

	PR fortran/35770
	* primary.c (gfc_match_varspec): Added missing type-spec clearing
	after wrong implicit character typing.

2008-09-13  Daniel Kraft  <d@domob.eu>

	PR fortran/35770
	* gfortran.dg/implicit_13.f90: New test.

From-SVN: r140336
2008-09-13 09:44:36 +02:00
Richard Guenther 2944258965 tree-vrp.c (simplify_truth_ops_using_ranges): Fix types.
2008-09-12  Richard Guenther  <rguenther@suse.de>

	* tree-vrp.c (simplify_truth_ops_using_ranges): Fix types.

	fortran/
	* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Use
	build_fold_addr_expr to properly mark the argument
	addressable.

From-SVN: r140313
2008-09-12 09:01:35 +00:00
Daniel Kraft ace428e313 re PR fortran/36214 (Wrong simplification of BOZ constants)
2008-09-11  Daniel Kraft  <d@domob.eu>

	PR fortran/36214
	* simplify.c (simplify_cmplx): Added linebreak to long line.
	* target-memory.c (gfc_convert_boz): Fix indentation.
	(gfc_interpret_float): Set mpfr precision to right value before
	calling mpfr_init.

2008-09-11  Daniel Kraft  <d@domob.eu>

	PR fortran/36214
	* gfortran.dg/boz_9.f90: Corrected test.
	* gfortran.dg/boz_13.f90: New test.
	* gfortran.dg/boz_14.f90: New test.

From-SVN: r140264
2008-09-11 09:28:18 +02:00
H.J. Lu 5bcb0cc368 expr.c (find_array_element): Reformat comment.
2008-09-10  H.J. Lu  <hongjiu.lu@intel.com>

	* expr.c (find_array_element): Reformat comment.

From-SVN: r140250
2008-09-10 14:13:44 -07:00
H.J. Lu 3b35a6f890 expr.c (find_array_element): Reformat.
2008-09-10  H.J. Lu  <hongjiu.lu@intel.com>

	* expr.c (find_array_element): Reformat.

From-SVN: r140248
2008-09-10 14:07:29 -07:00
Tobias Burnus 06c7153ff1 re PR fortran/37420 (-Wunused-variable broken)
2008-09-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37420
        * trans-decl.c (get_proc_pointer_decl): Fix -Wunused-variable.

2008-09-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37420
        * gfortran.dg/warn_unused_var.f90: New test.
        * gfortran.dg/warn_unused_var.f90: Add cleanup-modules.

From-SVN: r140229
2008-09-10 13:54:08 +02:00
Daniel Kraft 00ca66405c re PR fortran/37429 (Checks when assigning from a type-bound procedure broken)
2008-09-09  Daniel Kraft  <d@domob.eu>

	PR fortran/37429
	* resolve.c (expression_rank): Added assertion to guard against
	EXPR_COMPCALL expressions.
	(resolve_compcall): Set expression's rank from the target procedure's.

2008-09-09  Daniel Kraft  <d@domob.eu>

	PR fortran/37429
	* gfortran.dg/typebound_call_7.f03: New test.
	* gfortran.dg/typebound_call_8.f03: New test.

From-SVN: r140163
2008-09-09 20:08:08 +02:00
Daniel Kraft 18b0679f09 re PR fortran/37411 (ICE (segfault) in trans-array.c)
2008-09-09  Daniel Kraft  <d@domob.eu>

	PR fortran/37411
	* trans-array.c (gfc_conv_array_parameter): Added assertion that the
	symbol has an array spec.

2008-09-09  Daniel Kraft  <d@domob.eu>

	PR fortran/37411
	* gfortran.dg/array_function_4.f90: New test.

From-SVN: r140141
2008-09-09 11:46:51 +02:00
Daniel Kraft 0a991dec38 re PR fortran/37199 (array assignment from function writes out of bounds)
2008-09-08  Daniel Kraft  <d@domob.eu>

	PR fortran/37199
	* trans-expr.c (gfc_add_interface_mapping): Set new_sym->as.
	(gfc_map_intrinsic_function): Added checks against NULL bounds in
	array specs.

2008-09-08  Daniel Kraft  <d@domob.eu>

	PR fortran/37199
	* gfortran.dg/array_function_2.f90: New test.

From-SVN: r140102
2008-09-08 11:17:27 +02:00
Tobias Burnus 10c17e8fd0 re PR fortran/37400 (implicit character(len=*,kind=kind('A')) (Q) ... no longer gives the right answer.)
2008-09-07  Tobias Burnus  <burnus@net.b.de>

        PR fortran/37400
        * symbol.c (gfc_set_default_type): Copy char len.

2008-09-07  Tobias Burnus  <burnus@net.b.de>

        PR fortran/37400
        * gfortran.dg/implicit_12.f90: New test.

From-SVN: r140100
2008-09-08 09:19:46 +02:00
Tobias Burnus 7a687b2265 [multiple changes]
2008-09-06  Steven G. Kargl  <kargls@comcast.net>

       PR fortran/36153
       * fortran/resolve.c (resolve_function): Shortcircuit for SIZE and
       UBOUND if 2nd argument is KIND.

2008-09-06  Tobias Burnus  <burnus@net-b.de>

       PR fortran/36153
       * gfortran.dg/size_kind.f90: New test.

From-SVN: r140063
2008-09-06 17:27:50 +02:00
Steven G. Kargl 2c68bc89b7 re PR fortran/33229 (ICE with "intrinsic" plus calling a subroutine as function)
2008-09-06  Steven G. Kargl  <kargls@comcast.net>

        PR fortran/33229
        * resolve.c (resolve_function): An intrinsic subroutine should
        * not be
        called as a function.

2008-09-06  Steven G. Kargl  <kargls@comcast.net>

        PR fortran/33229
        * gfortran.dg/intrinsic_subroutine.f90: New test.

From-SVN: r140061
2008-09-06 17:11:29 +02:00
Daniel Kraft a82f1f2efa re PR fortran/35837 (rej.valid: Host-associated SAVEd variable and PURE function)
2008-09-05  Daniel Kraft  <d@domob.eu>

	PR fortran/35837
	* resolve.c (resolve_types): Restore gfc_current_ns on exit.
	* symbol.c (gfc_save_all): Removed blank line.

2008-09-05  Daniel Kraft  <d@domob.eu>

	PR fortran/35837
	* gfortran.dg/save_3.f90: New test.

From-SVN: r140046
2008-09-05 22:51:50 +02:00
Daniel Kraft ebac6d9cb9 re PR fortran/36746 (Rejects variable which is implictly typed as derived typed with DIMENSION)
2008-09-05  Daniel Kraft  <d@domob.eu>

	PR fortran/36746
	* primary.c (gfc_match_rvalue): Removed logic to handle implicit
	typing to a derived-type if a component reference is found.
	(gfc_match_varspec): Moved it here.

2008-09-05  Daniel Kraft  <d@domob.eu>

	PR fortran/36746
	* gfortran.dg/implicit_derived_type_1.f90: New test.
	* gfortran.dg/used_before_typed_5.f90: New test.

From-SVN: r140034
2008-09-05 13:56:23 +02:00
Richard Guenther 6e1b67b364 trans-array.c (gfc_conv_array_parameter): Use correct types in building COND_EXPRs.
2008-09-04  Richard Guenther  <rguenther@suse.de>

	* trans-array.c (gfc_conv_array_parameter): Use correct types
	in building COND_EXPRs.
	* trans-expr.c (gfc_conv_missing_dummy): Likewise.
	* trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise.

	* gfortran.dg/internal_pack_4.f90: Adjust pattern.

From-SVN: r140001
2008-09-04 19:32:02 +00:00
Daniel Kraft d555161825 re PR fortran/37099 (Wrong results when comparing a character array to a character expression)
2008-09-04  Daniel Kraft  <d@domob.eu>

	* PR fortran/37099
	* expr.c (simplify_const_ref): Update expression's character length
	when pulling out a substring reference.

2008-09-04  Daniel Kraft  <d@domob.eu>

	PR fortran/37099
	* gfortran.dg/string_compare_1.f90: New text.
	* gfortran.dg/string_compare_2.f90: New text.
	* gfortran.dg/string_compare_3.f90: New text.

From-SVN: r139997
2008-09-04 21:16:13 +02:00
Ian Lance Taylor e0c68ce9d2 rtl.h (LABEL_REF_NONLOCAL_P): Don't check for REG_LABEL_OPERAND or REG_LABEL_TARGET.
./:	* rtl.h (LABEL_REF_NONLOCAL_P): Don't check for REG_LABEL_OPERAND
	or REG_LABEL_TARGET.
	* calls.c (emit_library_call_value_1): Use MEM_P rather than
	comparing MODE with MEM.
	* gimple.c (gimple_build_predict): Cast END_PREDICTORS before
	comparing with GF_PREDICT_TAKEN.
	(gimple_get_lhs): Change code to enum gimple_code.
	(gimple_set_lhs): Likewise.
	* ifcvt.c (noce_process_if_block): Correct GET_MODE to GET_CODE.
	* omp-low.c (find_omp_clause): Change kind parameter to enum
	omp_clause_code.
	* tree-flow.h (find_omp_clause): Update declaration.
	* regrename.c (clear_dead_regs): Change kind parameter to enum
	reg_note.
	* reload1.c (eliminate_regs_1): Use REG_NOTE_KIND rather than
	GET_MODE.
	* see.c (see_get_extension_data): Change return type to enum
	entry_type.  Change UNKNOWN to NOT_RELEVANT, SIGN_EXTEND to
	SIGNED_EXTENDED_DEF, ZERO_EXTEND to ZERO_EXTENDED_DEF.
	(see_gen_normalized_extension): Change extension_code parameter to
	enum entry_type.
	(see_seek_pre_extension_expr): Change extension_code to enum
	entry_type.
	(see_merge_one_def_extension): Likewise.
	(see_handle_relevant_defs): Likewise.
	(see_handle_relevant_uses): Likewise.
	(see_analyze_one_def): Likewise.
	* tree-cfg.c (need_fake_edge_p): Compare gimple code with
	GIMPLE_ASM rather than ASM_EXPR.
	* tree-ssa-alias.c (is_escape_site): Compare gimple code with
	GIMPLE_RETURN rather than RETURN_EXPR.
	* tree-ssa-ccp.c (likely_value): Change code to enum gimple_code.
	(evaluate_stmt): Likewise.
	* tree-vect-analyze.c (vect_analyze_operations): Change relevance
	to enum vect_relevant.
	(vect_mark_stmts_to_be_vectorized): Change assertion to not
	compare gimple codes with tree codes.
cp/:
	* parser.c (check_no_duplicate_clause): Change code parameter to
	enum omp_clause_code.
fortran/:
	* symbol.c (generate_isocbinding_symbol): Compare
	gfc_notification_std with ERROR rather than FAILURE.
	* resolve.c (check_assumed_size_reference): Compare array type
	with AR_FULL rather than DIMEN_ELEMENT.
	(resolve_actual_arglist): Compare with EXPR_VARIABLE rather than
	FL_VARIABLE.

From-SVN: r139991
2008-09-04 17:32:38 +00:00
Jerry DeLisle 900e887f6d re PR fortran/37228 (F2008: Support g0.<d> edit descriptor)
2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/37228
	* io.c (check_format): Allow specifying precision with g0 format.

2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37301
	PR libfortran/37228
	* io/io.h (write_real_g0): Declare new function to handle g0.d format.
	* io/transfer.c (formatted_transfer_scalar): Use new function.
	* io/format.c (parse_format_list): Enable g0.d.
	* io/write.c (write_a_char4): Delete unused var.
	(set_fnode_default): New function to set the default fnode w, d, and e
	factored from write_real. (write_real): Use new factored function.
	(write_real_g0): New function that sets d to that passed by g0.d format
	specifier and set format to ES.  Default values for w and e are used
	from the new function, set_fnode_default.

2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/37228
	* gfortran.dg/fmt_g0_4.f08: Revised test.

From-SVN: r139886
2008-09-02 10:50:13 +02:00
Daniel Kraft 52f4993488 gfortran.h (struct gfc_namespace): New member `implicit_loc'.
2008-09-02  Daniel Kraft  <d@domob.eu>

	* gfortran.h (struct gfc_namespace): New member `implicit_loc'.
	(gfc_add_abstract): New method.
	* decl.c (gfc_get_type_attr_spec): Match ABSTRACT attribute.
	(gfc_match_derived_decl): Copy abstract attribute in derived symbol.
	* dump-parse-tree.c (show_attr): Show ABSTRACT attribute as `ABSTRACT'
	only to allow for ABSTRACT types.
	* parse.c (parse_interface): Use new gfc_add_abstract.
	* primary.c (gfc_match_structure_constructor): Check that no ABSTRACT
	type is constructed.
	* resolve.c (resolve_typespec_used): New method.
	(resolve_fl_derived): Check type in respect to ABSTRACT attribute and
	check that no component is of an ABSTRACT type.
	(resolve_symbol): Check that no symbol is of an ABSTRACT type.
	(resolve_types): Check IMPLICIT declarations for ABSTRACT types.
	* symbol.c (gfc_merge_new_implicit): Remember loci of IMPLICIT's.
	(gfc_add_abstract): New method.

2008-09-02  Daniel Kraft  <d@domob.eu>

	* gfortran.dg/abstract_type_1.f90: New test.
	* gfortran.dg/abstract_type_2.f03: New test.
	* gfortran.dg/abstract_type_3.f03: New test.
	* gfortran.dg/abstract_type_4.f03: New test.

From-SVN: r139885
2008-09-02 10:13:21 +02:00
Daniel Kraft 3e1e5626dc re PR fortran/37193 ("USE mod, ONLY: i, i=>j" does not import "i")
2008-09-01  Daniel Kraft  <d@domob.eu>

	PR fortran/37193
	* module.c (read_module): Initialize use_only flag on used symbols.

2008-09-01  Daniel Kraft  <d@domob.eu>

	PR fortran/37193
	* gfortran.dg/use_rename_4.f90: New test.
	* gfortran.dg/use_rename_5.f90: New test.

From-SVN: r139866
2008-09-01 15:43:10 +02:00
Daniel Kraft a64a8f2f26 gfc-internals.texi (F2003 OOP), [...]): New chapter and section to document the internals of type-bound procedures.
2008-09-01  Daniel Kraft  <d@domob.eu>

	* gfc-internals.texi (F2003 OOP), (Type-bound Procedures): New chapter
	and section to document the internals of type-bound procedures.
	(gfc_expr): Document EXPR_COMPCALL.
	* gfortran.h (struct gfc_expr): Remove unused `derived' from compcall.
	* dump-parse-tree.c (show_compcall): New method.
	(show_expr): Call it for EXPR_COMPCALL.
	(show_typebound), (show_f2k_derived): New methods.
	(show_symbol): Call show_f2k_derived.
	(show_code_node): Handle EXEC_COMPCALL.
	* primary.c (gfc_match_varspec): Don't initialize removed `derived' in
	primary->value.compcall.

From-SVN: r139857
2008-09-01 12:55:50 +02:00
Richard Guenther eb829078a3 trans-expr.c (gfc_trans_string_copy): Use the correct types to compute slen and dlen.
2008-08-31  Richard Guenther  <rguenther@suse.de>

	* trans-expr.c (gfc_trans_string_copy): Use the correct types
	to compute slen and dlen.

From-SVN: r139832
2008-08-31 13:40:15 +00:00