1 2009-09-03 Diego Novillo <dnovillo@google.com>
3 * f95-lang.c (lang_hooks): Remove const qualifier.
5 2009-09-01 Richard Guenther <rguenther@suse.de>
7 * f95-lang.c (gfc_mark_addressable): Remove.
8 (LANG_HOOKS_MARK_ADDRESSABLE): Likewise.
10 2009-08-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
13 * scanner.c (next_char): Fix typo in comment.
14 (gfc_get_char_literal): Warn if truncate flag is set for both fixed and
15 free form source, adjusting error locus as needed.
16 * parse.c (next_fixed): Clear the truncate flag.
17 (next_statement): Remove truncate warning.
19 2009-08-31 Janus Weil <janus@gcc.gnu.org>
20 Paul Thomas <pault@gcc.gnu.org>
23 * array.c (gfc_match_array_constructor): Rename gfc_match_type_spec.
24 * decl.c (gfc_match_type_spec): Rename to gfc_match_decl_type_spec,
25 and reject CLASS with -std=f95.
26 (gfc_match_implicit, gfc_match_data_decl,gfc_match_prefix,
27 match_procedure_interface): Rename gfc_match_type_spec.
28 * gfortran.h (gfc_type_compatible): Add prototype.
29 * match.h (gfc_match_type_spec): Rename to gfc_match_decl_type_spec.
30 * match.c (match_intrinsic_typespec): Rename to match_type_spec, and
31 add handling of derived types.
32 (gfc_match_allocate): Rename match_intrinsic_typespec and check
33 type compatibility of derived types.
34 * symbol.c (gfc_type_compatible): New function to check if two types
37 2009-08-31 Janus Weil <janus@gcc.gnu.org>
40 * check.c (gfc_check_allocated): Implement allocatable scalars.
41 * resolve.c (resolve_allocate_expr,resolve_fl_var_and_proc): Ditto.
42 * trans-intrinsic.c (gfc_conv_allocated): Ditto.
44 2009-08-30 Daniel Kraft <d@domob.eu>
47 * dump-parse-tree.c (show_typebound_proc): Renamed from `show_typebound'
48 and accept gfc_typebound_proc and name instead of the symtree, needed
49 for intrinsic operator output.
50 (show_typebound_symtree): New method calling `show_typebound_proc'.
51 (show_f2k_derived): Output type-bound operators also.
52 (show_symbol): Moved output of `Procedure bindings:' label to
54 * gfortran.texi (Fortran 2003 status): Mention support of
55 array-constructors with explicit type specification, type-bound
56 procedures/operators, type extension, ABSTRACT types and DEFERRED.
57 Link to Fortran 2003 wiki page.
58 (Fortran 2008 status): Fix typo. Link to Fortran 2008 wiki page.
59 * gfc-internals.texi (Type-bound Procedures): Document the new
60 members/attributes of gfc_expr.value.compcall used for type-bound
62 (Type-bound Operators): New section documenting their internals.
64 2009-08-27 Janus Weil <janus@gcc.gnu.org>
67 * expr.c (gfc_check_pointer_assign): Enable interface check for
68 pointer assignments involving procedure pointer components.
69 * gfortran.h (gfc_compare_interfaces): Modified prototype.
70 * interface.c (gfc_compare_interfaces): Add argument 'name2', to be
71 used instead of s2->name. Don't rely on the proc_pointer attribute,
72 but instead on the flags handed to this function.
73 (check_interface1,compare_parameter): Add argument for
74 gfc_compare_interfaces.
75 * resolve.c (check_generic_tbp_ambiguity): Ditto.
77 2009-08-27 Daniel Kraft <d@domob.eu>
80 * gfortran.h (gfc_expr): Optionally store base-object in compcall value
81 and add a new flag to distinguish assign-calls generated.
82 (gfc_find_typebound_proc): Add locus argument.
83 (gfc_find_typebound_user_op), (gfc_find_typebound_intrinsic_op): Ditto.
84 (gfc_extend_expr): Return if failure was by a real error.
85 * interface.c (matching_typebound_op): New routine.
86 (build_compcall_for_operator): New routine.
87 (gfc_extend_expr): Handle type-bound operators, some clean-up and
88 return if failure was by a real error or just by not finding an
89 appropriate operator definition.
90 (gfc_extend_assign): Handle type-bound assignments.
91 * module.c (MOD_VERSION): Incremented.
92 (mio_intrinsic_op): New routine.
93 (mio_full_typebound_tree): New routine to make typebound-procedures IO
94 code reusable for type-bound user operators.
95 (mio_f2k_derived): IO of type-bound operators.
96 * primary.c (gfc_match_varspec): Initialize new fields in gfc_expr and
97 pass locus to gfc_find_typebound_proc.
98 * resolve.c (resolve_operator): Only output error about no matching
99 interface if gfc_extend_expr did not already fail with an error.
100 (extract_compcall_passed_object): Use specified base-object if present.
101 (update_compcall_arglist): Handle ignore_pass field.
102 (resolve_ordinary_assign): Update to handle extended code for
103 type-bound assignments, too.
104 (resolve_code): Handle EXEC_ASSIGN_CALL statement code.
105 (resolve_tb_generic_targets): Pass locus to gfc_find_typebound_proc.
106 (resolve_typebound_generic), (resolve_typebound_procedure): Ditto.
107 (resolve_typebound_intrinsic_op), (resolve_typebound_user_op): Ditto.
108 (ensure_not_abstract_walker), (resolve_fl_derived): Ditto.
109 (resolve_typebound_procedures): Remove not-implemented error.
110 (resolve_typebound_call): Handle assign-call flag.
111 * symbol.c (find_typebound_proc_uop): New argument to pass locus for
112 error message about PRIVATE, verify that a found procedure is not marked
114 (gfc_find_typebound_intrinsic_op): Ditto.
115 (gfc_find_typebound_proc), (gfc_find_typebound_user_op): New locus arg.
117 2009-08-22 Bud Davis <bdavis9659@sbcglobal.net>
120 * io.c: reverted previous patch.
122 2009-08-25 Janne Blomqvist <jb@gcc.gnu.org>
124 * gfortran.texi: Fix ENCODE example.
126 2009-08-25 Janus Weil <janus@gcc.gnu.org>
129 * primary.c (gfc_match_varspec): Make sure EXPR_PPC is only used for
130 calls to procedure pointer components, other references to procedure
131 pointer components are EXPR_VARIABLE.
132 * resolve.c (resolve_actual_arglist): Bugfix (there can be calls without
134 * trans-expr.c (gfc_get_proc_ptr_comp): Renamed to 'get_proc_ptr_comp',
135 removed argument 'se' and made static. Avoid inserting a temporary
136 variable for calling the PPC.
137 (conv_function_val): Renamed gfc_get_proc_ptr_comp.
138 (gfc_conv_procedure_call): Distinguish functions returning a procedure
139 pointer from calls to a procedure pointer. Distinguish calls to
140 procedure pointer components from procedure pointer components as
142 * trans-stmt.h (gfc_get_proc_ptr_comp): Make it static.
144 2009-08-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
147 * io.c (check_format): Fix to not error on slash after P. Fix some
150 2009-08-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
153 * io.c (check_format): Fix to not error on right paren after P.
155 2009-08-24 Aldy Hernandez <aldyh@redhat.com>
158 * trans-io.c (build_dt): Pass UNKNOWN_LOCATION to build_call_expr_loc.
159 (transfer_array_desc): Same.
161 2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
164 * io.c (check_format): Add checks for comma and the allowed
165 format specifiers after the 'P' specifier. Fix typo in error message
168 2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
171 * io.c (enum format_token): Change FMT_EXT to FMT_EN and FMT_ES.
172 (format_lex): Likewise.
173 (token_to_string): New function.
174 (check_format): Use the new tokens and the new function. Add
175 check for positive width.
177 2009-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
179 * fortran/decl.c: Disallow procedure pointers with -std=f95.
181 2009-08-22 Steven K. kargl <kargl@gcc.gnu.org>
182 Paul Thomas <pault@gcc.gnu.org>
184 * fortran/decl.c (match_char_spec): Rename to gfc_match_char_spec,
186 * fortran/gfortran.h: Add *expr3 entity to gfc_code. Add prototype
187 for gfc_match_char_spec.
188 * fortran/trans-stmt.c (gfc_trans_allocate): Translate the SOURCE=
190 * fortran/match.c (match_intrinsic_typespec): New function to match
191 F2003 intrinsic-type-spec.
192 (conformable_arrays): New function. Check SOURCE= and
193 allocation-object are conformable.
194 (gfc_match_allocate): Use new functions. Match SOURCE= tag.
196 2009-08-22 Bud Davis <bdavis9659@sbcglobal.net>
199 * io.c : added variable to store original len of fmt
200 * io.c (check_format): Consume H items using next_char
201 in both modes to handle consecutive single quotes.
202 Test for extra characters in fmt, issue warning.
204 2009-08-21 Janus Weil <janus@gcc.gnu.org>
207 * primary.c (gfc_variable_attr): Make it work also on EXPR_FUNCTION.
208 (gfc_expr_attr): Use gfc_variable_attr for procedure pointer components.
209 * resolve.c (resolve_fl_derived): Handle CHARACTER-valued procedure
211 * trans-expr.c (gfc_conv_component_ref): Ditto.
212 (gfc_conv_variable): Ditto.
213 (gfc_conv_procedure_call): Ditto.
214 (gfc_trans_pointer_assignment): Ditto.
215 * trans-types.c (gfc_get_derived_type): Ditto.
217 2009-08-20 Tobias Schlüter <tobi@gcc.gnu.org>
219 * trans-stmt.c (gfc_trans_do): Add a few missing folds.
221 2009-08-20 Michael Matz <matz@suse.de>
224 * trans-expr.c (gfc_conv_string_tmp): Check type compatibility
227 2009-08-20 Janus Weil <janus@gcc.gnu.org>
230 * resolve.c (resolve_symbol): Don't resolve formal_ns of intrinsic
233 2009-08-18 Michael Matz <matz@suse.de>
235 * trans-expr.c (gfc_conv_substring): Don't evaluate casted decl early,
236 change order of length calculation to (end - start) + 1.
237 (gfc_get_interface_mapping_array): Adjust call to
238 gfc_get_nodesc_array_type.
239 * trans-array.c (gfc_trans_create_temp_array,
240 gfc_build_constant_array_constructor, gfc_conv_expr_descriptor): Ditto.
241 * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Ditto.
242 * trans.c (gfc_add_modify): Assignment between base type and nontarget
243 type are equal enough.
244 (gfc_call_malloc): Use prvoid_type_node for return value of
246 (gfc_allocate_with_status): Ditto.
247 * trans-types.c (gfc_array_descriptor_base): Double size of this array.
248 (gfc_init_types): Build prvoid_type_node.
249 (gfc_build_array_type): New bool parameter "restricted".
250 (gfc_get_nodesc_array_type): Ditto, build restrict qualified pointers,
252 (gfc_get_array_descriptor_base): Ditto.
253 (gfc_get_array_type_bounds): Ditto.
254 (gfc_sym_type): Use symbol attributes to feed calls to above functions.
255 (gfc_get_derived_type): Ditto.
256 * trans.h (struct lang_type): Add nontarget_type member.
257 * trans-types.h (prvoid_type_node): Declare.
258 (gfc_get_array_type_bounds, gfc_get_nodesc_array_type): Declare new
260 * trans-decl.c (gfc_finish_var_decl): Give scalars that can't be
261 aliased a type with a different alias set than the base type.
262 (gfc_build_dummy_array_decl): Adjust call to gfc_get_nodesc_array_type.
264 2009-08-18 Janus Weil <janus@gcc.gnu.org>
265 Paul Thomas <pault@gcc.gnu.org>
268 * trans-types.c (gfc_get_ppc_type): Include formal args in backend_decl
269 using the interface symbol. Character types are returned by reference.
270 (gfc_get_derived_type): Prevent infinite recursion loop
271 if a PPC has a derived-type formal arg.
273 2008-08-17 Paul Thomas <pault@gcc.gnu.org>
276 * trans-decl.c (gfc_trans_use_stmts): Keep going through use
277 list if symbol is not use associated.
279 2009-08-17 Daniel Kraft <d@domob.eu>
282 * resolve.c (get_checked_tb_operator_target): New routine to do checks
283 on type-bound operators in common between intrinsic and user operators.
284 (resolve_typebound_intrinsic_op): Call it.
285 (resolve_typebound_user_op): Ditto.
287 2009-08-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
290 * scanner.c (gfc_next_char_literal): Add comment to improve
292 * io.c (enum format_token): Add FMT_STAR. (format_lex): Add case
293 for '*'. (check_format): Check for left paren after '*'. Change
294 format checks to use %L to improve format string error locus.
296 2009-08-17 Janus Weil <janus@gcc.gnu.org>
299 * array.c (gfc_resolve_character_array_constructor): Add NULL argument
301 * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec,
302 gfc_match_implicit): Ditto.
303 * expr.c (simplify_const_ref): Fix memory leak.
304 (gfc_simplify_expr): Add NULL argument to gfc_new_charlen.
305 * gfortran.h (gfc_new_charlen): Modified prototype.
306 * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Add NULL
307 argument to gfc_new_charlen.
308 * module.c (mio_charlen): Ditto.
309 * resolve.c (gfc_resolve_substring_charlen,
310 gfc_resolve_character_operator,fixup_charlen): Ditto.
311 (resolve_fl_derived,resolve_symbol): Add argument to gfc_charlen.
312 * symbol.c (gfc_new_charlen): Add argument 'old_cl' (to make a copy of
313 an existing charlen).
314 (gfc_set_default_type,generate_isocbinding_symbol): Fix memory leak.
315 (gfc_copy_formal_args_intr): Add NULL argument to gfc_new_charlen.
316 * trans-decl.c (create_function_arglist): Fix memory leak.
318 2009-08-17 Richard Guenther <rguenther@suse.de>
320 * trans-expr.c (gfc_trans_scalar_assign): Replace hack with
323 2009-08-15 Tobias Burnus <burnus@net-b.de>
326 * gfortranspec.c (lookup_option): Remove gfortran-specific
327 version of -dumpversion.
329 2009-08-14 Janus Weil <janus@gcc.gnu.org>
332 * resolve.c (resolve_structure_cons): Make sure that ts.u.derived is
333 only used if type is BT_DERIVED.
335 2009-08-13 Janus Weil <janus@gcc.gnu.org>
338 * gfortran.h (gfc_typespec): Put 'derived' and 'cl' into union.
339 * decl.c (build_struct): Make sure 'cl' is only used
340 if type is BT_CHARACTER.
341 * symbol.c (gfc_set_default_type): Ditto.
342 * resolve.c (resolve_symbol, resolve_fl_derived): Ditto.
343 (resolve_equivalence,resolve_equivalence_derived): Make sure 'derived'
344 is only used if type is BT_DERIVED.
345 * trans-io.c (transfer_expr): Make sure 'derived' is only used if type
346 is BT_DERIVED or BT_INTEGER (special case: C_PTR/C_FUNPTR).
347 * array.c: Mechanical replacements to accomodate union in gfc_typespec.
351 * dump-parse-tree.c: Ditto.
353 * interface.c: Ditto.
364 * target-memory.c: Ditto.
365 * trans-array.c: Ditto.
366 * trans-common.c: Ditto.
367 * trans-const.c: Ditto.
368 * trans-decl.c: Ditto.
369 * trans-expr.c: Ditto.
370 * trans-intrinsic.c: Ditto.
372 * trans-stmt.c: Ditto.
373 * trans-types.c: Ditto.
375 2009-08-13 Janus Weil <janus@gcc.gnu.org>
378 * resolve.c (resolve_symbol): Move some checking code to
379 resolve_intrinsic, and call this from here.
380 (resolve_intrinsic): Some checking code moved here from resolve_symbol.
381 Make sure each intrinsic is only resolved once.
383 2009-08-12 Tobias Burnus <burnus@net-b.de>
386 * symbol.c (gfc_copy_attr): Merge bits instead of replace
387 bits in gfc_copy_attr.
388 * gfc_check_pointer_assign (gfc_check_pointer_assign):
389 Initialize ext_attr bits by zero.
391 2009-08-11 Richard Guenther <rguenther@suse.de>
393 * trans-types.c (gfc_get_derived_type): Do not clear TYPE_CANONICAL.
395 2009-08-11 Janus Weil <janus@gcc.gnu.org>
398 * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointer
399 components as actual arguments.
401 2009-08-10 Daniel Kraft <d@domob.eu>
404 * gfortran.h (struct gfc_namespace): New fields tb_uop_root and tb_op.
405 (gfc_find_typebound_user_op): New routine.
406 (gfc_find_typebound_intrinsic_op): Ditto.
407 (gfc_check_operator_interface): Now public routine.
408 * decl.c (gfc_match_generic): Match OPERATOR(X) or ASSIGNMENT(=).
409 * interface.c (check_operator_interface): Made public, renamed to
410 `gfc_check_operator_interface' accordingly and hand in the interface
411 as gfc_symbol rather than gfc_interface so it is useful for type-bound
412 operators, too. Return boolean result.
413 (gfc_check_interfaces): Adapt call to `check_operator_interface'.
414 * symbol.c (gfc_get_namespace): Initialize new field `tb_op'.
415 (gfc_free_namespace): Free `tb_uop_root'-based tree.
416 (find_typebound_proc_uop): New helper function.
417 (gfc_find_typebound_proc): Use it.
418 (gfc_find_typebound_user_op): New method.
419 (gfc_find_typebound_intrinsic_op): Ditto.
420 * resolve.c (resolve_tb_generic_targets): New helper function.
421 (resolve_typebound_generic): Use it.
422 (resolve_typebound_intrinsic_op), (resolve_typebound_user_op): New.
423 (resolve_typebound_procedures): Resolve operators, too.
424 (check_uop_procedure): New, code from gfc_resolve_uops.
425 (gfc_resolve_uops): Moved main code to new `check_uop_procedure'.
427 2009-08-10 Janus Weil <janus@gcc.gnu.org>
430 * decl.c (gfc_match_type_spec): Match CLASS statement and warn about
431 missing polymorphism.
432 * gfortran.h (gfc_typespec): Add field 'is_class'.
433 * misc.c (gfc_clear_ts): Initialize 'is_class' to zero.
434 * resolve.c (type_is_extensible): New function to check if a derived
436 (resolve_fl_variable_derived): Add error checks for CLASS variables.
437 (resolve_typebound_procedure): Disallow non-polymorphic passed-object
438 dummy arguments, turning warning into error.
439 (resolve_fl_derived): Use 'type_is_extensible'. Disallow non-polymorphic
440 passed-object dummy arguments for procedure pointer components,
441 turning warning into error. Add error check for CLASS components.
443 2009-08-05 Tobias Burnus <burnus@net-b.de>
446 * gfortran.h (ext_attr_id_t): Add typedef for this enum.
447 (gfc_add_ext_attribute): Use it.
448 * decl.c (gfc_match_gcc_attributes): Ditto.
449 * expr.c (gfc_check_pointer_assign): Ditto.
450 * symbol.c (gfc_add_ext_attribute): Ditto.
451 (gfc_copy_attr): Copy also ext_attr.
452 * resolve.c (resolve_fl_derived,resolve_symbol): Ditto.
453 * module.c (mio_symbol_attribute): Save ext_attr in the mod file.
455 2009-08-05 Tobias Burnus <burnus@net-b.de>
459 2009-08-04 Tobias Burnus <burnus@net-b.de>
462 * trans-types.c (gfc_get_function_type): Fix typelist of
463 functions without argument.
465 2009-08-05 Paul Thomas <pault@gcc.gnu.org>
468 * iresolve.c (gfc_resolve_transfer): Correct error in 'mold'
469 character length for case where length expresson is NULL.
471 2009-08-04 Tobias Burnus <burnus@net-b.de>
474 * trans-types.c (gfc_get_function_type): Fix typelist of
475 functions without argument.
477 2009-08-04 Paul Thomas <pault@gcc.gnu.org>
480 * decl.c (add_init_expr_to_sym): Character symbols can only be
481 initialized with character expressions.
483 2009-08-02 Janus Weil <janus@gcc.gnu.org>
486 * decl.c (match_char_length): Warn about old-style character length
488 * match.c (match_arithmetic_if,gfc_match_if): Modify warning message
490 (gfc_match_goto): Warn about computed gotos.
491 (gfc_match_return): Warn about alternate return.
492 (gfc_match_st_function): Warn about statement functions.
493 * resolve.c (resolve_fl_procedure): Modify warning message for
494 assumed-length character functions.
496 2009-08-01 Paul Thomas <pault@gcc.gnu.org>
499 * error.c : Add static flag 'warnings_not_errors'.
500 (gfc_error): If 'warnings_not_errors' is set, branch to code
502 (gfc_clear_error): Reset 'warnings_not_errors'.
503 (gfc_errors_to_warnings): New function.
504 * options.c (gfc_post_options): If pedantic and flag_whole_file
505 change the latter to a value of 2.
506 * parse.c (parse_module): Add module namespace to gsymbol.
507 (resolve_all_program_units): New function.
508 (clean_up_modules): New function.
509 (translate_all_program_units): New function.
510 (gfc_parse_file): If whole_file, do not clean up module right
511 away and add derived types to namespace derived types. In
512 addition, call the three new functions above.
513 * resolve.c (not_in_recursive): New function.
514 (not_entry_self_reference): New function.
515 (resolve_global_procedure): Symbol must not be IFSRC_UNKNOWN,
516 procedure must not be in the course of being resolved and
517 must return false for the two new functions. Pack away the
518 current derived type list before calling gfc_resolve for the
519 gsymbol namespace. It is unconditionally an error if the ranks
520 of the reference and ther procedure do not match. Convert
521 errors to warnings during call to gfc_procedure_use if not
523 (gfc_resolve): Set namespace resolved flag to -1 during
524 resolution and store current cs_base.
525 * trans-decl.c (gfc_get_symbol_decl): If whole_file compilation
526 substitute a use associated variable, if it is available in a
528 (gfc_get_extern_function_decl): If the procedure is use assoc,
529 do not attempt to find it in a gsymbol because it could be an
530 interface. If the symbol exists in a module namespace, return
532 * trans-expr.c (gfc_trans_scalar_assign): If a derived type
533 assignment, set the rhs TYPE_MAIN_VARIANT to that of the rhs.
534 * trans-types.c (copy_dt_decls_ifequal): Add 'from_gsym' as a
535 boolean argument. Copy component backend_decls directly if the
536 components are derived types and from_gsym is true.
537 (gfc_get_derived_type): If whole_file copy the derived type from
538 the module if it is use associated, otherwise, if can be found
539 in another gsymbol namespace, use the existing derived type as
540 the TYPE_CANONICAL and build normally.
541 * gfortran.h : Add derived_types and resolved fields to
542 gfc_namespace. Include prototype for gfc_errors_to_warnings.
544 2009-07-29 Tobias Burnus <burnus@net-b.de>
547 * trans-types.c (gfc_get_function_type): Do not add hidden
548 string-length argument for BIND(C) procedures.
549 * trans-decl.c (create_function_arglist): Skip over nonexisting
550 string-length arguments for BIND(C) procedures.
552 2009-07-28 Jakub Jelinek <jakub@redhat.com>
555 * openmp.c (gfc_match_omp_clauses): Use gfc_error_now instead of
556 gfc_error to diagnose invalid COLLAPSE arguments.
558 2009-07-28 Janus Weil <janus@gcc.gnu.org>
561 * trans-types.c (gfc_get_ppc_type): For derived types, directly use the
562 backend_decl, instead of calling gfc_typenode_for_spec, to avoid
564 (gfc_get_derived_type): Correctly handle PPCs returning derived types,
565 avoiding infinite recursion.
567 2009-07-27 Janus Weil <janus@gcc.gnu.org>
570 * interface.c (gfc_compare_interfaces): Call 'count_types_test' before
571 'generic_correspondence', and only if checking a generic interface.
573 2009-07-27 Tobias Burnus <burnus@net-b.de>
576 * resolve.c (resolve_symbol): Do not initialize pointer derived-types.
577 * trans-decl.c (init_intent_out_dt): Ditto.
578 (generate_local_decl): No need to set attr.referenced for DT pointers.
580 2009-07-26 Tobias Burnus <burnus@net-b.de>
583 * intrinsic.c (make_generic): Remove assert as "atan" can be
584 both ISYM_ATAN and ISYM_ATAN2.
585 (add_functions): Add two-argument variant of ATAN.
586 * intrinsic.h (gfc_check_atan_2): Add check for it.
587 * intrinsic.texi (ATAN2): Correct and enhance description.
588 (ATAN): Describe two-argument variant of ATAN.
590 2009-07-25 Tobias Burnus <burnus@net-b.de>
591 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
594 * intrinsic.c (add_functions): Support complex arguments for
595 acos,acosh,asin,asinh,atan,atanh.
596 * invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
598 * simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
599 gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
600 gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
601 gfc_simplify_acosh,gfc_simplify_atanh): Support
604 2009-07-25 Richard Guenther <rguenther@suse.de>
607 * trans-types.c (gfc_get_array_type_bounds): Use
608 build_distinct_type_copy with a proper TYPE_CANONICAL and
609 re-use the type-decl of the original type.
610 * trans-decl.c (build_entry_thunks): Signal cgraph we may not
612 (create_main_function): Likewise.
613 (gfc_generate_function_code): Likewise.
614 * trans-expr.c (gfc_trans_subcomponent_assign): Do not use
615 fold_convert on record types.
617 2009-07-25 Janus Weil <janus@gcc.gnu.org>
620 * decl.c (match_ppc_decl): Implement the PASS attribute for procedure
622 (match_binding_attributes): Ditto.
623 * gfortran.h (gfc_component): Add member 'tb'.
624 (gfc_typebound_proc): Add member 'ppc' and make 'pass_arg' const.
625 * module.c (MOD_VERSION): Bump module version.
626 (binding_ppc): New string constants.
627 (mio_component): Only use formal args if component is a procedure
628 pointer and add 'tb' member.
629 (mio_typebound_proc): Include pass_arg and take care of procedure
631 * resolve.c (update_arglist_pass): Add argument 'name' and take care of
633 (extract_ppc_passed_object): New function, analogous to
634 extract_compcall_passed_object, but for procedure pointer components.
635 (update_ppc_arglist): New function, analogous to
636 update_compcall_arglist, but for procedure pointer components.
637 (resolve_typebound_generic_call): Added argument to update_arglist_pass.
638 (resolve_ppc_call, resolve_expr_ppc): Take care of PASS attribute.
639 (resolve_fl_derived): Check the PASS argument for procedure pointer
641 * symbol.c (verify_bind_c_derived_type): Reject procedure pointer
642 components in BIND(C) types.
644 2009-07-24 Janus Weil <janus@gcc.gnu.org>
647 * array.c (gfc_resolve_character_array_constructor): Use new function
649 * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec,
650 gfc_match_implicit): Ditto.
651 * expr.c (gfc_simplify_expr): Ditto.
652 * gfortran.h (gfc_new_charlen): New prototype.
653 * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Use new
654 function gfc_new_charlen.
655 * module.c (mio_charlen): Ditto.
656 * resolve.c (gfc_resolve_substring_charlen,
657 gfc_resolve_character_operator,fixup_charlen,resolve_fl_derived,
658 resolve_symbol): Ditto.
659 * symbol.c (gfc_new_charlen): New function to create a new gfc_charlen
660 structure and add it to a namespace.
661 (gfc_copy_formal_args_intr): Make sure ts.cl is present
662 for CHARACTER variables.
664 2009-07-24 Jakub Jelinek <jakub@redhat.com>
668 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc,
669 gfc_conv_intrinsic_minmaxval): Handle Infinities and NaNs properly,
671 * trans-array.c (gfc_trans_scalarized_loop_end): No longer static.
672 * trans-array.h (gfc_trans_scalarized_loop_end): New prototype.
674 2009-07-23 Jakub Jelinek <jakub@redhat.com>
677 * io.c (gfc_resolve_dt): Add LOC argument. Fail if
678 dt->io_unit is NULL. Return FAILURE after issuing error about
679 negative UNIT number.
680 (match_io_element): Don't segfault if current_dt->io_unit is NULL.
681 * gfortran.h (gfc_resolve_dt): Adjust prototype.
682 * resolve.c (resolve_code): Adjust caller.
684 2009-07-22 Paul Thomas <pault@gcc.gnu.org>
687 * trans-decl.c (generate_local_decl): Unreferenced result
688 variables with allocatable components should be treated like
689 INTENT_OUT dummy variables.
691 2009-07-22 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
693 * trans.h (gfc_set_decl_assembler_name): New prototype.
694 * trans-decl.c (gfc_set_decl_assembler_name): New function.
695 (gfc_get_symbol_decl, gfc_get_extern_function_decl,
696 build_function_decl): Use gfc_set_decl_assembler_name instead of
697 SET_DECL_ASSEMBLER_NAME.
698 * trans-common.c (build_common_decl): Use
699 gfc_set_decl_assembler_name instead of SET_DECL_ASSEMBLER_NAME.
701 2009-07-21 Richard Guenther <rguenther@suse.de>
704 * trans-decl.c (gfc_get_extern_function_decl): Do not set
705 DECL_IS_MALLOC for pointer valued functions.
706 (build_function_decl): The same.
708 2009-07-19 Steven G. Kargl <kargl@gcc.gnu.org>
711 * fortran/check.c (gfc_check_cmplx, gfc_check_dcmplx): Add check that
712 the optional second argument isn't of COMPLEX type.
714 2009-07-17 Richard Guenther <rguenther@suse.de>
717 * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here.
718 * trans-decl.c (gfc_gimplify_function): Remove.
719 (build_entry_thunks): Do not gimplify here.
720 (create_main_function): Likewise.
721 (gfc_generate_function_code): Likewise.
723 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
724 Manuel López-Ibáñez <manu@gcc.gnu.org>
727 * trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c,
728 trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location
729 argument to fold_{unary,binary,ternary}, fold_build[123],
730 build_call_expr, build_size_arg, build_fold_addr_expr,
731 build_call_array, non_lvalue, size_diffop,
732 fold_build1_initializer, fold_build2_initializer,
733 fold_build3_initializer, fold_build_call_array,
734 fold_build_call_array_initializer, fold_single_bit_test,
735 omit_one_operand, omit_two_operands, invert_truthvalue,
736 fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
737 combine_comparisons, fold_builtin_*, fold_call_expr,
738 build_range_check, maybe_fold_offset_to_address, round_up,
741 2009-07-15 Janus Weil <janus@gcc.gnu.org>
744 * resolve.c (resolve_symbol): Don't resolve the formal namespace of a
747 2009-07-14 Taras Glek <tglek@mozilla.com>
748 Rafael Espindola <espindola@google.com>
750 * Make-lang.in (fortran.install-plugin): New target for
751 installing plugin headers.
753 2009-07-13 H.J. Lu <hongjiu.lu@intel.com>
755 * module.c (mio_symbol): Remove the unused variable, formal.
757 2009-07-13 Janus Weil <janus@gcc.gnu.org>
760 * module.c (mio_symbol): If the symbol has formal arguments,
761 the formal namespace will be present.
762 * resolve.c (resolve_actual_arglist): Correctly handle 'called'
763 procedure pointer components as actual arguments.
764 (resolve_fl_derived,resolve_symbol): Make sure the formal namespace
766 * trans-expr.c (gfc_conv_procedure_call): Correctly handle the formal
767 arguments of procedure pointer components.
769 2009-07-12 Tobias Burnus <burnus@net-b.de>
770 Philippe Marguinaud <philippe.marguinaud@meteo.fr>
773 * primary.c (match_charkind_name): Fix condition for $ matching.
776 * libgfortran.h: Typedef the GFC_DTYPE_* enum.
778 2009-07-11 Tobias Burnus <burnus@net-b.de>
781 * check.c (gfc_check_fn_rc2008): New function.
782 * intrinsic.h (gfc_check_fn_rc2008): New prototype.
783 * intrinsic.c (add_functions): Add complex tan, cosh, sinh,
786 2009-07-10 Paul Thomas <pault@gcc.gnu.org>
789 * primary.c (match_kind_param): Return MATCH_NO if the symbol
792 2008-07-09 Paul Thomas <pault@gcc.gnu.org>
795 * resolve.c (check_host_association): Use the existing
796 accessible symtree and treat function expressions with
797 symbols that have procedure flavor.
799 2009-07-09 Janus Weil <janus@gcc.gnu.org>
802 * dump-parse-tree.c (show_expr): Renamed 'is_proc_ptr_comp'.
803 * expr.c (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'.
804 (gfc_check_pointer_assign): Renamed 'is_proc_ptr_comp'.
805 (replace_comp,gfc_expr_replace_comp): New functions, analogous
806 to 'replace_symbol' and 'gfc_expr_replace_symbol', just with components
808 * gfortran.h (gfc_expr_replace_comp): New prototype.
809 (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'.
810 * interface.c (compare_actual_formal): Renamed 'is_proc_ptr_comp'.
811 * match.c (gfc_match_pointer_assignment): Ditto.
812 * primary.c (gfc_match_varspec): Handle array-valued procedure pointers
813 and procedure pointer components. Renamed 'is_proc_ptr_comp'.
814 * resolve.c (resolve_fl_derived): Correctly handle interfaces with
815 RESULT statement, and handle array-valued procedure pointer components.
816 (resolve_actual_arglist,resolve_ppc_call,resolve_expr_ppc): Renamed
818 * trans-array.c (gfc_walk_function_expr): Ditto.
819 * trans-decl.c (gfc_get_symbol_decl): Security check for presence of
821 * trans-expr.c (gfc_conv_procedure_call): Handle array-valued procedure
822 pointer components. Renamed 'is_proc_ptr_comp'.
823 (conv_function_val,gfc_trans_arrayfunc_assign): Renamed
825 (gfc_get_proc_ptr_comp): Do not modify the argument 'e', but instead
827 * trans-io.c (gfc_trans_transfer): Handle array-valued procedure
830 2009-07-09 Tobias Burnus <burnus@net-b.de>
833 * intrinsic.c (gfc_convert_type_warn): Set sym->result.
834 * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer
835 for optional arguments.
837 2009-07-08 Tobias Burnus <burnus@net-b.de>
840 * simplify.c (gfc_simplify_sign): Handle signed zero correctly.
841 * trans-intrinsic.c (gfc_conv_intrinsic_sign): Support
843 * invoke.texi (-fno-sign-zero): Add text regarding SIGN intrinsic.
845 2008-07-08 Paul Thomas <pault@gcc.gnu.org>
848 * decl.c (match_procedure_interface): Correct the association
849 or creation of the interface procedure's symbol.
851 2009-07-04 Jakub Jelinek <jakub@redhat.com>
853 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): For integer
854 maxloc initialize limit to -huge-1 rather than just -huge.
856 2009-07-04 Janus Weil <janus@gcc.gnu.org>
859 * interface.c (compare_actual_formal): Take care of proc-pointer-valued
860 functions as actual arguments.
861 * trans-expr.c (gfc_conv_procedure_call): Ditto.
862 * resolve.c (resolve_specific_f0): Use the correct ts.
864 2009-07-02 Michael Matz <matz@suse.de>
867 * trans-array.c (gfc_conv_descriptor_stride_get): Return
868 constant one for strides in the first dimension of ALLOCATABLE
871 2009-06-30 Janus Weil <janus@gcc.gnu.org>
874 * trans-types.c (gfc_get_derived_type): Bugfix, reverting one hunk from
877 2009-06-29 Tobias Burnus <burnus@net-b.de>
880 * trans-expr.c (gfc_conv_procedure_call): Add -fcheck=pointer check.
881 * libgfortran.h: Add GFC_RTCHECK_POINTER.
882 * invoke.texi (-fcheck): Document new pointer option.
883 * options.c (gfc_handle_runtime_check_option): Handle pointer option.
885 * gfortran.texi (C Binding): Improve wording.
886 * iso-c-binding.def: Remove obsolete comment.
888 2009-06-29 Paul Thomas <pault@gcc.gnu.org>
891 * dependency.h : Add second bool* argument to prototype of
892 gfc_full_array_ref_p.
893 * dependency.c (gfc_full_array_ref_p): If second argument is
894 present, return true if last dimension of reference is an
895 element or has unity stride.
896 * trans-array.c : Add NULL second argument to references to
897 gfc_full_array_ref_p.
898 * trans-expr.c : The same, except for;
899 (gfc_trans_arrayfunc_assign): Return fail if lhs reference
900 is not a full array or a contiguous section.
902 2009-06-28 Tobias Burnus <burnus@net-b.de>
903 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
906 * symbol.c (gfc_add_ext_attribute): New function.
907 (gfc_get_sym_tree): New argument allow_subroutine.
908 (gfc_get_symbol,gfc_get_ha_sym_tree,gen_cptr_param,gen_fptr_param
909 gen_shape_param,generate_isocbinding_symbol): Use it.
910 * decl.c (find_special): New argument allow_subroutine.
911 (add_init_expr_to_sym,add_hidden_procptr_result,attr_decl1,
912 match_procedure_in_type,gfc_match_final_decl): Use it.
913 (gfc_match_gcc_attributes): New function.
914 * gfortran.texi (Mixed-Language Programming): New section
915 "GNU Fortran Compiler Directives".
916 * gfortran.h (ext_attr_t): New struct.
917 (symbol_attributes): Use it.
918 (gfc_add_ext_attribute): New prototype.
919 (gfc_get_sym_tree): Update pototype.
920 * expr.c (gfc_check_pointer_assign): Check whether call
921 convention is the same.
922 * module.c (import_iso_c_binding_module, create_int_parameter,
923 use_iso_fortran_env_module): Update gfc_get_sym_tree call.
924 * scanner.c (skip_gcc_attribute): New function.
925 (skip_free_comments,skip_fixed_comments): Use it.
926 (gfc_next_char_literal): Support !GCC$ lines.
927 * resolve.c (check_host_association): Update
928 gfc_get_sym_tree call.
929 * match.c (gfc_match_sym_tree,gfc_match_call): Update
930 gfc_get_sym_tree call.
931 * trans-decl.c (add_attributes_to_decl): New function.
932 (gfc_get_symbol_decl,get_proc_pointer_decl,
933 gfc_get_extern_function_decl,build_function_decl: Use it.
934 * match.h (gfc_match_gcc_attributes): Add prototype.
935 * parse.c (decode_gcc_attribute): New function.
936 (next_free,next_fixed): Support !GCC$ lines.
937 * primary.c (match_actual_arg,check_for_implicit_index,
938 gfc_match_rvalue,gfc_match_rvalue): Update
939 gfc_get_sym_tree call.
941 2009-06-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
943 * gfortran.h: Define HAVE_mpc_pow.
944 * arith.c (complex_reciprocal, complex_pow): If HAVE_mpc_pow,
945 don't define these functions.
946 (arith_power): If HAVE_mpc_pow, use mpc_pow.
948 2009-06-26 Janus Weil <janus@gcc.gnu.org>
952 * decl.c (add_hidden_procptr_result): Copy the typespec to the hidden
954 * expr.c (gfc_check_pointer_assign): Enable interface check for
955 procedure pointer assignments where the rhs is a function returning a
957 * resolve.c (resolve_symbol): If an external procedure with unspecified
958 return type can not be implicitly typed, it must be a subroutine.
960 2009-06-24 Janus Weil <janus@gcc.gnu.org>
963 * gfortran.h (gfc_component): New member 'formal_ns'.
964 (gfc_copy_formal_args_ppc,void gfc_ppc_use): New.
965 * interface.c (gfc_ppc_use): New function, analogous to
966 gfc_procedure_use, but for procedure pointer components.
967 * module.c (MOD_VERSION): Bump module version.
968 (mio_component): Treat formal arguments.
969 (mio_formal_arglist): Changed argument from gfc_symbol to
971 (mio_symbol): Changed argument of mio_formal_arglist.
972 * resolve.c (resolve_ppc_call,resolve_expr_ppc): Call gfc_ppc_use,
973 to check actual arguments and treat formal args correctly.
974 (resolve_fl_derived): Copy formal args of procedure pointer components
975 from their interface.
976 * symbol.c (gfc_copy_formal_args_ppc): New function, analogous to
977 gfc_copy_formal_args, but for procedure pointer components.
979 2009-06-22 Janus Weil <janus@gcc.gnu.org>
983 * interface.c (compare_parameter): Set implicit type for function
984 actual arguments with BT_UNKNOWN.
986 2009-06-22 Tobias Burnus <burnus@net-b.de>
990 * simplify.c (gfc_simplify_spread): Fix the case that source=
993 2009-06-22 Paul Thomas <pault@gcc.gnu.org>
996 * interface.c (gfc_search_interface): Hold back a match to an
997 elementary procedure until all other possibilities are
1000 2009-06-22 Paul Thomas <pault@gcc.gnu.org>
1003 * simplify.c (gfc_simplify_spread): Restrict the result size to
1004 the limit for an array constructor.
1006 2009-06-21 Janus Weil <janus@gcc.gnu.org>
1009 * interface.c (gfc_compare_interfaces): Take care of implicit typing
1010 when checking the function attribute. Plus another bugfix.
1011 (compare_parameter): Set attr.function and attr.subroutine according
1012 to the usage of a procedure as actual argument.
1014 2009-06-20 Tobias Burnus <burnus@net-b.de>
1017 * trans-decl.c (add_argument_checking): Disable bounds check
1018 for allowed argument storage association.
1020 2009-06-19 Paul Thomas <pault@gcc.gnu.org>
1023 * trans-expr.c (gfc_conv_procedure_call): Do not deallocate
1024 allocatable components if the argument is a pointer.
1026 2009-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1028 * gfortran.h (gfc_expr): Use mpc_t to represent complex numbers.
1030 * arith.c, dump-parse-tree.c, expr.c, module.c, resolve.c,
1031 simplify.c, target-memory.c, target-memory.h, trans-const.c,
1032 trans-expr.c: Convert to mpc_t throughout.
1034 2009-06-19 Ian Lance Taylor <iant@google.com>
1036 * cpp.c (struct gfc_cpp_option_data): Give this struct, used for
1037 the global variable gfc_cpp_option, a name.
1039 2009-06-19 Janus Weil <janus@gcc.gnu.org>
1042 * trans-expr.c (gfc_conv_procedure_call): Only add an extra addr_expr
1043 to a procedure pointer actual argument, if it is not itself a
1046 2009-06-18 Janus Weil <janus@gcc.gnu.org>
1049 * resolve.c (resolve_contained_fntype): Prevent implicit typing for
1050 procedures with explicit interface.
1051 * symbol.c (gfc_check_function_type): Ditto.
1053 2009-06-16 Ian Lance Taylor <iant@google.com>
1055 * decl.c (build_struct): Rewrite loop over constructor elements.
1057 2009-06-16 Janus Weil <janus@gcc.gnu.org>
1061 * expr.c (gfc_check_pointer_assign): Call 'gfc_compare_interfaces' with
1063 * gfortran.h (gfc_compare_interfaces): Additional argument.
1064 * interface.c (operator_correspondence): Removed.
1065 (gfc_compare_interfaces): Additional argument to return error message.
1066 Directly use the code from 'operator_correspondence' instead of calling
1067 the function. Check for OPTIONAL. Some rearrangements.
1068 (check_interface1): Call 'gfc_compare_interfaces' without error message.
1069 (compare_parameter): Call 'gfc_compare_interfaces' with error message.
1070 * resolve.c (check_generic_tbp_ambiguity): Call 'gfc_compare_interfaces'
1071 without error message.
1073 2009-06-16 Tobias Burnus <burnus@net-b.de>
1076 * trans-decl.c (create_function_arglist): Copy formal charlist to
1077 have a proper passed_length for -fcheck=bounds.
1079 2009-06-12 Steven G. Kargl <kargls@comcast.net>
1081 * arith.c (gfc_enum_initializer): Move function ...
1082 * decl.c: ... here. Remove gfc_ prefix and make static.
1083 (enumerator_decl): Update function call.
1084 * gfortran.h: Remove gfc_enum_initializer prototype.
1086 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
1088 * trans-array.c (gfc_trans_allocate_array_storage): Pass
1090 (gfc_trans_array_constructor_value): Same.
1091 (gfc_trans_scalarized_loop_end): Same.
1092 (gfc_conv_ss_startstride): Same.
1093 (gfc_trans_g77_array): Same.
1094 (gfc_trans_dummy_array_bias): Same.
1095 (gfc_conv_array_parameter): Same.
1096 (structure_alloc_comps): Same.
1097 * trans-expr.c (gfc_conv_function_call): Same.
1098 (fill_with_spaces): Same.
1099 (gfc_trans_string_copy): Same.
1100 (gfc_trans_scalar_assign): Same.
1101 * trans-stmt.c (gfc_trans_goto): Same.
1102 (gfc_trans_if_1): Same.
1103 (gfc_trans_simple_do): Same.
1104 (gfc_trans_do): Same.
1105 (gfc_trans_do_while): Same.
1106 (gfc_trans_logical_select): Same.
1107 (gfc_trans_select): Same.
1108 (gfc_trans_forall_loop): Same.
1109 (gfc_trans_nested_forall_loop): Same.
1110 (generate_loop_for_temp_to_lhs): Same.
1111 (generate_loop_for_rhs_to_temp): Same.
1112 (gfc_trans_forall_1): Same.
1113 (gfc_trans_where_assign): Same.
1114 (gfc_trans_where_3): Same.
1115 (gfc_trans_allocate): Same.
1116 * trans.c (gfc_finish_block): Same.
1117 (gfc_trans_runtime_check): Same.
1118 (gfc_call_malloc): Same.
1119 (gfc_allocate_with_status): Same.
1120 (gfc_call_free): Same.
1121 (gfc_deallocate_with_status): Same.
1122 (gfc_call_realloc): Same.
1123 (gfc_trans_code): Same.
1124 * trans-decl.c (gfc_init_default_dt): Same.
1125 (gfc_generate_constructors): Same.
1126 * trans-io.c (gfc_trans_io_runtime_check): Same.
1127 * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
1128 (gfc_conv_intrinsic_fdate): Same.
1129 (gfc_conv_intrinsic_ttynam): Same.
1130 (gfc_conv_intrinsic_minmax): Same.
1131 (gfc_conv_intrinsic_minmax_char): Same.
1132 (gfc_conv_intrinsic_anyall): Same.
1133 (gfc_conv_intrinsic_count): Same.
1134 (gfc_conv_intrinsic_arith): Same.
1135 (gfc_conv_intrinsic_minmaxloc): Same.
1136 (gfc_conv_intrinsic_minmaxval): Same.
1137 (gfc_conv_intrinsic_rrspacing): Same.
1138 (gfc_conv_intrinsic_array_transfer): Same.
1139 (gfc_conv_intrinsic_trim): Same.
1140 (gfc_conv_intrinsic_repeat): Same.
1142 2009-06-12 Janus Weil <janus@gcc.gnu.org>
1145 * resolve.c (resolve_symbol): Additional error check, preventing an
1148 2009-06-11 Paul Thomas <pault@gcc.gnu.org>
1151 * resolve.c (next_data_value): It is an error if the value is
1154 2009-06-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1157 * intrinsic.c (add_functions): Add simplifiers for ISNAN,
1158 IS_IOSTAT_END and IS_IOSTAT_EOR.
1159 * intrinsic.h (gfc_simplify_is_iostat_end, gfc_simplify_is_iostat_eor,
1160 gfc_simplify_isnan): New prototypes.
1161 * intrinsic.c (gfc_simplify_is_iostat_end, gfc_simplify_is_iostat_eor,
1162 gfc_simplify_isnan): New functions.
1164 2009-06-11 Jakub Jelinek <jakub@redhat.com>
1166 * interface.c (fold_unary): Rename to...
1167 (fold_unary_intrinsic): ... this.
1168 (gfc_extend_expr): Adjust caller.
1169 (gfc_match_generic_spec): Likewise. Initialize *op to INTRINSIC_NONE
1171 * expr.c (gfc_simplify_expr): Initialize start and end before calling
1174 2009-06-10 Dave Korn <dave.korn.cygwin@gmail.com>
1176 * trans-decl.c (create_main_function): Don't build main decl twice.
1178 2009-06-09 Tobias Burnus <burnus@net-b.de>
1180 * trans-decl.c (gfc_generate_function_code): Use gfc_option.rtcheck
1181 instead of flag_bounds_check.
1182 * intrinsic.texi (ISO_FORTRAN_ENV): Document INT{8,16,32,64} and
1185 2009-06-08 Paul Thomas <pault@gcc.gnu.org>
1187 * trans-array.h : Replace prototypes for
1188 gfc_conv_descriptor_offset, gfc_conv_descriptor_stride,
1189 gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound with new
1190 prototypes of the same names with _get or _set appended.
1191 * trans-array.c : Make the originals of the above static and
1192 new functions for the _get and _set functions. Update all the
1193 references to these descriptor access functions.
1194 * trans-expr.c : Update references to the above descriptor
1196 * trans-intrinsic.c : The same.
1197 * trans-openmp.c : The same.
1198 * trans-stmt.c : The same.
1200 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
1202 * options.c (gfc_post_options): Disable dump_parse_tree
1203 during -fcompare-debug-second.
1205 2009-06-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1208 * gfortran.h (gfc_open): Add newunit expression to structure.
1209 * io.c (io_tag): Add new unit tag and fix whitespace.
1210 (match_open_element): Add matching for newunit.
1211 (gfc_free_open): Free the newunit expression.
1212 (gfc_resolve_open): Add newunit to resolution and check constraints.
1213 (gfc_resolve_close): Add check for non-negative unit.
1214 (gfc_resolve_filepos): Likewise.
1215 (gfc_resolve_dt): Likewise.
1216 * trans-io.c (set_parameter_value): Build runtime checks for unit
1217 numbers within range of kind=4 integer. (gfc_trans_open) Set the
1219 * ioparm.def (IOPARM): Define the newunit parameter as a pointer
1220 to GFC_INTEGER_4, pint4.
1222 2009-06-07 Daniel Franke <franke.daniel@gmail.com>
1226 * array.c (gfc_append_constructor): Added NULL-check.
1227 * check.c (gfc_check_spread): Check DIM.
1228 (gfc_check_unpack): Check that the ARRAY arguments provides enough
1230 * intrinsic.h (gfc_simplify_spread): New prototype.
1231 (gfc_simplify_unpack): Likewise.
1232 * intrinsic.c (add_functions): Added new simplifier callbacks.
1233 * simplify.c (gfc_simplify_spread): New.
1234 (gfc_simplify_unpack): New.
1235 * expr.c (check_transformational): Allow additional transformational
1236 intrinsics in initialization expression.
1238 2009-06-07 Daniel Franke <franke.daniel@gmail.com>
1242 * check.c (gfc_check_all_any): Check rank of DIM.
1243 (gfc_check_count): Likewise.
1244 * intrinsic.h (gfc_simplify_all): New prototype.
1245 (gfc_simplify_any): Likewise.
1246 (gfc_simplify_count): Likewise.
1247 (gfc_simplify_sum): Likewise.
1248 (gfc_simplify_product): Likewise.
1249 * intrinsic.c (add_functions): Added new simplifier callbacks.
1250 * simplify.c (transformational_result): New.
1251 (simplify_transformation_to_scalar): New.
1252 (simplify_transformation_to_array): New.
1254 (gfc_simplify_all): New.
1255 (gfc_simplify_any): New.
1256 (gfc_simplify_count): New.
1257 (gfc_simplify_sum): New.
1258 (gfc_simplify_product): New.
1259 * expr.c (check_transformational): Allow additional transformational
1260 intrinsics in initialization expression.
1262 2009-06-07 Daniel Franke <franke.daniel@gmail.com>
1264 * check.c (dim_rank_check): Return SUCCESS if DIM=NULL.
1265 (gfc_check_lbound): Removed (now) redundant check for DIM=NULL.
1266 (gfc_check_minloc_maxloc): Likewise.
1267 (check_reduction): Likewise.
1268 (gfc_check_size): Likewise.
1269 (gfc_check_ubound): Likewise.
1270 (gfc_check_cshift): Added missing shape-conformance checks.
1271 (gfc_check_eoshift): Likewise.
1272 * gfortran.h (gfc_check_conformance): Modified prototype to printf-style.
1273 * expr.c (gfc_check_conformance): Accept error-message chunks in
1274 printf-style. Changed all callers.
1277 2009-06-07 Daniel Franke <franke.daniel@gmail.com>
1281 * intrinsic.h (gfc_simplify_dot_product): New prototype.
1282 (gfc_simplify_matmul): Likewise.
1283 (gfc_simplify_transpose): Likewise.
1284 * intrinsic.c (add_functions): Added new simplifier callbacks.
1285 * simplify.c (init_result_expr): New.
1286 (compute_dot_product): New.
1287 (gfc_simplify_dot_product): New.
1288 (gfc_simplify_matmul): New.
1289 (gfc_simplify_transpose): New.
1290 * expr.c (check_transformational): Allow transformational intrinsics
1291 with simplifier in initialization expression.
1293 2009-06-06 Daniel Franke <franke.daniel@gmail.com>
1296 * simplify.c (gfc_simplify_reshape): Fixed reshaping of empty arrays
1299 2009-06-06 Daniel Franke <franke.daniel@gmail.com>
1302 * intrinsic.h (gfc_simplify_pack): New prototype.
1303 * intrinsic.c (add_functions): Added
1304 simplifier-callback to PACK.
1305 * simplify.c (is_constant_array_expr): Moved
1306 to beginning of file.
1307 (gfc_simplify_pack): New.
1308 * check.c (gfc_check_pack): Check that VECTOR has enough elements.
1309 Added safeguards for empty arrays.
1311 2009-06-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1313 * simplify.c (call_mpc_func): Use mpc_realref/mpc_imagref
1314 instead of MPC_RE/MPC_IM.
1316 2009-06-05 Alexandre Oliva <aoliva@redhat.com>
1318 * trans-decl.c (gfc_build_qualified_array): Don't skip generation
1320 * trans.h (struct lang_type): Add base_decls.
1321 (GFC_TYPE_ARRAY_BASE_DECL): New.
1322 * trans-types.c (gfc_get_array_type_bounds): Initialize base decls
1323 proactively and excessively.
1324 (gfc_get_array_descr_info): Use existing base decls if available.
1326 2009-06-04 Daniel Franke <franke.daniel@gmail.com>
1329 * check.c (gfc_check_reshape): Additional checks for the
1330 SHAPE and ORDER arguments.
1331 * simplify.c (gfc_simplify_reshape): Converted argument checks
1334 2009-06-03 Tobias Burnus <burnus@net-b.de>
1336 * gfortran.texi: Add mixed-language programming, mention
1337 varying string lengths, some clean up of introduction parts.
1338 * intrinsic.texi (instrinsic modules): Create @menu for subsections.
1339 (ISO_C_BINDING): Support ISOCBINDING_INT_FAST128_T.
1340 * libgfortran.h: Comment to rember to keep gfortran.texi in sync.
1341 * iso-c-binding.def: Support ISOCBINDING_INT_FAST128_T.
1343 2009-06-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1344 Tobias Burnus <burnus@net-b.de>
1346 * iso-c-binding.def: Use INTMAX_TYPE instead of intmax_type_node.
1347 * trans-types.c (init_c_interop_kinds): Remove intmax_type_node.
1349 2009-06-03 Alexandre Oliva <aoliva@redhat.com>
1351 * module.c (mio_f2k_derived): Initialize cur.
1353 2009-06-01 Tobias Burnus <burnus@net-b.de>
1356 * trans-decl.c (gfc_sym_identifier): Use "MAIN__" for PROGRAM "main".
1357 (create_main_function): Set main_identifier_node.
1359 2009-05-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1362 * trans-types.c (gfc_build_uint_type): Make nonstatic.
1363 * trans.h (gfor_fndecl_clz128, gfor_fndecl_ctz128): New prototypes.
1364 * trans-types.h (gfc_build_uint_type): Add prototype.
1365 * trans-decl.c (gfc_build_intrinsic_function_decls): Build
1366 gfor_fndecl_clz128 and gfor_fndecl_ctz128.
1367 * trans-intrinsic.c (gfc_conv_intrinsic_leadz,
1368 gfc_conv_intrinsic_trailz): Call the right builtins or library
1369 functions, and cast arguments to unsigned types first.
1370 * simplify.c (gfc_simplify_leadz): Deal with negative arguments.
1372 2009-05-27 Ian Lance Taylor <iant@google.com>
1374 * Make-lang.in (gfortran$(exeext)): Change $(COMPILER) to
1376 (f951$(exeext)): Likewise.
1378 2009-05-27 Tobias Burnus <burnus@net-b.de>
1381 * trans-decl.c (create_main_function): Mark MAIN__ and
1382 argc/argv as TREE_USED and push/pop function_decl context
1385 2009-05-26 Tobias Burnus <burnus@net-b.de>
1388 * gfortranspec.c (lang_specific_driver): Stop linking
1390 * trans-decl.c (gfc_build_builtin_function_decls): Stop
1391 making MAIN__ publicly visible.
1392 (gfc_build_builtin_function_decls): Add
1393 gfor_fndecl_set_args.
1394 (create_main_function) New function.
1395 (gfc_generate_function_code): Use it.
1397 2009-05-26 Tobias Burnus <burnus@net-b.de>
1400 * match.c (gfc_match_nullify): NULLify freed pointer.
1402 2009-05-26 Ian Lance Taylor <iant@google.com>
1404 * Make-lang.in (gfortranspec.o): Use $(COMPILER).
1405 (gfortran$(exeext), f951$(exeext), fortran/cpp.o): Likewise.
1407 2009-05-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1409 * gfortran.h (GFC_MPC_RND_MODE): New.
1410 * simplify.c (call_mpc_func): New helper function.
1411 (gfc_simplify_cos, gfc_simplify_exp, gfc_simplify_log,
1412 gfc_simplify_sin, gfc_simplify_sqrt): Add MPC support.
1414 2009-05-25 Janus Weil <janus@gcc.gnu.org>
1417 * primary.c (gfc_match_varspec): Handle procedure pointer components
1418 with array return value.
1419 * resolve.c (resolve_expr_ppc): Ditto.
1420 (resolve_symbol): Make sure the interface of a procedure pointer has
1422 * trans-array.c (gfc_walk_function_expr): Handle procedure pointer
1423 components with array return value.
1424 * trans-expr.c (gfc_conv_component_ref,gfc_conv_procedure_call,
1425 gfc_trans_arrayfunc_assign): Ditto.
1426 (gfc_trans_pointer_assignment): Handle procedure pointer assignments,
1427 where the rhs is a dummy argument.
1428 * trans-types.c (gfc_get_ppc_type,gfc_get_derived_type): Handle
1429 procedure pointer components with array return value.
1431 2009-05-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1436 * trans-array.c (gfc_conv_ss_startstride): Add one to index.
1438 2009-05-22 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1441 * module.c (read_md5_from_module_file): Close file before returning.
1443 2009-05-18 Janus Weil <janus@gcc.gnu.org>
1446 * primary.c (gfc_match_rvalue): Handle procedure pointer components in
1448 * resolve.c (resolve_ppc_call,resolve_expr_ppc): Resolve component and
1450 (resolve_fl_derived): Procedure pointer components are not required to
1451 have constant array bounds in their return value.
1453 2009-05-18 Janus Weil <janus@gcc.gnu.org>
1455 * intrinsic.c (add_sym): Fix my last commit (r147655),
1456 which broke bootstrap.
1458 2009-05-18 Richard Guenther <rguenther@suse.de>
1461 * trans-expr.c (gfc_trans_zero_assign): For local array
1462 destinations use an assignment from an empty constructor.
1464 2009-05-18 Janus Weil <janus@gcc.gnu.org>
1468 * expr.c (gfc_check_pointer_assign): Check intents when comparing
1470 * gfortran.h (typedef struct gfc_intrinsic_arg): Add 'intent' member.
1471 (gfc_compare_interfaces): Additional argument.
1472 * interface.c (operator_correspondence): Add check for equality of
1473 intents, and new argument 'intent_check'.
1474 (gfc_compare_interfaces): New argument 'intent_check', which is passed
1475 on to operator_correspondence.
1476 (check_interface1): Don't check intents when comparing interfaces.
1477 (compare_parameter): Do check intents when comparing interfaces.
1478 * intrinsic.c (add_sym): Add intents for arguments of intrinsic
1480 (add_sym_1,add_sym_1s,add_sym_1m,add_sym_2,add_sym_2s,add_sym_3,
1481 add_sym_3ml,add_sym_3red,add_sym_3s,add_sym_4): Use INTENT_IN by
1483 (add_sym_1_intent,add_sym_1s_intent,add_sym_2s_intent,add_sym_3s_intent)
1484 : New functions to add intrinsic symbols, specifying custom intents.
1485 (add_sym_4s,add_sym_5s): Add new arguments to specify intents.
1486 (add_functions,add_subroutines): Add intents for various intrinsics.
1487 * resolve.c (check_generic_tbp_ambiguity): Don't check intents when
1488 comparing interfaces.
1489 * symbol.c (gfc_copy_formal_args_intr): Copy intent.
1491 2009-05-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1493 * iso-fortran-env.def: Define INT8, INT16, INT32, INT64, REAL32,
1495 * gfortran.h (gfc_get_int_kind_from_width_isofortranenv,
1496 gfc_get_real_kind_from_width_isofortranenv): New prototypes.
1497 * iso-c-binding.def: Update definitions for the INT*_T,
1498 INT_LEAST*_T and INT_FAST*_T named parameters.
1499 * trans-types.c (get_typenode_from_name, get_int_kind_from_name,
1500 gfc_get_real_kind_from_width_isofortranenv): New functions.
1502 2009-05-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1505 * intrinsic.c (add_functions, add_subroutines): Fix argument
1506 names and wrap long lines.
1507 * intrinsic.texi: Fix documentation and argument names of
1508 LOG_GAMMA, DATAN2, DBESJN, DTIME, ETIME, FSTAT, STAT, LSTAT,
1509 GET_COMMAND, IDATE, LTIME, MOVE_ALLOC, NINT, OR, PRODUCT,
1510 SUM, RAND, RANDOM_SEED, REAL, SELECTED_INT_KIND,
1511 SELECTED_REAL_KIND and XOR.
1513 2009-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1516 * intrinsic.c (add_functions): Use ERFC_SCALED simplification.
1517 * intrinsic.h (gfc_simplify_erfc_scaled): New prototype.
1518 * simplify.c (fullprec_erfc_scaled, asympt_erfc_scaled,
1519 gfc_simplify_erfc_scaled): New functions.
1521 2009-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1524 * resolve.c (resolve_substring): Don't allow too large substring
1526 (gfc_resolve_substring_charlen): Fix typo.
1527 (gfc_resolve_character_operator): Fix typo.
1528 (resolve_charlen): Catch unreasonably large string lengths.
1529 * simplify.c (gfc_simplify_len): Don't error out on LEN
1532 2009-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1535 * decl.c (set_enum_kind): Use global short-enums flag.
1536 * gfortran.h (gfc_option_t): Remove short_enums flag.
1537 * lang.opt (-fshort-enums): Refer to C documentation.
1538 * options.c (gfc_init_options, gfc_handle_option): Use global
1541 2009-05-15 Tobias Burnus <burnus@net-b.de>
1544 * f95-lang.c: Add gfc_maybe_initialize_eh.
1545 * gfortran.h: Add gfc_maybe_initialize_eh prototype.
1546 * Make-lang.in: Add new .h dendencies for f95-lang.c
1547 * openmp.c (resolve_omp_do): Call gfc_maybe_initialize_eh.
1548 * misc.c (gfc_free): Avoid #define trickery for free.
1550 2009-05-14 Steven G. Kargl <kargl@gcc.gnu.org>
1552 * dump-parse-tree.c (show_code_node): Add ERRMSG to the dumping
1553 of allocate and deallocate statements.
1555 2009-05-14 Ian Lance Taylor <iant@google.com>
1557 * decl.c (match_attr_spec): Change d to unsigned int.
1558 * dump-parse-tree.c (show_namespace): Change op to int. Add cast.
1559 * interface.c (gfc_check_interfaces): Change i to int. Add casts.
1560 * module.c (read_module): Change i to int. Add cast.
1561 (write_module): Change i to int.
1562 * symbol.c (gfc_get_namespace): Change in to int.
1563 (gfc_free_namespace): Change i to int.
1564 * trans-io.c (gfc_build_io_library_fndecls): Change ptype to
1565 unsigned int. Add cast.
1566 * trans-types.c (gfc_init_kinds): Change mode to unsigned int.
1569 2009-05-14 Daniel Kraft <d@domob.eu>
1572 * dump-parse-tree.c (show_typebound): Fix missing adaption to new
1573 type-bound procedure storage structure.
1575 2009-05-14 Janus Weil <janus@gcc.gnu.org>
1578 * decl.c (gfc_match_function_decl): Use gfc_add_type.
1579 * symbol.c (gfc_add_type): Better checking for duplicate types in
1580 function declarations. And: Always give an error for duplicte types,
1581 not just a warning with -std=gnu.
1583 2009-05-14 Jakub Jelinek <jakub@redhat.com>
1586 * io.c (resolve_tag_format): CHARACTER array in FMT= argument
1587 isn't an extension. Reject non-CHARACTER array element of
1588 assumed shape or pointer or assumed size array.
1589 * trans-array.c (array_parameter_size): New function.
1590 (gfc_conv_array_parameter): Add size argument. Call
1591 array_parameter_size if it is non-NULL.
1592 * trans-array.h (gfc_conv_array_parameter): Adjust prototype.
1593 * trans-expr.c (gfc_conv_function_call, gfc_trans_arrayfunc_assign):
1595 * trans-intrinsic.c (gfc_conv_intrinsic_loc): Likewise.
1596 * trans-io.c (gfc_convert_array_to_string): Rewritten.
1598 2009-05-13 Steven G. Kargl <kargl@gcc.gnu.org>
1600 * gfortran.h (gfc_code): Rename struct member expr to expr1.
1601 * openmp.c (resolve_omp_atomic): Update expr to expr1.
1602 * interface.c (gfc_extend_assign): Ditto.
1603 * trans-expr.c (gfc_conv_expr_reference, gfc_trans_assignment,
1604 gfc_trans_init_assign): Ditto.
1605 * dump-parse-tree.c (show_code_node): Ditto.
1606 * trans-openmp.c (gfc_trans_omp_atomic): Ditto.
1607 * trans-stmt.c ( gfc_trans_label_assign, gfc_trans_goto, gfc_trans_call,
1608 gfc_trans_return, gfc_trans_pause, gfc_trans_stop, gfc_trans_if_1,
1609 gfc_trans_arithmetic_if, gfc_trans_do_while, gfc_trans_integer_select,
1610 gfc_trans_logical_select, gfc_trans_character_select
1611 forall_make_variable_temp, check_forall_dependencies
1612 gfc_trans_forall_1, gfc_trans_where_2, gfc_trans_where_3
1613 gfc_trans_where, gfc_trans_allocate, gfc_trans_deallocate): Ditto.
1614 * io.c (match_io_element, gfc_match_inquire): Ditto.
1615 * resolve.c (resolve_typebound_call, resolve_ppc_call,
1616 resolve_allocate_expr, resolve_allocate_deallocate, resolve_select,
1617 resolve_transfer, resolve_where, gfc_resolve_assign_in_forall,
1618 gfc_resolve_blocks, resolve_code, build_init_assign): Ditto.
1619 * st.c (gfc_free_statement): Ditto.
1620 * match.c (gfc_match_assignment, gfc_match_pointer_assignment,
1621 match_arithmetic_if, gfc_match_if, gfc_match_elseif
1622 gfc_match_stopcode, gfc_match_assign, gfc_match_goto,
1623 gfc_match_nullify, match_typebound_call, gfc_match_call
1624 gfc_match_select, match_simple_where, gfc_match_where
1625 gfc_match_elsewhere, match_simple_forall, gfc_match_forall): Ditto.
1626 * trans-io.c (gfc_trans_transfer): Ditto.
1627 * parse.c (parse_where_block, parse_if_block): Ditto.
1629 2009-05-13 Steven G. Kargl <kargl@gcc.gnu.org>
1631 * gfortran.h (gfc_code): Rename struct member label to label1.
1632 * dump-parse-tree.c (show_code_node): Update symbol.
1633 * trans-stmt.c (gfc_trans_label_assign, gfc_trans_goto,
1634 gfc_trans_arithmetic_if): Ditto.
1635 * resolve.c (gfc_resolve_blocks, resolve_code): Ditto.
1636 * match.c (match_arithmetic_if, gfc_match_if, gfc_reference_st_label,
1637 gfc_match_assign, gfc_match_goto): Ditto.
1638 * parse.c (parse_do_block): Ditto.
1640 2009-05-13 Tobias Burnus <burnus@net-b.de>
1643 * gfortran.h (gfc_exec_op): Add EXEC_END_PROCEDURE.
1644 * dump-parse-tree.c (show_code_node): Use EXEC_END_PROCEDURE.
1645 * trans.c (gfc_trans_code): Ditto.
1646 * resolve.c (resolve_code): Ditto.
1647 * st.c (gfc_free_statement): Ditto.
1648 * parse.c (accept_statement): Ditto.
1650 2009-05-12 Tobias Burnus <burnus@net-b.de>
1653 * decl.c (gfc_match_kind_spec): Turn C kind error into a warning.
1655 2009-05-11 Steve Ellcey <sje@cup.hp.com>
1657 * resolve.c (check_host_association): Initialize tail.
1659 2009-05-11 Janus Weil <janus@gcc.gnu.org>
1662 * resolve.c (resolve_fl_derived): Only return FAILURE if
1663 gfc_notify_std fails.
1665 2009-05-10 Ian Lance Taylor <iant@google.com>
1667 * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
1669 (enum gfc_omp_default_sharing): Likewise.
1670 * module.c (enum gfc_rsym_state): New enum, broken out of
1672 (enum gfc_wsym_state): Likewise.
1673 * parse.c (enum state_order): New enum, broken out of st_state.
1675 2009-05-10 Paul Thomas <pault@gcc.gnu.org>
1678 * trans-array.c (gfc_trans_array_constructor_value): Fold
1679 convert numeric constants.
1680 (gfc_build_constant_array_constructor): The same.
1682 2009-05-10 Paul Thomas <pault@gcc.gnu.org>
1685 * trans-expr.c (gfc_conv_operator_assign): Remove function.
1686 * trans.h : Remove prototype for gfc_conv_operator_assign.
1687 * trans-stmt.c (gfc_conv_elemental_dependencies): Initialize
1688 derivde types with intent(out).
1689 (gfc_trans_call): Add mask, count1 and invert arguments. Add
1690 code to use mask for WHERE assignments.
1691 (gfc_trans_forall_1): Use new arguments for gfc_trans_call.
1692 (gfc_trans_where_assign): The gfc_symbol argument is replaced
1693 by the corresponding code. If this has a resolved_sym, then
1694 gfc_trans_call is called. The call to gfc_conv_operator_assign
1696 (gfc_trans_where_2): Change the last argument in the call to
1697 gfc_trans_where_assign.
1698 * trans-stmt.h : Modify prototype for gfc_trans_call.
1699 * trans.c (gfc_trans_code): Use new args for gfc_trans_call.
1701 2009-05-08 Janus Weil <janus@gcc.gnu.org>
1704 * intrinsic.c (gfc_is_intrinsic): Do not add the EXTERNAL attribute if
1705 the symbol is a module procedure.
1707 2009-05-08 Tobias Burnus <burnus@net-b.de>
1709 * invoke.texi: Add do/recursion to the -fcheck= summary.
1711 2009-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1714 * gfortran.texi: Document that we don't support variable FORMAT
1717 2009-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1720 * error.c (error_print): Add missing break statement.
1722 2009-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1725 * invoke.texi: Document that -fdollar-ok does not allow $ to be
1726 used in IMPLICIT statement.
1728 2009-05-06 Janus Weil <janus@gcc.gnu.org>
1729 Paul Thomas <pault@gcc.gnu.org>
1732 * decl.c (match_procedure_interface): New function to match the
1733 interface for a PROCEDURE statement.
1734 (match_procedure_decl): Call match_procedure_interface.
1735 (match_ppc_decl): New function to match the declaration of a
1736 procedure pointer component.
1737 (gfc_match_procedure): Call match_ppc_decl.
1738 (match_binding_attributes): Add new argument 'ppc' and handle the
1739 POINTER attribute for procedure pointer components.
1740 (match_procedure_in_type,gfc_match_generic): Added new argument to
1741 match_binding_attributes.
1742 * dump-parse-tree.c (show_expr,show_components,show_code_node): Handle
1743 procedure pointer components.
1744 * expr.c (free_expr0,gfc_copy_expr,gfc_simplify_expr): Handle EXPR_PPC.
1745 (gfc_check_pointer_assign): Handle procedure pointer components, but no
1747 (is_proc_ptr_comp): New function to determine if an expression is a
1748 procedure pointer component.
1749 * gfortran.h (expr_t): Add EXPR_PPC.
1750 (symbol_attribute): Add new member 'proc_pointer_comp'.
1751 (gfc_component): Add new member 'formal'.
1752 (gfc_exec_op): Add EXEC_CALL_PPC.
1753 (gfc_get_default_type): Changed first argument.
1754 (is_proc_ptr_comp): Add prototype.
1755 (gfc_match_varspec): Add new argument.
1756 * interface.c (compare_actual_formal): Handle procedure pointer
1758 * match.c (gfc_match_pointer_assignment,match_typebound_call): Handle
1759 procedure pointer components.
1760 * module.c (mio_expr): Handle EXPR_PPC.
1761 * parse.c (parse_derived): Handle procedure pointer components.
1762 * primary.c (gfc_match_varspec): Add new argument 'ppc_arg' and handle
1763 procedure pointer components.
1764 (gfc_variable_attr): Handle procedure pointer components.
1765 (gfc_match_rvalue): Added new argument to gfc_match_varspec and changed
1766 first argument of gfc_get_default_type.
1767 (match_variable): Added new argument to gfc_match_varspec.
1768 * resolve.c (resolve_entries,set_type,resolve_fl_parameter): Changed
1769 first argument of gfc_get_default_type.
1770 (resolve_structure_cons,resolve_actual_arglist): Handle procedure
1772 (resolve_ppc_call): New function to resolve a call to a procedure
1773 pointer component (subroutine).
1774 (resolve_expr_ppc): New function to resolve a call to a procedure
1775 pointer component (function).
1776 (gfc_resolve_expr): Handle EXPR_PPC.
1777 (resolve_code): Handle EXEC_CALL_PPC.
1778 (resolve_fl_derived): Copy the interface for a procedure pointer
1780 (resolve_symbol): Fix overlong line.
1781 * st.c (gfc_free_statement): Handle EXEC_CALL_PPC.
1782 * symbol.c (gfc_get_default_type): Changed first argument.
1783 (gfc_set_default_type): Changed first argument of gfc_get_default_type.
1784 (gfc_add_component): Initialize ts.type to BT_UNKNOWN.
1785 * trans.h (gfc_conv_function_call): Renamed.
1786 * trans.c (gfc_trans_code): Handle EXEC_CALL_PPC.
1787 * trans-expr.c (gfc_conv_component_ref): Ditto.
1788 (gfc_conv_function_val): Rename to 'conv_function_val', add new
1789 argument 'expr' and handle procedure pointer components.
1790 (gfc_conv_operator_assign): Renamed gfc_conv_function_val.
1791 (gfc_apply_interface_mapping_to_expr): Handle EXPR_PPC.
1792 (gfc_conv_function_call): Rename to 'gfc_conv_procedure_call', add new
1793 argument 'expr' and handle procedure pointer components.
1794 (gfc_get_proc_ptr_comp): New function to get the backend decl for a
1795 procedure pointer component.
1796 (gfc_conv_function_expr): Renamed gfc_conv_function_call.
1797 (gfc_conv_structure): Handle procedure pointer components.
1798 * trans-intrinsic.c (gfc_conv_intrinsic_funcall,
1799 conv_generic_with_optional_char_arg): Renamed gfc_conv_function_call.
1800 * trans-stmt.h (gfc_get_proc_ptr_comp): Add prototype.
1801 * trans-stmt.c (gfc_trans_call): Renamed gfc_conv_function_call.
1802 * trans-types.h (gfc_get_ppc_type): Add prototype.
1803 * trans-types.c (gfc_get_ppc_type): New function to build a tree node
1804 for a procedure pointer component.
1805 (gfc_get_derived_type): Handle procedure pointer components.
1807 2009-05-06 Tobias Burnus <burnus@net-b.de>
1810 * resolve.c (resolve_symbol): Print no warning for implicitly
1811 typed intrinsic functions.
1813 2009-05-05 Janus Weil <janus@gcc.gnu.org>
1816 * expr.c (gfc_check_pointer_assign): Check for statement functions and
1817 internal procedures in procedure pointer assignments.
1819 2009-04-28 Janus Weil <janus@gcc.gnu.org>
1822 * resolve.c (resolve_symbol): Correctly copy the interface of a
1823 PROCEDURE statement if the interface involves a RESULT variable.
1825 2009-04-28 Janus Weil <janus@gcc.gnu.org>
1829 * expr.c (gfc_check_pointer_assign): Correctly detect if the left hand
1831 * parse.c (gfc_fixup_sibling_symbols): Don't check for ambiguity.
1833 2009-04-28 Paul Thomas <pault@gcc.gnu.org>
1836 * trans_expr.c (gfc_conv_procedure_call): Deep copy a derived
1837 type parentheses argument if it is a variable with allocatable
1840 2009-04-27 Ian Lance Taylor <iant@google.com>
1842 * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum
1844 * trans-io.c (st_parameter_field): Add casts to enum type.
1846 2009-04-26 Steven G. Kargl <kargl@gcc.gnu.org>
1849 fortran/data.c (gfc_assign_data_value): If the lvalue is an
1850 assumed character length entity in a data statement, then
1851 return FAILURE to prevent segmentation fault.
1853 2009-04-26 Jakub Jelinek <jakub@redhat.com>
1855 * trans-decl.c: Include pointer-set.h.
1856 (nonlocal_dummy_decl_pset, tree nonlocal_dummy_decls): New variables.
1857 (gfc_nonlocal_dummy_array_decl): New function.
1858 (gfc_get_symbol_decl): Call it for non-local dummy args with saved
1860 (gfc_get_symbol_decl): Set DECL_BY_REFERENCE when needed.
1861 (gfc_generate_function_code): Initialize nonlocal_dummy_decl{s,_pset},
1862 chain it to outermost block's vars, destroy it afterwards.
1863 * Make-lang.in (trans-decl.o): Depend on pointer-set.h.
1865 2009-04-25 Janus Weil <janus@gcc.gnu.org>
1868 * decl.c (gfc_match_import): Use 'sym->name' instead of 'name'.
1869 They differ if the symbol has been use-renamed.
1871 2009-04-24 Ian Lance Taylor <iant@google.com>
1873 * gfortran.h (enum gfc_symbol_type): New named enum type, broken
1874 out of struct gfc_symbol.
1875 (struct gfc_symbol): Use enum gfc_symbol_type.
1876 (enum gfc_array_ref_dimen_type): New named enum type, broken out
1877 of struct gfc_array_ref).
1878 (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
1879 (mod_pointee_as): Update declaration.
1880 * decl.c (add_global_entry): Change type to enum gfc_symbol_type.
1881 (gfc_mod_pointee_as): Change return type to "match".
1882 * module.c (mio_array_ref): Add cast to enum type.
1883 (mio_symbol): Likewise.
1884 * resolve.c (resolve_global_procedure): Change type to enum
1886 * trans-io.c (gfc_build_st_parameter): Change type to unsigned
1889 2009-04-24 Daniel Kraft <d@domob.eu>
1891 * gfortran.h (gfc_get_typebound_proc): Removed as macro, now a function.
1892 (struct gfc_symtree): Moved "typebound" member inside union.
1893 (struct gfc_namespace): Add "tb_sym_root" as new symtree to sort out
1894 type-bound procedures there.
1895 (gfc_get_tbp_symtree): New procedure.
1896 * symbol.c (tentative_tbp_list): New global.
1897 (gfc_get_namespace): NULL new "tb_sym_root" member.
1898 (gfc_new_symtree): Removed initialization of "typebound" member.
1899 (gfc_undo_symbols): Process list of tentative tbp's.
1900 (gfc_commit_symbols): Ditto.
1901 (free_tb_tree): New method.
1902 (gfc_free_namespace): Call it.
1903 (gfc_get_typebound_proc): New method.
1904 (gfc_get_tbp_symtree): New method.
1905 (gfc_find_typebound_proc): Adapt to structural changes of gfc_symtree
1906 and gfc_namespace with regards to tbp's.
1907 * dump-parse-tree.c (show_typebound): Ditto.
1908 * primary.c (gfc_match_varspec): Ditto. Don't reference tbp-symbol
1909 as it isn't a symbol any longer.
1910 * module.c (mio_typebound_symtree): Adapt to changes.
1911 (mio_typebound_proc): Ditto, create symtrees using "gfc_get_tbp_symtree"
1912 rather than "gfc_get_sym_tree".
1913 (mio_f2k_derived): Ditto.
1914 * decl.c (match_procedure_in_type): Ditto.
1915 (gfc_match_generic): Ditto. Don't reference tbp-symbol.
1916 * resolve.c (check_typebound_override): Adapt to changes.
1917 (resolve_typebound_generic): Ditto.
1918 (resolve_typebound_procedures): Ditto.
1919 (ensure_not_abstract_walker): Ditto.
1920 (ensure_not_abstract): Ditto.
1921 (resolve_typebound_procedure): Ditto, ignore erraneous symbols (for
1922 instance, through removed tentative ones).
1923 * gfc-internals.texi (Type-bound procedures): Document changes.
1925 2009-04-24 Janus Weil <janus@gcc.gnu.org>
1929 * symbol.c (gfc_copy_formal_args_intr): Set attr.flavor and attr.dummy
1930 for the formal arguments.
1932 2009-04-21 Taras Glek <tglek@mozilla.com>
1934 * f95-lang.c: Update GTY annotations to new syntax.
1935 * trans-intrinsic.c: Likewise.
1936 * trans-io.c: Likewise.
1937 * trans.h: Likewise.
1939 2009-04-22 Janus Weil <janus@gcc.gnu.org>
1942 * decl.c (add_hidden_procptr_result): Bugfix for procptr results.
1943 (match_procedure_decl): Set if_source.
1944 * expr.c (gfc_check_pointer_assign): Bugfix: Return after error.
1945 And: Check interface also for IFSRC_UNKNOWN (return type may be known).
1946 * gfortran.h (typedef enum ifsrc): Remove IFSRC_USAGE,
1947 add documentation. Rename copy_formal_args and copy_formal_args_intr.
1948 * interface.c (gfc_compare_interfaces): Check for return types,
1949 handle IFSRC_UNKNOWN.
1950 (compare_intr_interfaces,compare_actual_formal_intr): Obsolete, removed.
1951 (gfc_procedure_use): Modified handling of intrinsics.
1952 * intrinsic.c (add_functions): Bugfix for "dim".
1953 * resolve.c (resolve_intrinsic): New function to resolve intrinsics,
1954 which copies the interface from isym to sym.
1955 (resolve_procedure_expression,resolve_function): Use new function
1956 'resolve_intrinsic'.
1957 (resolve_symbol): Add function attribute for externals with return type
1958 and use new function 'resolve_intrinsic'.
1959 * symbol.c (ifsrc_types): Remove string for IFSRC_USAGE.
1960 (copy_formal_args): Renamed to gfc_copy_formal_args.
1961 (copy_formal_args_intr): Renamed to gfc_copy_formal_args_intr.
1962 * trans-const.c (gfc_conv_const_charlen): Handle cl==NULL.
1964 2009-04-21 Joseph Myers <joseph@codesourcery.com>
1966 * ChangeLog, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004,
1967 ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008,
1968 ChangeLog.ptr, config-lang.in, ioparm.def, mathbuiltins.def: Add
1969 copyright and license notices.
1970 * ChangeLog, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1971 ChangeLog-2008: Correct dates.
1973 2009-04-20 Tobias Burnus <burnus@net-b.de>
1976 * scanner.c (load_line): Fix bogus "&" compile-time diagnostic.
1978 2009-04-20 Paul Thomas <pault@gcc.gnu.org>
1981 * resolve.c (is_sym_host_assoc): New function.
1982 (resolve_fl_derived): Call it when checking PRIVATE components
1983 of PUBLIC derived types. Change gfc_error to a gfc_notify_std
1985 (resolve_fl_namelist): Call it twice to check for host
1988 2009-04-20 Ian Lance Taylor <iant@google.com>
1990 * module.c (import_iso_c_binding_module): Add casts to enum type.
1991 * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Change op to enum
1993 (gfc_conv_intrinsic_anyall): Likewise.
1994 (gfc_conv_intrinsic_arith): Likewise.
1995 (gfc_conv_intrinsic_minmaxloc): Likewise.
1996 (gfc_conv_intrinsic_minmaxval): Likewise.
1997 (gfc_conv_intrinsic_bitop): Likewise.
1998 (gfc_conv_intrinsic_singlebitop): Likewise.
1999 (gfc_conv_intrinsic_strcmp): Likewise.
2001 2009-04-20 Vasilis Liaskovitis <vliaskov@gmail.com>
2002 Jakub Jelinek <jakub@redhat.com>
2005 * trans.h (OMPWS_WORKSHARE_FLAG, OMPWS_CURR_SINGLEUNIT,
2006 OMPWS_SCALARIZER_WS, OMPWS_NOWAIT): Define.
2007 (ompws_flags): New extern decl.
2008 * trans-array.c (gfc_trans_scalarized_loop_end): Build OMP_FOR
2009 for the outer dimension if ompws_flags allow it.
2010 * trans.c (gfc_generate_code): Clear ompws_flags.
2011 * trans-expr.c (gfc_trans_assignment_1): Allow worksharing
2012 array assignments inside of !$omp workshare.
2013 * trans-stmt.c (gfc_trans_where_3): Similarly for where statements
2015 * trans-openmp.c (ompws_flags): New variable.
2016 (gfc_trans_omp_workshare): Rewritten.
2018 2009-04-11 Daniel Kraft <d@domob.eu>
2021 * gfortran.h (struct gfc_charlen): New field "passed_length" to store
2022 the actual passed string length for dummy arguments.
2023 * trans-decl.c (gfc_create_string_length): Formatting fixes and added
2024 assertion, moved a local variable into the innermost block it is needed.
2025 (create_function_arglist): Removed TODO about the check being
2026 implemented and initialize cl->passed_length here.
2027 (add_argument_checking): New method.
2028 (gfc_generate_function_code): Call the argument checking method.
2030 2009-04-11 Janus Weil <janus@gcc.gnu.org>
2033 * symbol.c (check_conflict): Reject procedure pointers for -std=f95.
2035 2009-04-11 Daniel Franke <franke.daniel@gmail.com>
2037 * resolve.c (resolve_global_procedure): Enable whole-file checking for
2038 procedures that are declared later in the file.
2040 2009-04-10 Paolo Bonzini <bonzini@gnu.org>
2043 * trans.c (gfc_allocate_with_status): Fix type mismatches
2046 2009-04-10 Daniel Franke <franke.daniel@gmail.com>
2049 * expr.c (find_array_section): Leave early on zero-sized arrays.
2051 2009-04-09 Janus Weil <janus@gcc.gnu.org>
2054 * decl.c (add_hidden_procptr_result): New function for handling
2055 procedure pointer return values by adding a hidden result variable.
2056 (variable_decl,match_procedure_decl,gfc_match_function_decl,
2057 gfc_match_subroutine,gfc_match_end,attr_decl1): Handle procedure pointer
2059 * parse.c (parse_interface): Add EXTERNAL attribute only after
2060 FUNCTION/SUBROUTINE declaration is complete.
2061 * primary.c (replace_hidden_procptr_result): New function for replacing
2062 function symbol by hidden result variable.
2063 (gfc_match_rvalue,match_variable): Replace symbol by hidden result
2065 * resolve.c (resolve_contained_fntype,resolve_function,resolve_variable,
2066 resolve_symbol): Allow for procedure pointer function results.
2067 (resolve_fl_procedure): Conflict detection moved here from
2069 * symbol.c (gfc_check_function_type): Allow for procedure pointer
2071 (check_conflict): Move some conflict detection to resolution stage.
2072 * trans-types.c (gfc_sym_type,gfc_get_function_type): Handle hidden
2075 2009-04-08 Jakub Jelinek <jakub@redhat.com>
2077 * trans-types.c (gfc_init_types): Ensure gfc_integer_types doesn't
2078 contain TYPE_STRING_FLAG types.
2080 2009-04-08 Janne Blomqvist <jb@gcc.gnu.org>
2083 * invoke.texi (fdollar-ok): Fix typo.
2085 2009-04-08 Daniel Franke <franke.daniel@gmail.com>
2088 * invoke.texi (fdollar-ok): Clarify limitations.
2090 2009-04-08 Paul Thomas <pault@gcc.gnu.org>
2093 * trans-array.c (gfc_trans_deferred_array): Return if this
2094 is a result variable.
2096 2009-04-07 Janus Weil <janus@gcc.gnu.org>
2099 * trans-decl.c (gfc_get_symbol_decl): Correctly set decl location for
2100 procedure pointer decls.
2102 2009-04-07 Janus Weil <janus@gcc.gnu.org>
2105 * expr.c (gfc_check_pointer_assign): Enable interface check for
2107 * gfortran.h: Add copy_formal_args_intr.
2108 * interface.c (gfc_compare_interfaces): Call gfc_compare_intr_interfaces
2109 if second argument is an intrinsic.
2110 (compare_intr_interfaces): Correctly set attr.function, attr.subroutine
2112 (compare_parameter): Call gfc_compare_interfaces also for intrinsics.
2113 * resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve
2114 intrinsic interfaces here. Must happen earlier.
2115 (resolve_symbol): Resolution of intrinsic interfaces moved here from
2116 resolve_specific_..., and formal args are now copied from intrinsic
2118 * symbol.c (copy_formal_args_intr): New function to copy the formal
2119 arguments from an intinsic procedure.
2121 2009-04-06 Paul Thomas <pault@gcc.gnu.org>
2124 * dependency.c (ref_same_as_full_array): New function.
2125 (gfc_dep_resolver): Call it.
2127 2009-04-06 Janus Weil <janus@gcc.gnu.org>
2130 * decl.c (match_procedure_decl): Fix double declaration problems with
2131 PROCEDURE statements.
2132 * symbol.c (gfc_add_type): Ditto.
2134 2009-04-06 Paul Thomas <pault@gcc.gnu.org>
2137 * trans-array.c (gfc_conv_array_ref): If the symbol has the
2138 temporary attribute use the array_spec for the bounds.
2139 * gfortran.h : Add the temporary field to the structure
2141 * trans-stmt.c (forall_make_variable_temp): Set the symbol's
2142 temporary attribute.
2144 2009-04-05 Daniel Franke <franke.daniel@gmail.com>
2147 * trans-array.c (gfc_trans_array_constructor_value): Shadow
2148 implied do-loop variable to avoid spurious middle-end warnings.
2150 2009-04-04 Tobias Burnus <burnus@net-b.de>
2153 * trans-decl.c (gfc_generate_function_code): Move recursive
2154 check to the right position.
2156 2009-04-04 Paul Thomas <pault@gcc.gnu.org>
2159 * trans-common.c (translate_common): Do not offset the whole
2162 2009-04-03 Tobias Burnus <burnus@net-b.de>
2165 * resolve.c (resolve_common_vars): Add FL_VARIABLE to symbol
2166 if it is not a procedure pointer.
2167 * primary.c (match_actual_arg): Ditto.
2169 2009-03-31 Joseph Myers <joseph@codesourcery.com>
2171 PR preprocessor/15638
2172 * cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
2174 2009-03-30 Steven G. Kargl <kargls@comcast.net>
2177 * trans-stmt.c(gfc_trans_allocate): Add translation of ERRMSG.
2178 (gfc_trans_deallocate): Add translation of ERRMSG. Remove stale
2179 comments. Minor whitespace cleanup.
2180 * resolve.c(is_scalar_expr_ptr): Whitespace cleanup.
2181 (resolve_deallocate_expr (gfc_expr *e): Update error message.
2182 (resolve_allocate_expr): Remove dead code. Update error message.
2183 Move error checking to ...
2184 (resolve_allocate_deallocate): ... here. Add additional error
2185 checking for STAT, ERRMSG, and allocate-objects.
2186 * match.c(gfc_match_allocate,gfc_match_deallocate): Parse ERRMSG.
2187 Check for redundant uses of STAT and ERRMSG. Reword error message
2188 and add checking for pointer, allocatable, and proc_pointer attributes.
2190 2009-03-30 Paul Thomas <pault@gcc.gnu.org>
2195 * symbol.c : Add gfc_global_ns_list.
2196 * decl.c (add_global_entry): Set the namespace ('ns') field.
2197 * gfortran.h : Add the resolved field to gfc_namespace. Add the
2198 namespace ('ns') field to gfc_gsymbol. Add flag_whole_file to
2199 gfc_option_t. Add the prototype for gfc_free_dt_list.
2200 * lang.opt : Add the whole-file option.
2201 * invoke.texi : Document the whole-file option.
2202 * resolve.c (resolve_global_procedure): If the fwhole-file
2203 option is set, reorder gsymbols to ensure that translation is
2204 in the right order. Resolve the gsymbol's namespace if that
2205 has not occurred and then check interfaces.
2206 (resolve_function): Move call to resolve_global_procedure.
2207 (resolve_call): The same.
2208 (resolve_codes): Store the current labels_obstack.
2209 (gfc_resolve) : Return if the namespace is already resolved.
2210 trans-decl.c (gfc_get_extern_function_decl): If the whole_file
2211 option is selected, use the backend_decl of a gsymbol, if it is
2213 parse.c (add_global_procedure, add_global_program): If the flag
2214 whole-file is set, add the namespace to the gsymbol.
2215 (gfc_parse_file): On -fwhole-file, put procedure namespaces on
2216 the global namespace list. Rearrange to do resolution of all
2217 the procedures in a file, followed by their translation.
2218 * options.c (gfc_init_options): Add -fwhole-file.
2219 (gfc_handle_option): The same.
2221 2009-03-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
2223 * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
2224 family of intrinsics instead of BUILT_IN_INF family.
2225 * trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use
2226 BUILT_IN_HUGE_VAL instead of BUILT_IN_INF.
2228 2009-03-30 Jakub Jelinek <jakub@redhat.com>
2230 * trans-types.c (gfc_sym_type, gfc_return_by_reference): For
2231 sym->attr.result check sym->ns->proc_name->attr.is_bind_c.
2233 2009-03-30 Joseph Myers <joseph@codesourcery.com>
2235 PR rtl-optimization/323
2236 * options.c (gfc_post_options): Set
2237 flag_excess_precision_cmdline. Give an error for
2238 -fexcess-precision=standard for processors where the option is
2241 2009-03-29 Joseph Myers <joseph@codesourcery.com>
2243 PR preprocessor/34695
2244 * cpp.c (cb_cpp_error): New.
2245 (gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
2246 Don't check cpp_errors (cpp_in).
2247 (gfc_cpp_init_0): Set cb->error.
2249 2009-03-29 Steven G. Kargl <kargl@gcc.gnu.org>
2252 * gfortran.h: Add ARITH_PROHIBIT to arith enum.
2253 expr.c (gfc_match_init_expr): Add global variable init_flag to
2254 flag matching an initialization expression.
2255 (check_intrinsic_op): Move no longer reachable error message to ...
2256 * arith.c (arith_power): ... here. Remove gfc_ prefix in
2257 gfc_arith_power. Use init_flag. Allow constant folding of x**y
2258 when y is REAL or COMPLEX.
2259 (eval_intrinsic): Remove restriction that y in x**y must be INTEGER
2260 for constant folding.
2261 * gfc_power: Update gfc_arith_power to arith_power
2263 2009-03-29 Daniel Kraft <d@domob.eu>
2266 * gfortran.h (struct gfc_typebound_proc): Added new flag "deferred" and
2267 added a comment explaining DEFERRED binding handling.
2268 * decl.c (match_binding_attributes): Really match DEFERRED attribute.
2269 (match_procedure_in_type): Really match PROCEDURE(interface) syntax
2270 and do some validity checks for DEFERRED and this construct.
2271 * module.c (binding_overriding): New string constant for DEFERRED.
2272 (mio_typebound_proc): Module-IO DEFERRED flag.
2273 * resolve.c (check_typebound_override): Ensure that a non-DEFERRED
2274 binding is not overridden by a DEFERRED one.
2275 (resolve_typebound_procedure): Allow abstract interfaces as targets
2276 for DEFERRED bindings.
2277 (ensure_not_abstract_walker), (ensure_not_abstract): New methods.
2278 (resolve_fl_derived): Use new "ensure_not_abstract" method for
2279 non-ABSTRACT types extending ABSTRACT ones to ensure each DEFERRED
2280 binding is overridden.
2281 (check_typebound_baseobject): New method.
2282 (resolve_compcall), (resolve_typebound_call): Check base-object of
2283 the type-bound procedure call.
2284 * gfc-internals.texi (Type-bound procedures): Document a little bit
2285 about internal handling of DEFERRED bindings.
2287 2009-03-29 Tobias Schlüter <tobi@gcc.gnu.org>
2290 * gfortran.h (gfc_st_label): Fix comment.
2291 (gfc_exec_op): Add statement code EXEC_END_BLOCK for end of block.
2292 * parse.c (accept_statement): Use EXEC_END_BLOCK for END IF and
2293 END SELECT with labels.
2294 (check_do_closure): Fix formatting.
2295 (parse_do_block): Fix typo in error message.
2296 * resolve.c (code_stack): Remove tail member. Update comment to
2297 new use of reachable_labels.
2298 (reachable_labels): Rename to ...
2299 (find_reachable_labels): ... this. Overhaul. Update preceding
2301 (resolve_branch): Fix comment preceding function. Rewrite.
2302 (resolve_code): Update call to find_reachable_labels. Add code to
2303 deal with EXEC_END_BLOCK.
2304 * st.c (gfc_free_statement): Add code to deal with EXEC_END_BLOCK.
2305 Add 2009 to copyright years.
2306 * trans.c (gfc_trans_code): Likewise on both counts.
2308 2009-03-31 Paul Thomas <pault@gcc.gnu.org>
2311 * expr.c (gfc_check_assign): Allow pointer components when
2315 * resolve.c (check_data_variable): Treat pointer arrays with
2318 2009-03-31 Paul Thomas <pault@gcc.gnu.org>
2321 * trans-expr.c (gfc_trans_assignment_1): Ensure temporaries
2322 have a string_length.
2324 2009-03-28 Tobias Burnus <burnus@net-b.de>
2327 * trans-stmt.c (gfc_trans_simple_do, gfc_trans_do):
2328 Add GFC_RTCHECK_DO support.
2329 * option.c (gfc_handle_runtime_check_option): Enable GFC_RTCHECK_DO.
2330 * invoke.texi (-fcheck): Document "do" option.
2332 2009-03-28 Paul Thomas <pault@gcc.gnu.org>
2335 * trans-array.c (get_elemental_fcn_charlen): Remove.
2336 (get_array_charlen): New function to replace previous.
2338 2009-03-28 Paul Thomas <pault@gcc.gnu.org>
2341 * parse.c (parse_derived): Do not break on finding pointer,
2342 allocatable or private components.
2344 2009-03-28 Tobias Burnus <burnus@net-b.de>
2347 * option.c (gfc_handle_runtime_check_option): Enable recursion check.
2348 * trans-decl.c (gfc_generate_function_code): Add recursion check.
2349 * invoke.texi (-fcheck): Add recursive option.
2351 2009-03-28 Tobias Burnus <burnus@net-b.de>
2354 * resolve.c (gfc_resolve_iterator): Add zero-loop warning.
2356 2009-03-28 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
2357 Paul Thomas <pault@gcc.gnu.org>
2358 Tobias Burnus <burnus@net-b.de>
2360 * gfortran.h (gfc_option_t): Add rtcheck.
2361 * lang.opt: New option -fcheck.
2362 * libgfortran.h: Add GFC_RTCHECK_* constants.
2363 * invoke.texi: Document -fcheck.
2364 * options.c (gfc_handle_runtime_check_option): New function.
2365 (gfc_init_options,gfc_post_options,gfc_handle_option):
2368 2009-03-27 Richard Guenther <rguenther@suse.de>
2370 * trans-array.c (gfc_conv_descriptor_data_addr): Use
2371 gfc_build_addr_expr instead of build_fold_addr_expr.
2372 (gfc_trans_allocate_array_storage, gfc_trans_array_constructor_value,
2373 gfc_trans_constant_array_constructor, gfc_conv_array_data,
2374 gfc_conv_expr_descriptor, gfc_conv_array_parameter): Likewise.
2375 * trans-expr.c (gfc_conv_missing_dummy, gfc_conv_variable,
2376 gfc_conv_function_val, gfc_conv_operator_assign,
2377 gfc_conv_subref_array_arg, gfc_conv_function_call,
2378 gfc_conv_expr_reference, gfc_trans_scalar_assign): Likewise.
2379 * trans-intrinsic.c (gfc_conv_intrinsic_exponent,
2380 gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate,
2381 gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax_char,
2382 gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_spacing,
2383 gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_set_exponent,
2384 gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer,
2385 gfc_conv_intrinsic_si_kind, gfc_conv_intrinsic_trim): Likewise.
2386 * trans-io.c (gfc_trans_io_runtime_check, set_parameter_ref,
2387 gfc_convert_array_to_string, gfc_trans_open, gfc_trans_close,
2388 build_filepos, gfc_trans_inquire, gfc_trans_wait,
2389 nml_get_addr_expr, transfer_namelist_element, build_dt,
2390 gfc_trans_dt_end, transfer_array_component, transfer_expr,
2391 transfer_array_desc, gfc_trans_transfer): Likewise.
2392 * trans-stmt.c (gfc_trans_allocate, gfc_trans_deallocate): Likewise.
2393 * trans.c (gfc_build_addr_expr): Mark the base of the address
2396 2009-03-27 Tobias Burnus <burnus@net-b.de>
2398 * gfortran.h (enum init_local_real.): Add GFC_INIT_REAL_SNAN.
2399 (gfc_expr): Add is_snan.
2400 * trans-const.c (gfc_conv_mpfr_to_tree): Support SNaN.
2401 (gfc_conv_constant_to_tree): Update call to gfc_conv_mpfr_to_tree.
2402 * trans-const.h (gfc_conv_mpfr_to_tree): Update prototype.
2403 * resolve.c (build_default_init_expr): Update call.
2404 * target-memory.c (encode_float): Ditto.
2405 * trans-intrinsic.c (gfc_conv_intrinsic_aint,gfc_conv_intrinsic_mod,
2407 2009-03-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2409 * lang.opt: Unify help texts for -I, -Wconversion, -d, -fopenmp,
2412 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
2414 * simplify.c (gfc_simplify_transfer): Zero-initialize the
2417 2009-02-27 Tobias Burnus <burnus@net-b.de>
2420 * module.c (read_md5_from_module_file): Add missing quote.
2422 2009-02-27 Tobias Burnus <burnus@net-b.de>
2425 * module.c (read_md5_from_module_file): Include mod version
2426 in had-changed test.
2428 2009-02-26 Paul Thomas <pault@gcc.gnu.org>
2431 * interface.c (compare_type_rank_if): Return 1 if the symbols
2432 are the same and deal with external procedures where one is
2433 identified to be a function or subroutine by usage but the
2436 2009-02-26 Paul Thomas <pault@gcc.gnu.org>
2439 * trans-array.c (gfc_conv_array_initializer): Convert all
2440 expressions rather than ICEing.
2442 2009-02-21 Thomas Koenig <tkoenig@gcc.gnu.org>
2445 * array.c (ref_dimen_size): Rename to gfc_ref_dimen_size,
2446 make global. Change function name in error messages.
2447 (ref_size): Change ref_dimen_size to gfc_ref_dimen_size.
2448 (gfc_array_ref_shape): Likewise.
2449 * gfortran.h: Add prototype for gfc_ref_dimen_size.
2450 * simplify.c (simplify_bound_dim): Add ref argument.
2451 If the reference isn't a full array, return one for
2452 the lower bound and the extent for the upper bound.
2453 (simplify_bound): For array sections, take as from the
2454 argument. Add reference to all to simplify_bound_dim.
2456 2009-02-19 Daniel Franke <franke.daniel@gmail.com>
2458 * scanner.c (load_line): At end of line, skip '\r' without setting
2459 the truncation flag.
2461 2009-02-18 Daniel Kraft <d@domob.eu>
2463 * gfortran.texi: New chapter about compiler characteristics.
2464 (Compiler Characteristics): Document KIND type parameters here.
2466 2009-02-18 Tobias Burnus <burnus@net-b.de>
2468 * intrinsic.texi (MALLOC): Make example more portable.
2470 2009-02-13 Mikael Morin <mikael.morin@tele2.fr>
2473 * module.c (gfc_dump_module,gfc_use_module): Add module
2476 2009-02-13 Paul Thomas <pault@gcc.gnu.org>
2480 * trans-expr.c (gfc_conv_function_val): Stabilize Cray-pointer
2481 function references to ensure that a valid expression is used.
2482 (gfc_conv_function_call): Pass Cray pointers to procedures.
2484 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2486 * gfortranspec.c (lang_specific_driver): Update copyright notice
2489 2009-01-28 Paul Thomas <pault@gcc.gnu.org>
2493 * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use the array
2494 descriptor ubound for UBOUND, when the array lbound == 1.
2496 2009-01-27 Daniel Kraft <d@domob.eu>
2499 * trans-stmt.c (gfc_conv_elemental_dependencies): Create temporary
2500 for the real type needed to make it work for subcomponent-references.
2502 2009-01-21 Daniel Kraft <d@domob.eu>
2504 * trans-stmt.c (gfc_conv_elemental_dependencies): Cleaned up comment.
2506 2009-01-20 Paul Thomas <pault@gcc.gnu.org>
2509 * resolve.c (check_host_association): Remove the matching to
2510 correct an incorrect host association and use manipulation of
2511 the expression instead.
2513 2009-01-20 Tobias Burnus <burnus@net-b.de>
2515 * invoke.texi (RANGE): RANGE also takes INTEGER arguments.
2517 2009-01-19 Mikael Morin <mikael.morin@tele2.fr>
2520 * simplify.c (simplify_bound): Don't use array specification
2521 if variable or component has subsequent references.
2523 2009-01-17 Paul Thomas <pault@gcc.gnu.org>
2526 * module.c (write_common_0): Add argument 'this_module' and
2527 check that non-use associated common blocks are written first.
2528 (write_common): Call write_common_0 twice, once with true and
2531 2009-01-17 Paul Thomas <pault@gcc.gnu.org>
2534 * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Has
2535 been absorbed into gfc_conv_intrinsic_transfer. All
2536 references to it in trans-intrinsic.c have been changed
2537 accordingly. PR fixed by using a temporary for scalar
2538 character transfer, when the source is shorter than the
2541 2009-01-17 Paul Thomas <pault@gcc.gnu.org>
2544 * module.c (write_common_0): Revert patch of 2009-01-05.
2546 2009-01-16 Janus Weil <janus@gcc.gnu.org>
2549 * expr.c (gfc_check_pointer_assign): Allow use-associated procedure
2551 * trans-decl.c (get_proc_pointer_decl,gfc_create_module_variable):
2552 Enable procedure pointers as module variables.
2554 2009-01-14 Steven G. Kargl <kargl@gcc.gnu.org>
2556 * ChangeLog-2007: Clean out svn merge droppings.
2558 2009-01-10 Paul Thomas <pault@gcc.gnu.org>
2561 * target-memory.c (encode_derived): Encode NULL.
2563 2009-01-10 Paul Thomas <pault@gcc.gnu.org>
2566 * resolve.c (check_host_association): Use the symtree name to
2567 search for a potential contained procedure, since this is the
2568 name by which it would be referenced.
2570 2009-01-06 Thomas Koenig <tkoenig@gcc.gnu.org>
2573 * interface.c (gfc_procedure_use): Don't warn about functions
2575 * symbol.c (generate_isocbinding_symbol): Mark c_loc and
2578 2009-01-05 Paul Thomas <pault@gcc.gnu.org>
2581 * module.c (write_common_0): Use the name of the symtree rather
2582 than the common block, to determine if the common has been
2585 2009-01-05 Daniel Franke <franke.daniel@gmail.com>
2588 * check.c (gfc_check_random_seed): Added size check for GET
2589 dummy argument, reworded error messages to follow common pattern.
2591 2009-01-05 Thomas Koenig <tkoenig@gcc.gnu.org>
2594 * trans-types.c (gfc_get_derived_type): Check for the
2595 presence of derived->ns->proc_name before
2596 accessing derived->ns->proc_name->attr.flavor .
2597 * resolve.c (resolve_symbol): Likewise.
2599 2009-01-05 Paul Thomas <pault@gcc.gnu.org>
2602 * gfortran.h : Add bit to gfc_expr 'user_operator'
2603 * interface.c (gfc_extend_expr): Set the above if the operator
2604 is substituted by a function.
2605 * resolve.c (check_host_association): Return if above is set.
2607 2009-01-04 Mikael Morin <mikael.morin@tele2.fr>
2610 * ChangeLog-2008: Fix function name.
2613 * dependency.c (gfc_check_argument_var_dependency):
2614 Move the check for pointerness inside the if block
2615 so that it doesn't affect the return value.
2618 * trans-stmt.c (gfc_trans_call):
2619 Add the dependency code after the loop bounds calculation one.
2621 2009-01-04 Daniel Franke <franke.daniel@gmail.com>
2623 * intrinsic.c (do_simplify): Removed already implemented TODO.
2625 2009-01-04 Daniel Franke <franke.daniel@gmail.com>
2628 * simplify.c (gfc_simplify_merge): New.
2629 * intrinsic.h (gfc_simplify_merge): New prototype.
2630 * intrinsic.c (add_functions): Added simplification for MERGE.
2632 2009-01-04 Mikael Morin <mikael.morin@tele2.fr>
2635 * gfortran.h (gfc_is_data_pointer): Added prototype
2636 * resolve.c (gfc_iso_c_func_interface):
2637 Use gfc_is_data_pointer to test for pointer attribute.
2638 * dependency.c (gfc_is_data_pointer):
2639 Support pointer-returning functions.
2641 2009-01-03 Daniel Franke <franke.daniel@gmail.com>
2643 * symbol.c (save_symbol): Don't SAVE function results.
2645 2009-01-03 Paul Thomas <pault@gcc.gnu.org>
2648 * resolve.c (resolve_call): When searching for proper host
2649 association, use symtree rather than symbol. For everything
2650 except generic subroutines, substitute the symtree in the call
2651 rather than the symbol.
2654 Copyright (C) 2009 Free Software Foundation, Inc.
2656 Copying and distribution of this file, with or without modification,
2657 are permitted in any medium without royalty provided the copyright
2658 notice and this notice are preserved.