1 2006-02-09 Paul Thomas <pault@gcc.gnu.org>
4 * trans-stmt.c (gfc_trans_allocate): Provide assumed character length
5 scalar with missing backend_decl for the hidden dummy charlen.
8 * interface.c (gfc_extend_assign): Remove detection of non-PURE
9 subroutine in assignment interface, with gfc_error, and put it in
10 * resolve.c (resolve_code).
13 * interface.c (gfc_procedure_use): Flag rank checking for non-
14 elemental, contained or interface procedures in call to
15 (compare_actual_formal), where ranks are checked for assumed
18 2006-02-08 Francois-Xavier Coudert <coudert@clipper.ens.fr>
21 * trans-decl.c (gfc_generate_function_code): Add new argument,
22 pedantic, to set_std call.
24 2005-02-06 Thomas Koenig <Thomas.Koenig@online.de>
27 * gfortran.texi: Document the GFORTRAN_CONVERT_UNIT environment
29 * invoke.texi: Mention the "Runtime" chapter.
30 Document the -fconvert= option.
31 * gfortran.h: Add options_convert.
32 * lang.opt: Add fconvert=little-endian, fconvert=big-endian,
33 fconvert=native and fconvert=swap.
34 * trans-decl.c (top level): Add gfor_fndecl_set_convert.
35 (gfc_build_builtin_function_decls): Set gfor_fndecl_set_convert.
36 (gfc_generate_function_code): If -fconvert was specified,
37 and this is the main program, add a call to set_convert().
38 * options.c: Handle the -fconvert options.
40 2006-02-06 Roger Sayle <roger@eyesopen.com>
42 * trans-stmt.c (gfc_evaluate_where_mask): Allow the NMASK argument
43 to be NULL to indicate that the not mask isn't required.
44 (gfc_trans_where_2): Remove PMASK argument. Avoid calculating the
45 pending mask for the last clause of a WHERE chain. Update recursive
47 (gfc_trans_forall_1): Update call to gfc_trans_where_2.
48 (gfc_trans_where): Likewise.
50 2006-02-06 Jakub Jelinek <jakub@redhat.com>
52 Backport from gomp-20050608-branch
53 * trans-decl.c (create_function_arglist): Handle dummy functions.
55 * trans-decl.c (gfc_get_symbol_decl): Revert explicit setting of
57 (gfc_trans_vla_type_sizes): Also "gimplify"
58 GFC_TYPE_ARRAY_DATAPTR_TYPE for GFC_DESCRIPTOR_TYPE_P types.
59 * trans-array.c (gfc_trans_deferred_array): Call
60 gfc_trans_vla_type_sizes.
62 * trans-decl.c (saved_function_decls, saved_parent_function_decls):
63 Remove unnecessary initialization.
64 (create_function_arglist): Make sure __result has complete type.
65 (gfc_get_fake_result_decl): Change current_fake_result_decl into
66 a tree chain. For entry master, create a separate variable
67 for each result name. For BT_CHARACTER results, call
68 gfc_finish_var_decl on length even if it has been already created,
70 (gfc_trans_vla_type_sizes): For function/entry result, adjust
71 result value type, not the FUNCTION_TYPE.
72 (gfc_generate_function_code): Adjust for current_fake_result_decl
74 (gfc_trans_deferred_vars): Likewise. Call gfc_trans_vla_type_sizes
75 even on result if it is assumed-length character.
77 * trans-decl.c (gfc_trans_dummy_character): Add SYM argument.
78 Call gfc_trans_vla_type_sizes.
79 (gfc_trans_auto_character_variable): Call gfc_trans_vla_type_sizes.
80 (gfc_trans_vla_one_sizepos, gfc_trans_vla_type_sizes_1,
81 gfc_trans_vla_type_sizes): New functions.
82 (gfc_trans_deferred_vars): Adjust gfc_trans_dummy_character
83 callers. Call gfc_trans_vla_type_sizes on assumed-length
85 * trans-array.c (gfc_trans_array_bounds,
86 gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias): Call
87 gfc_trans_vla_type_sizes.
88 * trans.h (gfc_trans_vla_type_sizes): New prototype.
90 * trans-decl.c (gfc_build_qualified_array): For non-assumed-size
91 arrays without constant size, create also an index var for
92 GFC_TYPE_ARRAY_SIZE (type). If the type is incomplete, complete
94 (gfc_create_string_length): Don't call gfc_defer_symbol_init
95 if just creating DECL_ARGUMENTS.
96 (gfc_get_symbol_decl): Call gfc_finish_var_decl and
97 gfc_defer_symbol_init even if ts.cl->backend_decl is already
98 set to a VAR_DECL that doesn't have DECL_CONTEXT yet.
99 (create_function_arglist): Rework, so that hidden length
100 arguments for CHARACTER parameters are created together with
101 the parameters. Resolve ts.cl->backend_decl for CHARACTER
102 parameters. If the argument is a non-constant length array
103 or CHARACTER, ensure PARM_DECL has different type than
105 (generate_local_decl): Call gfc_get_symbol_decl even
106 for non-referenced non-constant length CHARACTER parameters
107 after optionally issuing warnings.
108 * trans-array.c (gfc_trans_array_bounds): Set last stride
109 to GFC_TYPE_ARRAY_SIZE (type) to initialize it as well.
110 (gfc_trans_dummy_array_bias): Initialize GFC_TYPE_ARRAY_SIZE (type)
113 * trans-expr.c (gfc_conv_expr_val): Fix comment typo.
115 * trans-stmt.c (gfc_trans_simple_do): Fix comment.
117 2006-02-04 Roger Sayle <roger@eyesopen.com>
119 * dependency.c (gfc_check_dependency): Remove unused vars and nvars
120 arguments. Replace with an "identical" argument. A full array
121 reference to the same symbol is a dependency if identical is true.
122 * dependency.h (gfc_check_dependency): Update prototype.
123 * trans-array.h (gfc_check_dependency): Delete duplicate prototype.
124 * trans-stmt.c: #include dependency.h for gfc_check_dependency.
125 (gfc_trans_forall_1): Update calls to gfc_check_dependency.
126 (gfc_trans_where_2): Likewise. Remove unneeded variables.
127 (gfc_trans_where_3): New function for simple non-dependent WHEREs.
128 (gfc_trans_where): Call gfc_trans_where_3 to translate simple
129 F90-style WHERE statements without internal dependencies.
130 * Make-lang.in (trans-stmt.o): Depend upon dependency.h.
132 2006-02-05 H.J. Lu <hongjiu.lu@intel.com>
136 * resolve.c (resolve_types): New function.
137 (resolve_codes): Likewise.
138 (gfc_resolve): Use them.
140 2006-02-05 Roger Sayle <roger@eyesopen.com>
142 * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE
143 masks instead of LOGICAL*4.
145 2006-02-05 Jakub Jelinek <jakub@redhat.com>
147 * resolve.c (resolve_symbol): Initialize constructor_expr to NULL.
149 2006-02-04 Thomas Koenig <Thomas.Koenig@online.de>
152 check.c (identical_dimen_shape): New function.
153 (check_dot_product): Use identical_dimen_shape() to check sizes
155 (gfc_check_matmul): Likewise.
156 (gfc_check_merge): Check conformance between tsource and fsource
157 and between tsource and mask.
158 (gfc_check_pack): Check conformance between array and mask.
160 2006-02-03 Steven G. Kargl <kargls@comcast>
161 Paul Thomas <pault@gcc.gnu.org>
164 * resolve.c (resolve_symbol): Default initialization of derived type
165 component reguires the SAVE attribute.
167 2006-02-02 Steven G. Kargl <kargls@comcast>
170 match.c (gfc_match_nullify): Free the list from head not tail.
173 * match.c (match_forall_header): Fix internal error caused by bogus
177 2006-01-31 Thomas Koenig <Thomas.Koenig@online.de>
180 expr.c (gfc_check_conformance): Reorder error message
182 check.c(gfc_check_minloc_maxloc): Call gfc_check_conformance
183 for checking arguments array and mask.
184 (check_reduction): Likewise.
186 2005-01-30 Erik Edelmann <eedelman@gcc.gnu.org>
189 * trans-io.c (set_internal_unit): Check the rank of the
190 expression node itself instead of its symbol.
192 2006-01-29 Paul Thomas <pault@gcc.gnu.org>
198 * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
199 if actual argument is not a variable.
201 2006-01-28 Paul Thomas <pault@gcc.gnu.org>
204 * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
205 the lvalue is a use associated procedure.
209 * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
210 character lengths are not the same. Use gfc_dep_compare_expr for the
212 * gfortran.h: Add prototype for gfc_dep_compare_expr.
213 * dependency.h: Remove prototype for gfc_dep_compare_expr.
215 2005-01-27 Paul Thomas <pault@gcc.gnu.org>
218 * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
219 generic_ids exempted from assumed size checking.
221 2006-01-27 Jakub Jelinek <jakub@redhat.com>
224 * Make-lang.in (fortran/scanner.o): Depend on toplev.h.
225 * lang.opt (fpreprocessed): New option.
226 * scanner.c: Include toplev.h.
227 (gfc_src_file, gfc_src_preprocessor_lines): New variables.
228 (preprocessor_line): Unescape filename if there were any
230 (load_file): If initial and gfc_src_file is not NULL,
231 use it rather than opening the file. If gfc_src_preprocessor_lines
232 has non-NULL elements, pass it to preprocessor_line.
233 (unescape_filename, gfc_read_orig_filename): New functions.
234 * gfortran.h (gfc_option_t): Add flag_preprocessed.
235 (gfc_read_orig_filename): New prototype.
236 * options.c (gfc_init_options): Clear flag_preprocessed.
237 (gfc_post_options): If flag_preprocessed, call
238 gfc_read_orig_filename.
239 (gfc_handle_option): Handle OPT_fpreprocessed.
240 * lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
243 2005-01-27 Erik Edelmann <eedelman@gcc.gnu.org>
245 * symbol.c (free_old_symbol): Fix confusing comment, and add code
246 to free old_symbol->formal.
248 2005-01-26 Paul Thomas <pault@gcc.gnu.org>
251 * resolve.c (resolve_function): Exclude statement functions from
252 global reference checking.
258 * resolve.c (resolve_function): Declare a gfc_symbol to replace the
259 references through the symtree to the symbol associated with the
260 function expresion. Give error on reference to an assumed character
261 length function is defined in an interface or an external function
262 that is not a dummy argument.
263 (resolve_symbol): Give error if an assumed character length function
264 is array-valued, pointer-valued, pure or recursive. Emit warning
265 that character(*) value functions are obsolescent in F95.
268 * trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
269 prevents any assumed character length function call from getting here
270 except intrinsics such as SPREAD. In this case, ensure that no
271 segfault occurs from referencing non-existent charlen->length->
272 expr_type and provide a backend_decl for the charlen from the charlen
273 of the first actual argument.
275 Cure temp name confusion.
276 * trans-expr.c (gfc_get_interface_mapping_array): Change name of
277 temporary from "parm" to "ifm" to avoid clash with temp coming from
280 2005-01-25 Erik Edelmann <eedelman@gcc.gnu.org>
283 * symbol.c (free_old_symbol): New function.
284 (gfc_commit_symbols): Use it.
285 (gfc_commit_symbol): New function.
286 (gfc_use_derived): Use it.
287 * gfortran.h: Add prototype for gfc_commit_symbol.
288 * intrinsic.c (gfc_find_function): Search in 'conversion'
289 if not found in 'functions'.
290 (gfc_convert_type_warn): Add a symtree to the new
291 expression node, and commit the new symtree->n.sym.
292 * resolve.c (gfc_resolve_index): Make sure typespec is
293 properly initialized.
295 2005-01-23 Paul Thomas <pault@gcc.gnu.org>
298 * decl.c (get_proc_name): Replace subroutine and function attributes
299 in "already defined" test by the formal arglist pointer being non-NULL.
301 Fix regression in testing of admissability of attributes.
302 * symbol.c (gfc_add_attribute): If the current_attr has non-zero
303 intent, do not do the check for a dummy being used.
304 * decl.c (attr_decl1): Add current_attr.intent as the third argument
305 in the call to gfc_add_attribute.
306 * gfortran.h: Add the third argument to the prototype for
309 2006-01-21 Joseph S. Myers <joseph@codesourcery.com>
311 * gfortranspec.c (lang_specific_driver): Update copyright notice
314 2005-01-21 Paul Thomas <pault@gcc.gnu.org>
318 * decl.c (get_proc_name): If there is an existing
319 symbol in the encompassing namespace, call errors
320 if it is a procedure of the same name or the kind
321 field is set, indicating a type declaration.
327 * decl.c (add_global_entry): New function to check
328 for existing global symbol with this name and to
329 create new one if none exists.
330 (gfc_match_entry): Call add_global_entry before
331 matching argument lists for subroutine and function
333 * gfortran.h: Prototype for existing function,
335 * resolve.c (resolve_global_procedure): New function
336 to check global symbols for procedures.
337 (resolve_call, resolve_function): Calls to this
338 new function for non-contained and non-module
340 * match.c (match_common): Add check for existing
341 global symbol, creat one if none exists and emit
342 error if there is a clash.
343 * parse.c (global_used): Remove static and use the
344 gsymbol name rather than the new_block name, so that
345 the function can be called from resolve.c.
346 (parse_block_data, parse_module, add_global_procedure):
347 Improve checks for existing gsymbols. Emit error if
348 already defined or if references were to another type.
352 * trans-expr.c (gfc_conv_aliased_arg): New function called by
353 gfc_conv_function_call that coverts an expression for an aliased
354 component reference to a derived type array into a temporary array
355 of the same type as the component. The temporary is passed as an
356 actual argument for the procedure call and is copied back to the
357 derived type after the call.
358 (is_aliased_array): New function that detects an array reference
359 that is followed by a component reference.
360 (gfc_conv_function_call): Detect an aliased actual argument with
361 is_aliased_array and convert it to a temporary and back again
362 using gfc_conv_aliased_arg.
364 2006-01-19 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
366 * gfortranspec.c: Update copyright years.
368 * trans-array.c: Likewise.
369 * trans-array.h: Likewise.
370 * trans-decl.c: Likewise.
371 * trans-stmt.c: Likewise.
372 * trans-stmt.h: Likewise.
373 * trans-types.c: Likewise.
375 2006-01-18 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
379 * gfortran.h (BBT_HEADER): Move definition up.
380 (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'.
381 * io.c (format_asterisk): Adapt initializer.
382 * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
384 (warn_unused_label): Take gfc_st_label label as argument, adapt to
386 (gfc_resolve): Adapt call to warn_unused_label.
387 * symbol.c (compare_st_labels): New function.
388 (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to
389 using balanced binary tree.
390 * decl.c (match_char_length, gfc_match_old_kind_spec): Do away
392 (warn_unused_label): Adapt to binary tree.
393 * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL.
394 * primary.c (match_kind_param): Do away with cnt.
396 2006-01-18 Paul Thomas <pault@gcc.gnu.org>
401 * symbol.c (check_conflict): Add pointer valued elemental
402 functions and internal procedures with the external attribute
403 to the list of conflicts.
404 (gfc_add_attribute): New catch-all function to perform the
405 checking of symbol attributes for attribute declaration
407 * decl.c (attr_decl1): Call gfc_add_attribute for each of -
408 (gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
409 gfc_match_pointer, gfc_match_dimension, gfc_match_target):
410 Remove spurious calls to checks in symbol.c. Set the
411 attribute directly and use the call to attr_decl() for
413 * gfortran.h: Add prototype for gfc_add_attribute.
416 * resolve.c (resolve_function): Exclude PRESENT from assumed size
417 argument checking. Replace strcmp's with comparisons with generic
420 2006-01-16 Rafael
\81Ávila de Esp
\81índola <rafael.espindola@gmail.com>
422 * gfortranspec.c (lang_specific_spec_functions): Remove.
424 2006-01-16 Richard Guenther <rguenther@suse.de>
426 * trans-stmt.c (gfc_trans_if_1): Use fold_buildN and build_int_cst.
427 (gfc_trans_arithmetic_if): Likewise.
428 (gfc_trans_simple_do): Likewise.
429 (gfc_trans_do): Likewise.
430 (gfc_trans_do_while): Likewise.
431 (gfc_trans_logical_select): Likewise.
432 (gfc_trans_forall_loop): Likewise.
433 (generate_loop_for_temp_to_lhs): Likewise.
434 (generate_loop_for_rhs_to_temp): Likewise.
435 (gfc_trans_allocate): Likewise.
436 * trans.c (gfc_add_expr_to_block): Do not fold expr again.
438 2006-01-16 Richard Guenther <rguenther@suse.de>
440 * trans-expr.c (gfc_conv_function_call): Use fold_build2.
441 * trans-stmt.c (gfc_trans_goto): Likewise. Use build_int_cst.
442 * trans.c (gfc_trans_runtime_check): Don't fold the condition
445 2006-01-13 Steven G. Kargl <kargls@comcast.net>
448 * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove
449 unneeded parenthesis. Fix-up the head of the list (2 lines gleaned
452 2006-01-13 Diego Novillo <dnovillo@redhat.com>
454 * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement
457 2006-01-11 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
459 * parse.c (next_fixed): Remove superfluous string concatenation.
461 2006-01-11 Bernhard Fischer <rep.nop@aon.at>
464 * scanner.c (load_line): use maxlen to determine the line-length used
465 for padding lines in fixed form.
467 2005-01-11 Paul Thomas <pault@gcc.gnu.org>
470 * trans-types.c (copy_dt_decls_ifequal): Copy backend decl for
473 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
476 * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
477 to avoid type mismatch.
479 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
482 * trans-decl.c (gfc_generate_function_code): Move the NULLing of
483 current_fake_result_decl down to below generate_local_vars.
485 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
488 * trans-expr.c (gfc_to_single_character): New function that converts
489 string to single character if its length is 1.
490 (gfc_build_compare_string):New function that compare string and handle
491 single character specially.
492 (gfc_conv_expr_op): Use gfc_build_compare_string.
493 (gfc_trans_string_copy): Use gfc_to_single_character.
494 * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
495 gfc_build_compare_string.
496 * trans.h (gfc_build_compare_string): Add prototype.
498 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
500 * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
502 (gfc_simplify_ichar): Get the result from unsinged char and in the
503 range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
505 2005-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
508 * resolve.c (resolve_fntype): Check that PUBLIC functions
509 aren't of PRIVATE type.
511 2005-01-07 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
513 * decl.c (gfc_match_function_decl): Correctly error out in case of
514 omitted function argument list.
516 2006-01-07 Paul Thomas <pault@gcc.gnu.org>
519 * trans-array.c (gfc_reverse_ss): Remove static attribute.
520 (gfc_walk_elemental_function_args): Replace gfc_expr * argument for
521 the function call with the corresponding gfc_actual_arglist*. Change
523 (gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
524 now requires the actual argument list instead of the expression for
526 * trans-array.h: Modify the prototype for gfc_walk_elemental_function_args
527 and provide a prototype for gfc_reverse_ss.
528 * trans-stmt.h (gfc_trans_call): Add the scalarization code for the case
529 where an elemental subroutine has array valued actual arguments.
535 * resolve.c (check_assumed_size_reference): New function to check for upper
536 bound in assumed size array references.
537 (resolve_assumed_size_actual): New function to do a very restricted scan
538 of actual argument expressions of those procedures for which incomplete
539 assumed size array references are not allowed.
540 (resolve_function, resolve_call): Switch off assumed size checking of
541 actual arguments, except for elemental procedures and intrinsic
542 inquiry functions, in some circumstances.
543 (resolve_variable): Call check_assumed_size_reference.
545 2006-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
548 * io.c (next_char_not_space): New function that returns the next
549 character that is not white space.
550 (format_lex): Use the new function to skip whitespace within
553 2006-01-05 Erik Edelmann <eedelman@gcc.gnu.org>
556 * expr.c (gfc_expr_set_symbols_referenced): New function.
557 * gfortran.h: Add a function prototype for it.
558 * resolve.c (resolve_function): Use it for
559 use associated character functions lengths.
560 * expr.c, gfortran.h, resolve.c: Updated copyright years.
562 2006-01-03 Steven G. Kargl <kargls@comcast.net>
565 * resolve.c (resolve_forall_iterators): Check for scalar variables;
566 Check stride is nonzero.
568 2006-01-02 Steven G. Kargl <kargls@comcast.net>
571 * parse.c (next_free): Check for whitespace after the label.
572 * match.c (gfc_match_small_literal_int): Initialize cnt variable.
574 2006-01-01 Steven G. Kargl <kargls@comcast.net>
576 * ChangeLog: Split previous years into ...
577 * ChangeLog-2002: here.
578 * ChangeLog-2003: here.
579 * ChangeLog-2004: here.
580 * ChangeLog-2005: here.