1 2006-03-29 Carlos O'Donell <carlos@codesourcery.com>
3 * Make-lang.in: Rename docdir to gcc_docdir.
5 2006-03-28 Steven G. Kargl <kargls@comcast.net>
7 * intrinsic.texi: s/floor/float in previous commit.
9 2006-03-28 Paul Thomas <pault@gcc.gnu.org>
12 *resolve.c (resolve_fl_procedure): Do not check the access of
13 derived types for internal procedures.
15 2006-03-27 Jakub Jelinek <jakub@redhat.com>
17 * io.c (check_io_constraints): Don't look at
18 dt->advance->value.charater.string, unless it is a CHARACTER
21 * f95-lang.c (gfc_get_alias_set): New function.
22 (LANG_HOOKS_GET_ALIAS_SET): Define.
24 2006-03-25 Steven G. Kargl <kargls@comcast.net>
27 * intrinsic.c (add_functions): Allow FLOAT to accept all integer kinds.
28 * intrinsic.texi: Document FLOAT.
30 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>
33 * iresolve.c (gfc_resolve_reshape): Remove doubling of
34 kind for complex. For real(kind=10), call reshape_r10.
35 (gfc_resolve_transpose): For real(kind=10), call
38 2006-03-25 Roger Sayle <roger@eyesopen.com>
40 * dependency.c (gfc_check_dependency): Improve handling of pointers;
41 Two variables of different types can't have a dependency, and two
42 variables with the same symbol are equal, even if pointers.
44 2006-03-24 Roger Sayle <roger@eyesopen.com>
46 * gfortran.h (gfc_symbol): Add a new "forall_index" bit field.
47 * match.c (match_forall_iterator): Set forall_index field on
48 the iteration variable's symbol.
49 * dependency.c (contains_forall_index_p): New function to
50 traverse a gfc_expr to check whether it contains a variable
51 with forall_index set in it's symbol.
52 (gfc_check_element_vs_element): Return GFC_DEP_EQUAL for scalar
53 constant expressions that don't variables used as FORALL indices.
55 2006-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
58 * error.c (gfc_fatal_error): Return ICE_EXIT_CODE instead of 4.
60 2006-03-22 Thomas Koenig <Thomas.Koenig@online.de>
63 * gfortran.h (gfc_option_t): Add record_marker.
64 * lang.opt: Add -frecord-marker=4 and -frecord-marker=8.
65 * trans-decl.c: Add gfor_fndecl_set_record_marker.
66 (gfc_build_builtin_function_decls): Set
67 gfor_fndecl_set_record_marker.
68 (gfc_generate_function_code): If we are in the main program
69 and -frecord-marker was provided, call set_record_marker.
70 * options.c (gfc_handle_option): Add handling for
71 -frecord-marker=4 and -frecord-marker=8.
72 * invoke.texi: Document -frecord-marker.
74 2006-03-22 Paul Thomas <pault@gcc.gnu.org>
77 * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): New
78 function to implement array valued TRANSFER intrinsic.
79 (gfc_conv_intrinsic_function): Call the new function if TRANSFER
81 (gfc_walk_intrinsic_function): Treat TRANSFER as one of the
82 special cases by calling gfc_walk_intrinsic_libfunc directly.
84 2006-03-21 Toon Moene <toon@moene.indiv.nluug.nl>
86 * options.c (gfc_init_options): Initialize
87 flag_argument_noalias to 3.
89 2006-03-20 Thomas Koenig <Thomas.Koenig@online.de>
92 * iresolve.c (gfc_resolve_maxloc): If mask is scalar,
93 prefix the function name with an "s". If the mask is scalar
94 or if its kind is smaller than gfc_default_logical_kind,
95 coerce it to default kind.
96 (gfc_resolve_maxval): Likewise.
97 (gfc_resolve_minloc): Likewise.
98 (gfc_resolve_minval): Likewise.
99 (gfc_resolve_product): Likewise.
100 (gfc_resolve_sum): Likewise.
102 2006-03-19 Paul Thomas <pault@gcc.gnu.org>
105 *expr.c (external_spec_function): Permit elemental functions.
108 *interface.c (compare_actual_formal): Detect call for procedure
109 usage and require rank checking, in this case, for assumed shape
110 and deferred shape arrays.
111 (gfc_procedure_use): Revert to pre-PR25070 call to
112 compare_actual_formal that does not require rank checking..
114 2006-03-16 Roger Sayle <roger@eyesopen.com>
116 * gfortran.h (gfc_equiv_info): Add length field.
117 * trans-common.c (copy_equiv_list_to_ns): Set the length field.
118 * dependency.c (gfc_are_equivalenced_arrays): Use both the offset
119 and length fields to determine whether the two equivalenced symbols
122 2006-03-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
125 * gfortran.h: Add warn_ampersand.
126 * invoke.texi: Add documentation for new option.
127 * lang.opt: Add Wampersand.
128 * options.c (gfc_init_options): Initialize warn_ampersand.
129 (gfc_post_options): Set the warn if pedantic.
130 (set_Wall): Set warn_ampersand.
131 (gfc_handle_option: Add Wampersand for itself, -std=f95, and -std=f2003.
132 * scanner.c (gfc_next_char_literal): Add test for missing '&' in
133 continued character constant and give warning if missing.
135 2006-03-14 Steven G. Kargl <kargls@comcast.net>
138 * gfortran.h: Wrap Copyright line.
139 (gfc_option_t): add warn_tabs member.
140 * lang.opt: Update Coyright year. Add the Wtabs.
141 * invoke.texi: Document -Wtabs.
142 * scanner.c (gfc_gobble_whitespace): Use warn_tabs. Add linenum to
143 suppress multiple warnings.
144 (load_line): Use warn_tabs. Add linenum, current_line, seen_comment
145 to suppress multiple warnings.
146 * options.c (gfc_init_options): Initialize warn_tabs.
147 (set_Wall): set warn_tabs for -Wall.
148 (gfc_post_options): Adjust flag_tabs depending on -pedantic.
149 (gfc_handle_option): Process command-line option -W[no-]tabs
151 2006-03-13 Paul Thomas <pault@gcc.gnu.org>
154 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set the initial position to zero and
155 modify the condition for updating it, to implement the F2003 requirement for all(mask)
158 2006-03-13 Jakub Jelinek <jakub@redhat.com>
160 * trans-openmp.c (gfc_trans_omp_variable): Handle references
162 * trans-expr.c (gfc_conv_variable): Remove useless setting
163 of parent_flag, formatting.
165 * trans-decl.c (gfc_get_fake_result_decl): Re-add setting of
166 GFC_DECL_RESULT flag.
168 2003-03-11 Roger Sayle <roger@eyesopen.com>
170 * dependency.c (gfc_dep_compare_expr) <EXPR_OP>: Allow unary and
171 binary operators to compare equal if their operands are equal.
172 <EXPR_FUNCTION>: Allow "constant" intrinsic conversion functions
173 to compare equal, if their operands are equal.
175 2006-03-11 Erik Edelmann <eedelman@gcc.gnu.org>
177 * symbol.c (check_conflict): Allow allocatable function results,
178 except for elemental functions.
179 * trans-array.c (gfc_trans_allocate_temp_array): Rename to ...
180 (gfc_trans_create_temp_array): ... this, and add new argument
182 (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call
183 to gfc_trans_allocate_temp_array.
184 * trans-array.h (gfc_trans_allocate_temp_array): Update prototype.
185 * trans-expr.c (gfc_conv_function_call): Use new arg of
186 gfc_trans_create_temp_array avoid pre-allocation of temporary
187 result variables of pointer AND allocatable functions.
188 (gfc_trans_arrayfunc_assign): Return NULL for allocatable
190 * resolve.c (resolve_symbol): Copy value of 'allocatable' attribute
191 from sym->result to sym.
193 2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
195 * trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
196 attribute from sym to new_sym. Call build_fold_indirect_ref()
197 for allocatable arguments.
199 2006-03-09 Paul Thomas <pault@gcc.gnu.org>
202 * trans-array.c (gfc_conv_expr_descriptor): Exclude calculation of
203 the offset and data when se->data_not_needed is set.
204 * trans.h: Include the data_not_need bit in gfc_se.
205 * trans-intrinsic.c (gfc_conv_intrinsic_size): Set it for SIZE.
207 2006-03-06 Paul Thomas <pault@gcc.gnu.org>
208 Erik Edelmann <eedelman@gcc.gnu.org>
210 * trans-array.c (gfc_trans_dealloc_allocated): New function.
211 (gfc_trans_deferred_array): Use it, instead of inline code.
212 * trans-array.h: Prototype for gfc_trans_dealloc_allocated().
213 * trans-expr.c (gfc_conv_function_call): Deallocate allocated
214 ALLOCATABLE, INTENT(OUT) arguments upon procedure entry.
216 2006-03-06 Paul Thomas <pault@gcc.gnu.org>
219 * resolve.c (resolve_function): Add name after test for pureness.
222 * trans-expr.c (gfc_conv_variable): Detect reference to parent result,
223 store current_function_decl, replace with parent, whilst calls are
224 made to gfc_get_fake_result_decl, and restore afterwards. Signal this
225 to gfc_get_fake_result_decl with a new argument, parent_flag.
226 * trans-stmt.c (gfc_trans_return): gfc_get_fake_result_decl 2nd arg
228 * trans.h: Add parent_flag to gfc_get_fake_result_decl prototype.
229 * trans-decl.c (gfc_get_fake_result_decl): On parent_flag, being set,
230 add decl to parent function. Replace refs to current_fake_result_decl
231 with refs to this_result_decl.
232 (gfc_generate_function_code): Null parent_fake_result_decl before the
233 translation of code for contained procedures. Set parent_flag to zero
234 in call to gfc_get_fake_result_decl.
235 * trans-intrinsic.c (gfc_conv_intrinsic_len): The same.
237 2006-03-05 Steven G. Kargl <kargls@comcast.net>
239 * simplify.c (gfc_simplify_verify): Fix return when SET=''.
241 2006-03-05 Erik Edelmann <eedelman@gcc.gnu.org>
244 * symbol.c (conf_std): New macro.
245 (check_conflict): Use it to allow ALLOCATABLE dummy
247 * trans-expr.c (gfc_conv_function_call): Pass the
248 address of the array descriptor when dummy argument is
250 * interface.c (compare_allocatable): New function.
251 (compare_actual_formal): Use it.
252 * resolve.c (resolve_deallocate_expr,
253 resolve_allocate_expr): Check that INTENT(IN) variables
254 aren't (de)allocated.
255 * gfortran.texi (Fortran 2003 status): List ALLOCATABLE
256 dummy arguments as supported.
258 2006-03-03 Roger Sayle <roger@eyesopen.com>
260 * dependency.c (gfc_check_element_vs_element): Revert last change.
262 2006-03-03 Roger Sayle <roger@eyesopen.com>
264 * dependency.c (gfc_check_element_vs_element): Consider two
265 unordered scalar subscripts as (potentially) equal.
267 2006-03-03 Roger Sayle <roger@eyesopen.com>
269 * dependency.c (gfc_check_dependency): Call gfc_dep_resolver to
270 check whether two array references have a dependency.
271 (gfc_check_element_vs_element): Assume lref and rref must be
272 REF_ARRAYs. If gfc_dep_compare_expr returns -2, assume these
273 references could potentially overlap.
274 (gfc_dep_resolver): Whitespace and comment tweaks. Assume a
275 dependency if the references have different depths. Rewrite
276 final term to clarrify we only have a dependency for overlaps.
278 2006-03-03 Thomas Koenig <Thomas.Koenig@online.de>
281 * trans-array.h: Adjust gfc_array_allocate prototype.
282 * trans-array.c (gfc_array_allocate): Change type of
283 gfc_array_allocatate to bool. Function returns true if
284 it operates on an array. Change second argument to gfc_expr.
285 Find last reference in chain.
286 If the function operates on an allocatable array, emit call to
287 allocate_array() or allocate64_array().
288 * trans-stmt.c (gfc_trans_allocate): Code to follow to last
289 reference has been moved to gfc_array_allocate.
290 * trans.h: Add declaration for gfor_fndecl_allocate_array and
291 gfor_fndecl_allocate64_array.
292 (gfc_build_builtin_function_decls): Add gfor_fndecl_allocate_array
293 and gfor_fndecl_allocate64_array.
295 2006-03-01 Roger Sayle <roger@eyesopen.com>
297 * trans-stmt.c (generate_loop_for_temp_to_lhs): Add an additional
298 INVERT argument to invert the sense of the WHEREMASK argument.
299 Remove unneeded code to AND together a list of masks.
300 (generate_loop_for_rhs_to_temp): Likewise.
301 (gfc_trans_assign_need_temp): Likewise.
302 (gfc_trans_forall_1): Likewise.
303 (gfc_evaluate_where_mask): Likewise, add a new INVERT argument
304 to specify the sense of the MASK argument.
305 (gfc_trans_where_assign): Likewise.
306 (gfc_trans_where_2): Likewise. Restructure code that decides
307 whether we need to allocate zero, one or two temporary masks.
308 If this is a top-level WHERE (i.e. the incoming MASK is NULL),
309 we only need to allocate at most one temporary mask, and can
310 invert it's sense to provide the complementary pending execution
311 mask. Only calculate the size of the required temporary arrays
313 (gfc_trans_where): Update call to gfc_trans_where_2.
315 2006-03-01 Paul Thomas <pault@gcc.gnu.org>
317 * iresolve.c (gfc_resolve_dot_product): Remove any difference in
318 treatment of logical types.
319 * trans-intrinsic.c (gfc_conv_intrinsic_dot_product): New function.
322 * trans-decl.c (gfc_get_symbol_decl): Extend condition that symbols
323 must be referenced to include unreferenced symbols in an interface
327 * trans-array.c (gfc_conv_resolve_dependencies): Add call to
328 gfc_are_equivalenced_arrays.
329 * symbol.c (gfc_free_equiv_infos, gfc_free_equiv_lists): New
330 functions. (gfc_free_namespace): Call them.
331 * trans-common.c (copy_equiv_list_to_ns): New function.
332 (add_equivalences): Call it.
333 * gfortran.h: Add equiv_lists to gfc_namespace and define
334 gfc_equiv_list and gfc_equiv_info.
335 * dependency.c (gfc_are_equivalenced_arrays): New function.
336 (gfc_check_dependency): Call it.
337 * dependency.h: Prototype for gfc_are_equivalenced_arrays.
339 2006-03-01 Roger Sayle <roger@eyesopen.com>
341 * dependency.c (gfc_is_same_range): Compare the stride, lower and
342 upper bounds when testing array reference ranges for equality.
343 (gfc_check_dependency): Fix indentation whitespace.
344 (gfc_check_element_vs_element): Likewise.
345 (gfc_dep_resolver): Likewise.
347 2006-02-28 Thomas Koenig <Thomas.Koenig@online.de>
349 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
350 If the mask expression exists and has rank 0, enclose the
351 generated loop in an "if (mask)". Put the default
352 initialization into the else branch.
354 2006-02-25 Thomas Koenig <Thomas.Koenig@online.de>
357 * trans-intrinsic.c (gfc_conv_intrinsic_arith): If the
358 mask expression exists and has rank 0, enclose the generated
359 loop in an "if (mask)".
360 * (gfc_conv_intrinsic_minmaxloc): Likewise.
362 2006-02-24 Paul Thomas <pault@gcc.gnu.org>
365 * resolve.c (resolve_contained_functions, resolve_types,
366 gfc_resolve): Revert patch of 2006-02-19.
368 2006-02-24 Paul Thomas <pault@gcc.gnu.org>
371 * dependency.c (gfc_is_same_range): Correct typo.
372 (gfc_check_section_vs_section): Call gfc_is_same_range.
375 * trans-common.c (add_equivalences): Add a new flag that is set when
376 an equivalence is seen that prevents more from being reset until the
377 start of a new traversal of the list, thus ensuring completion of
378 all the equivalences.
380 2006-02-23 Erik Edelmann <eedelman@gcc.gnu.org>
382 * module.c (read_module): Remove redundant code lines.
384 2006-02-20 Rafael
\81Ávila de Esp
\81índola <rafael.espindola@gmail.com>
385 * Make-lang.in (FORTRAN): Remove
386 (.PHONY): Remove F95 and f95. Add fortran
388 2006-02-20 Roger Sayle <roger@eyesopen.com>
390 * trans-stmt.c (gfc_trans_where_2): Avoid updating unused current
391 execution mask for empty WHERE/ELSEWHERE clauses. Don't allocate
392 temporary mask arrays if they won't be used.
394 2006-02-20 Roger Sayle <roger@eyesopen.com>
396 * trans-stmt.c (gfc_trans_where_assign): Remove code to handle
397 traversing a linked list of MASKs. The MASK is now always a
398 single element requiring no ANDing during the assignment.
400 2006-02-19 Thomas Koenig <Thomas.Koenig@online.de>
402 * gfortran.texi: Document environment variables which
403 influence runtime behavior.
405 2006-02-19 H.J. Lu <hongjiu.lu@intel.com>
407 * resolve.c (resolve_contained_functions): Call resolve_entries
409 (resolve_types): Remove calls to resolve_entries and
410 resolve_contained_functions.
411 (gfc_resolve): Call resolve_contained_functions.
413 2006-02-19 Erik Edelmann <eedelman@gcc.gnu.org>
416 * intrinsic.c (gfc_convert_type_warn): Call
417 gfc_intrinsic_symbol() on the newly created symbol.
419 2006-02-19 Paul Thomas <pault@gcc.gnu.org>
422 * resolve.c (is_non_constant_shape_array): New function.
423 (resolve_fl_variable): Remove code for the new function and call it.
424 (resolve_fl_namelist): New function. Add test for namelist array
425 with non-constant shape, using is_non_constant_shape_array.
426 (resolve_symbol): Remove code for resolve_fl_namelist and call it.
429 * match.c (match_namelist): Increment the refs field of an accepted
430 namelist object symbol.
431 * resolve.c (resolve_fl_namelist): Test namelist objects for a conflict
432 with contained or module procedures.
434 2006-02-18 Roger Sayle <roger@eyesopen.com>
436 * trans-stmt.c (struct temporary_list): Delete.
437 (gfc_trans_where_2): Major reorganization. Remove no longer needed
438 TEMP argument. Allocate and deallocate the control mask and
439 pending control mask locally.
440 (gfc_trans_forall_1): Delete TEMP local variable, and update
441 call to gfc_trans_where_2. No need to deallocate arrays after.
442 (gfc_evaluate_where_mask): Major reorganization. Change return
443 type to void. Pass in parent execution mask, MASK, and two
444 already allocated mask arrays CMASK and PMASK. On return
445 CMASK := MASK & COND, PMASK := MASK & !COND. MASK, CMASK and
446 CMASK may all be NULL, or refer to the same temporary arrays.
447 (gfc_trans_where): Update call to gfc_trans_where_2. We no
448 longer need a TEMP variable or to deallocate temporary arrays
449 allocated by gfc_trans_where_2.
451 2006-02-18 Danny Smith <dannysmith@users.sourceforeg.net>
453 * gfortran.h (gfc_add_attribute): Change uint to unsigned int.
454 * symbol.c (gfc_add_attribute): Likewise for definition.
455 * resolve.c (resolve_global_procedure): Likewise for variable 'type'.
457 2006-02-17 Richard Sandiford <richard@codesourcery.com>
459 * trans-common.c: Include rtl.h earlier.
460 * trans-decl.c: Likewise.
462 2006-02-16 Jakub Jelinek <jakub@redhat.com>
465 * parse.c (parse_omp_do, parse_omp_structured_block): Call
466 gfc_commit_symbols and gfc_warning_check.
468 * openmp.c (resolve_omp_clauses): Add a dummy case label to workaround
471 2006-02-16 Paul Thomas <pault@gcc.gnu.org>
474 * trans-expr.c (gfc_add_interface_mapping): Use the actual argument
475 for character(*) arrays, rather than casting to the type and kind
476 parameters of the formal argument.
478 2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
481 * options.c: Do not warn for Fortran 2003 features by default.
483 2006-02-15 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
485 * check.c: Update copyright years.
487 * check.c (gfc_check_minloc_maxloc, check_reduction): Don't call
488 dim_range_check on not-present optional dim argument.
490 2006-02-15 Jakub Jelinek <jakub@redhat.com>
494 * Make-lang.in (install-finclude-dir): New goal.
495 (fortran.install-common): Depend on install-finclude-dir.
496 * lang-specs.h: If not -nostdinc, add -I finclude.
498 2006-02-14 Thomas Koenig <Thomas.Koenig@online.de>
501 * check.c (dim_check): Perform all checks if dim is optional.
502 (gfc_check_minloc_maxloc): Use dim_check and dim_rank_check
503 to check dim argument.
504 (check_reduction): Likewise.
506 2006-02-14 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
509 * io.c (match_ltag): Mark label as referenced.
511 2006-02-14 Jakub Jelinek <jakub@redhat.com>
512 Richard Henderson <rth@redhat.com>
513 Diego Novillo <dnovillo@redhat.com>
515 * invoke.texi: Document -fopenmp.
516 * gfortran.texi (Extensions): Document OpenMP.
518 Backport from gomp-20050608-branch
519 * trans-openmp.c: Call build_omp_clause instead of
520 make_node when creating OMP_CLAUSE_* trees.
521 (gfc_trans_omp_reduction_list): Remove argument 'code'.
524 * trans.h (build4_v): Define.
525 * trans-openmp.c: Call build4_v to create OMP_PARALLEL nodes.
526 Call build3_v to create OMP_SECTIONS nodes.
529 * openmp.c (gfc_match_omp_variable_list): Call gfc_set_sym_referenced
530 on all symbols added to the variable list.
532 * openmp.c (gfc_match_omp_clauses): Fix check for non-INTRINSIC
533 procedure symbol in REDUCTION.
535 * trans-openmp.c (gfc_trans_omp_array_reduction): Use gfc_add
536 for MINUS_EXPR OMP_CLAUSE_REDUCTION_CODE.
538 * trans-openmp.c (gfc_trans_omp_do): Add PBLOCK argument. If PBLOCK
539 is non-NULL, evaluate INIT/COND/INCR and chunk size expressions in
540 that statement block.
541 (gfc_trans_omp_parallel_do): Pass non-NULL PBLOCK to gfc_trans_omp_do
542 for non-ordered non-static combined loops.
543 (gfc_trans_omp_directive): Pass NULL PBLOCK to gfc_trans_omp_do.
545 * openmp.c: Include target.h and toplev.h.
546 (gfc_match_omp_threadprivate): Emit diagnostic if target does
548 * Make-lang.in (fortran/openmp.o): Add dependencies on
549 target.h and toplev.h.
551 * trans-decl.c (gfc_get_fake_result_decl): Set GFC_DECL_RESULT.
552 * trans-openmp.c (gfc_omp_privatize_by_reference): Make
553 DECL_ARTIFICIAL vars predetermined shared except GFC_DECL_RESULT.
554 (gfc_omp_disregard_value_expr): Handle GFC_DECL_RESULT.
555 (gfc_trans_omp_variable): New function.
556 (gfc_trans_omp_variable_list, gfc_trans_omp_reduction_list): Use it.
557 * trans.h (GFC_DECL_RESULT): Define.
559 * trans-openmp.c (gfc_omp_firstprivatize_type_sizes): New function.
560 * f95-lang.c (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
561 * trans.h (gfc_omp_firstprivatize_type_sizes): New prototype.
563 * trans-openmp.c (gfc_omp_privatize_by_reference): Return
564 true if a pointer has GFC_DECL_SAVED_DESCRIPTOR set.
565 (gfc_trans_omp_array_reduction, gfc_trans_omp_reduction_list): New
567 (gfc_trans_omp_clauses): Add WHERE argument. Call
568 gfc_trans_omp_reduction_list rather than gfc_trans_omp_variable_list
570 (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
571 gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
572 gfc_trans_omp_sections, gfc_trans_omp_single): Adjust
573 gfc_trans_omp_clauses callers.
575 * openmp.c (omp_current_do_code): New var.
576 (gfc_resolve_omp_do_blocks): New function.
577 (gfc_resolve_omp_parallel_blocks): Call it.
578 (gfc_resolve_do_iterator): Add CODE argument. Don't propagate
579 predetermination if argument is !$omp do or !$omp parallel do
581 * resolve.c (resolve_code): Call gfc_resolve_omp_do_blocks
582 for EXEC_OMP_DO. Adjust gfc_resolve_do_iterator caller.
583 * fortran.h (gfc_resolve_omp_do_blocks): New prototype.
584 (gfc_resolve_do_iterator): Add CODE argument.
586 * trans.h (gfc_omp_predetermined_sharing,
587 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
589 (GFC_DECL_COMMON_OR_EQUIV, GFC_DECL_CRAY_POINTEE): Define.
590 * trans-openmp.c (gfc_omp_predetermined_sharing,
591 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
593 * trans-common.c (build_equiv_decl, build_common_decl,
594 create_common): Set GFC_DECL_COMMON_OR_EQUIV flag on the decls.
595 * trans-decl.c (gfc_finish_cray_pointee): Set GFC_DECL_CRAY_POINTEE
597 * f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_SHARING,
598 LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
599 LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE): Define.
601 * openmp.c (resolve_omp_clauses): Remove extraneous comma.
603 * symbol.c (check_conflict): Add conflict between cray_pointee and
605 * openmp.c (gfc_match_omp_threadprivate): Fail if
606 gfc_add_threadprivate returned FAILURE.
607 (resolve_omp_clauses): Diagnose Cray pointees in SHARED,
608 {,FIRST,LAST}PRIVATE and REDUCTION clauses and Cray pointers in
609 {FIRST,LAST}PRIVATE and REDUCTION clauses.
611 * resolve.c (omp_workshare_flag): New variable.
612 (resolve_function): Diagnose use of non-ELEMENTAL user defined
613 function in WORKSHARE construct.
614 (resolve_code): Cleanup forall_save use. Make sure omp_workshare_flag
615 is set to correct value in different contexts.
617 * openmp.c (resolve_omp_clauses): Replace %s with '%s' when printing
619 (resolve_omp_atomic): Likewise.
622 * scanner.c (skip_free_comments): Set at_bol at the beginning of the
624 (skip_fixed_comments): Handle ! comments in the middle of line here
626 (gfc_skip_comments): Use skip_fixed_comments for FIXED_FORM even if
628 (gfc_next_char_literal): Fix expected canonicalized *$omp string.
630 * trans-openmp.c (gfc_trans_omp_do): Use make_node and explicit
631 initialization to build OMP_FOR instead of build.
633 * trans-decl.c (gfc_gimplify_function): Invoke
634 diagnose_omp_structured_block_errors.
636 * trans-openmp.c (gfc_trans_omp_master): Use OMP_MASTER.
637 (gfc_trans_omp_ordered): Use OMP_ORDERED.
639 * gfortran.h (gfc_resolve_do_iterator, gfc_resolve_blocks,
640 gfc_resolve_omp_parallel_blocks): New prototypes.
641 * resolve.c (resolve_blocks): Renamed to...
642 (gfc_resolve_blocks): ... this. Remove static.
643 (gfc_resolve_forall): Adjust caller.
644 (resolve_code): Only call gfc_resolve_blocks if code->block != 0
645 and not for EXEC_OMP_PARALLEL* directives. Call
646 gfc_resolve_omp_parallel_blocks for EXEC_OMP_PARALLEL* directives.
647 Call gfc_resolve_do_iterator if resolved successfully EXEC_DO
649 * openmp.c: Include pointer-set.h.
650 (omp_current_ctx): New variable.
651 (gfc_resolve_omp_parallel_blocks, gfc_resolve_do_iterator): New
653 * Make-lang.in (fortran/openmp.o): Depend on pointer-set.h.
655 * openmp.c (gfc_match_omp_clauses): For max/min/iand/ior/ieor,
656 look up symbol if it exists, use its name instead and, if it is not
657 INTRINSIC, issue diagnostics.
659 * parse.c (parse_omp_do): Handle implied end do properly.
660 (parse_executable): If parse_omp_do returned ST_IMPLIED_ENDDO,
661 return it instead of continuing.
663 * trans-openmp.c (gfc_trans_omp_critical): Update for changed
665 (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
666 gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
667 gfc_trans_omp_sections, gfc_trans_omp_single): Likewise.
669 * trans.h (gfc_omp_privatize_by_reference): New prototype.
670 * f95-lang.c (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Redefine
671 to gfc_omp_privatize_by_reference.
672 * trans-openmp.c (gfc_omp_privatize_by_reference): New function.
674 * trans-stmt.h (gfc_trans_omp_directive): Add comment.
676 * openmp.c (gfc_match_omp_variable_list): Add ALLOW_COMMON argument.
677 Disallow COMMON matching if it is set.
678 (gfc_match_omp_clauses, gfc_match_omp_flush): Adjust all callers.
679 (resolve_omp_clauses): Show locus in error messages. Check that
680 variable types in reduction clauses are appropriate for reduction
683 * resolve.c (resolve_symbol): Don't error if a threadprivate module
684 variable isn't SAVEd.
686 * trans-openmp.c (gfc_trans_omp_do): Put count into BLOCK, not BODY.
687 Fix typo in condition. Fix DOVAR initialization.
689 * openmp.c (gfc_match_omp_clauses): Match min/iand/ior/ieor
690 rather than .min. etc.
692 * trans-openmpc.c (omp_not_yet): Remove.
693 (gfc_trans_omp_parallel_do): Keep listprivate clause on parallel.
694 Force creation of BIND_EXPR around the workshare construct.
695 (gfc_trans_omp_parallel_sections): Likewise.
696 (gfc_trans_omp_parallel_workshare): Likewise.
698 * types.def (BT_I16, BT_FN_I16_VPTR_I16,
699 BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
701 * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_DEFAULT.
702 (gfc_trans_omp_code): New function.
703 (gfc_trans_omp_do): Use it, remove omp_not_yet uses.
704 (gfc_trans_omp_parallel, gfc_trans_omp_single): Likewise.
705 (gfc_trans_omp_sections): Likewise. Only treat empty last section
706 specially if lastprivate clause is present.
707 * f95-lang.c (gfc_init_builtin_functions): Create BUILT_IN_TRAP
710 * trans-openmp.c (gfc_trans_omp_variable_list): Update for
711 OMP_CLAUSE_DECL name change.
712 (gfc_trans_omp_do): Likewise.
714 * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_REDUCTION
716 (gfc_trans_omp_atomic): Build OMP_ATOMIC instead of expanding
717 sync builtins directly.
718 (gfc_trans_omp_single): Build OMP_SINGLE statement.
720 * trans-openmp.c (gfc_trans_add_clause): New.
721 (gfc_trans_omp_variable_list): Take a tree code and build the clause
722 node here. Link it to the head of a list.
723 (gfc_trans_omp_clauses): Update to match.
724 (gfc_trans_omp_do): Use gfc_trans_add_clause.
726 * trans-openmp.c (gfc_trans_omp_clauses): Change second argument to
727 gfc_omp_clauses *. Use gfc_evaluate_now instead of creating
729 (gfc_trans_omp_atomic, gfc_trans_omp_critical): Use buildN_v macros.
730 (gfc_trans_omp_do): New function.
731 (gfc_trans_omp_master): Dont' check for gfc_trans_code returning NULL.
732 (gfc_trans_omp_parallel): Adjust gfc_trans_omp_clauses caller.
734 (gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_sections,
735 gfc_trans_omp_parallel_workshare, gfc_trans_omp_sections,
736 gfc_trans_omp_single, gfc_trans_omp_workshare): New functions.
737 (gfc_trans_omp_directive): Use them.
738 * parse.c (parse_omp_do): Allow new_st.op == EXEC_NOP.
739 * openmp.c (resolve_omp_clauses): Check for list items present
741 (resolve_omp_do): Check that iteration variable is not THREADPRIVATE
742 and is not present in any clause variable lists other than PRIVATE
745 * gfortran.h (symbol_attribute): Add threadprivate bit.
746 (gfc_common_head): Add threadprivate member, change use_assoc
747 and saved into char to save space.
748 (gfc_add_threadprivate): New prototype.
749 * symbol.c (check_conflict): Handle threadprivate.
750 (gfc_add_threadprivate): New function.
751 (gfc_copy_attr): Copy threadprivate.
752 * trans-openmp.c (gfc_trans_omp_clauses): Avoid creating a temporary
753 if IF or NUM_THREADS is constant. Create OMP_CLAUSE_SCHEDULE and
755 * resolve.c (resolve_symbol): Complain if a THREADPRIVATE symbol
756 outside a module and not in COMMON has is not SAVEd.
757 (resolve_equivalence): Ensure THREADPRIVATE objects don't get
759 * trans-common.c: Include target.h and rtl.h.
760 (build_common_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
761 * trans-decl.c: Include rtl.h.
762 (gfc_finish_var_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
763 * dump-parse-tree.c (gfc_show_attr): Handle THREADPRIVATE.
764 * Make-lang.in (fortran/trans-decl.o): Depend on $(RTL_H).
765 (fortran/trans-common.o): Depend on $(RTL_H) and $(TARGET_H).
766 * openmp.c (gfc_match_omp_variable_list): Ensure COMMON block
767 is from current namespace.
768 (gfc_match_omp_threadprivate): Rewrite.
769 (resolve_omp_clauses): Check some clause restrictions.
770 * module.c (ab_attribute): Add AB_THREADPRIVATE.
771 (attr_bits): Add THREADPRIVATE.
772 (mio_symbol_attribute, mio_symbol_attribute): Handle threadprivate.
773 (load_commons, write_common, write_blank_common): Adjust for type
774 change of saved, store/load threadprivate bit from the integer
777 * types.def (BT_FN_UINT_UINT): New.
778 (BT_FN_VOID_UINT_UINT): Remove.
780 * trans-openmp.c (gfc_trans_omp_clauses, gfc_trans_omp_barrier,
781 gfc_trans_omp_critical, gfc_trans_omp_flush, gfc_trans_omp_master,
782 gfc_trans_omp_ordered, gfc_trans_omp_parallel): New functions.
783 (gfc_trans_omp_directive): Use them.
785 * openmp.c (expr_references_sym): Add SE argument, don't look
787 (is_conversion): New function.
788 (resolve_omp_atomic): Adjust expr_references_sym callers. Handle
789 promoted expressions.
790 * trans-openmp.c (gfc_trans_omp_atomic): New function.
791 (gfc_trans_omp_directive): Call it.
793 * f95-lang.c (builtin_type_for_size): New function.
794 (gfc_init_builtin_functions): Initialize synchronization and
796 * types.def: New file.
797 * Make-lang.in (f95-lang.o): Depend on $(BUILTINS_DEF) and
800 * trans-openmp.c: Rename GOMP_* tree codes into OMP_*.
802 * dump-parse-tree.c (show_symtree): Don't crash if ns->proc_name
805 * dump-parse-tree.c (gfc_show_namelist, gfc_show_omp_node): New
807 (gfc_show_code_node): Call gfc_show_omp_node for EXEC_OMP_* nodes.
809 * parse.c (parse_omp_do): Call pop_state before next_statement.
810 * openmp.c (expr_references_sym, resolve_omp_atomic, resolve_omp_do):
812 (gfc_resolve_omp_directive): Call them.
813 * match.c (match_exit_cycle): Issue error if EXIT or CYCLE statement
814 leaves an OpenMP structured block or if EXIT terminates !$omp do
817 * Make-lang.in (F95_PARSER_OBJS): Add fortran/openmp.o.
818 (F95_OBJS): Add fortran/trans-openmp.o.
819 (fortran/trans-openmp.o): Depend on $(GFORTRAN_TRANS_DEPS).
820 * lang.opt: Add -fopenmp option.
821 * options.c (gfc_init_options): Initialize it.
822 (gfc_handle_option): Handle it.
823 * gfortran.h (ST_OMP_ATOMIC, ST_OMP_BARRIER, ST_OMP_CRITICAL,
824 ST_OMP_END_CRITICAL, ST_OMP_END_DO, ST_OMP_END_MASTER,
825 ST_OMP_END_ORDERED, ST_OMP_END_PARALLEL, ST_OMP_END_PARALLEL_DO,
826 ST_OMP_END_PARALLEL_SECTIONS, ST_OMP_END_PARALLEL_WORKSHARE,
827 ST_OMP_END_SECTIONS, ST_OMP_END_SINGLE, ST_OMP_END_WORKSHARE,
828 ST_OMP_DO, ST_OMP_FLUSH, ST_OMP_MASTER, ST_OMP_ORDERED,
829 ST_OMP_PARALLEL, ST_OMP_PARALLEL_DO, ST_OMP_PARALLEL_SECTIONS,
830 ST_OMP_PARALLEL_WORKSHARE, ST_OMP_SECTIONS, ST_OMP_SECTION,
831 ST_OMP_SINGLE, ST_OMP_THREADPRIVATE, ST_OMP_WORKSHARE): New
833 (OMP_LIST_PRIVATE, OMP_LIST_FIRSTPRIVATE, OMP_LIST_LASTPRIVATE,
834 OMP_LIST_COPYPRIVATE, OMP_LIST_SHARED, OMP_LIST_COPYIN,
835 OMP_LIST_PLUS, OMP_LIST_REDUCTION_FIRST, OMP_LIST_MULT,
836 OMP_LIST_SUB, OMP_LIST_AND, OMP_LIST_OR, OMP_LIST_EQV,
837 OMP_LIST_NEQV, OMP_LIST_MAX, OMP_LIST_MIN, OMP_LIST_IAND,
838 OMP_LIST_IOR, OMP_LIST_IEOR, OMP_LIST_REDUCTION_LAST, OMP_LIST_NUM):
839 New OpenMP variable list types.
840 (gfc_omp_clauses): New typedef.
841 (gfc_get_omp_clauses): Define.
842 (EXEC_OMP_CRITICAL, EXEC_OMP_DO, EXEC_OMP_FLUSH, EXEC_OMP_MASTER,
843 EXEC_OMP_ORDERED, EXEC_OMP_PARALLEL, EXEC_OMP_PARALLEL_DO,
844 EXEC_OMP_PARALLEL_SECTIONS, EXEC_OMP_PARALLEL_WORKSHARE,
845 EXEC_OMP_SECTIONS, EXEC_OMP_SINGLE, EXEC_OMP_WORKSHARE,
846 EXEC_OMP_ATOMIC, EXEC_OMP_BARRIER, EXEC_OMP_END_NOWAIT,
847 EXEC_OMP_END_SINGLE): New OpenMP gfc_exec_op codes.
848 (struct gfc_code): Add omp_clauses, omp_name, omp_namelist
849 and omp_bool fields to ext union.
850 (flag_openmp): Declare.
851 (gfc_free_omp_clauses, gfc_resolve_omp_directive): New prototypes.
852 * scanner.c (openmp_flag, openmp_locus): New variables.
853 (skip_free_comments, skip_fixed_comments, gfc_next_char_literal):
854 Handle OpenMP directive lines and conditional compilation magic
856 * parse.h (COMP_OMP_STRUCTURED_BLOCK): New compile state.
857 * parse.c (decode_omp_directive, parse_omp_do, parse_omp_atomic,
858 parse_omp_structured_block): New functions.
859 (next_free, next_fixed): Parse OpenMP directives.
860 (case_executable, case_exec_markers, case_decl): Add ST_OMP_*
862 (gfc_ascii_statement): Handle ST_OMP_* codes.
863 (parse_executable): Rearrange the loop slightly, so that
864 parse_omp_do can return next_statement.
865 * match.h (gfc_match_omp_eos, gfc_match_omp_atomic,
866 gfc_match_omp_barrier, gfc_match_omp_critical, gfc_match_omp_do,
867 gfc_match_omp_flush, gfc_match_omp_master, gfc_match_omp_ordered,
868 gfc_match_omp_parallel, gfc_match_omp_parallel_do,
869 gfc_match_omp_parallel_sections, gfc_match_omp_parallel_workshare,
870 gfc_match_omp_sections, gfc_match_omp_single,
871 gfc_match_omp_threadprivate, gfc_match_omp_workshare,
872 gfc_match_omp_end_nowait, gfc_match_omp_end_single): New prototypes.
873 * resolve.c (resolve_blocks): Ignore EXEC_OMP_* block directives.
874 (resolve_code): Call gfc_resolve_omp_directive on EXEC_OMP_*
876 * trans.c (gfc_trans_code): Call gfc_trans_omp_directive for
877 EXEC_OMP_* directives.
878 * st.c (gfc_free_statement): Handle EXEC_OMP_* statement freeing.
879 * trans-stmt.h (gfc_trans_omp_directive): New prototype.
880 * openmp.c: New file.
881 * trans-openmp.c: New file.
883 2006-02-13 Andrew Pinski <pinskia@physics.uc.edu>
884 Jakub Jelinek <jakub@redhat.com>
887 * trans-decl.c (gfc_get_symbol_decl, gfc_get_fake_result_decl): Use
888 gfc_add_decl_to_function rather than gfc_finish_var_decl on length.
890 2006-02-13 Paul Thomas <pault@gcc.gnu.org>
894 * resolve.c (resolve_symbol): Extend the requirement that module
895 arrays have constant bounds to those in the main program. At the
896 same time simplify the array bounds, to avoiding trapping parameter
897 array references, and exclude automatic character length from main
898 and modules. Rearrange resolve_symbol and resolve_derived to put as
899 each flavor together, as much as is possible and move all specific
900 code for flavors FL_VARIABLE, FL_PROCEDURE and FL_PARAMETER into new
902 (resolve_fl_var_and_proc, resolve_fl_variable, resolve_fl_procedure):
903 New functions to do work of resolve_symbol.
904 (resolve_index_expr): New function that is called from resolved_symbol
905 and is extracted from resolve_charlen.
906 (resolve_charlen): Call this new function.
907 (resolve_fl_derived): Renamed resolve_derived to be consistent with
908 the naming of the new functions for the other flavours. Change the
909 charlen checking so that the style is consistent with other similar
910 checks. Add the generation of the gfc_dt_list, removed from resolve_
914 * resolve.c (resolve_actual_arglist): Prevent internal procedures
915 from being dummy arguments.
918 * resolve.c (resolve_actual_arglist): Prevent pure but non-intrinsic
919 procedures from being dummy arguments.
922 * resolve.c (check_data_variable): Add test that data variable is in
926 * resolve.c (resolve_call): Add test that the subroutine does not
929 2006-02-12 Erik Edelmann <eedelman@gcc.gnu.org>
932 * trans-array.c (gfc_trans_allocate_array_storage): New argument
933 dealloc; free the temporary only if dealloc is true.
934 (gfc_trans_allocate_temp_array): New argument bool dealloc, to be
935 passed onwards to gfc_trans_allocate_array_storage.
936 (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
937 gfc_trans_allocate_temp_array.
938 * trans-array.h (gfc_trans_allocate_temp_array): Update function
940 * trans-expr.c (gfc_conv_function_call): Set new argument 'dealloc'
941 to gfc_trans_allocate_temp_array to false in case of functions
943 (gfc_trans_arrayfunc_assign): Return NULL for functions returning
946 2006-02-10 Steven G. Kargl <kargls@comcast.net>
949 *decl.c (variable_decl): Improve error message. Remove initialization
950 typespec. Wrap long line.
951 *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type,
953 *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank
957 2006-02-10 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
960 * arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES.
961 * expr.c (check_intrinsic_op): Likewise.
962 * module.c (mio_expr): Likewise.
964 2006-02-09 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
966 * dump-parse-tree.c: Update copyright years.
967 * matchexp.c: Likewise.
968 * module.c: Likewise.
971 * gfortran.h (gfc_intrinsic_op): Add INTRINSIC_PARENTHESES.
972 * dump-parse-tree (gfc_show_expr): Handle INTRINSIC_PARENTHESES.
973 * expr.c (simplify_intrinsic_op): Treat INTRINSIC_PARENTHESES as
974 if it were INTRINSIC_UPLUS.
975 * resolve.c (resolve_operator): Handle INTRINSIC_PARENTHESES.
976 * match.c (intrinsic_operators): Add INTRINSIC_PARENTHESES.
977 * matchexp.c (match_primary): Record parentheses surrounding
979 * module.c (intrinsics): Add INTRINSIC_PARENTHESES for module
981 * trans-expr.c (gfc_conv_expr_op): Handle INTRINSIC_PARENTHESES.
983 2006-02-09 Paul Thomas <pault@gcc.gnu.org>
986 * trans-stmt.c (gfc_trans_allocate): Provide assumed character length
987 scalar with missing backend_decl for the hidden dummy charlen.
990 * interface.c (gfc_extend_assign): Remove detection of non-PURE
991 subroutine in assignment interface, with gfc_error, and put it in
992 * resolve.c (resolve_code).
995 * interface.c (gfc_procedure_use): Flag rank checking for non-
996 elemental, contained or interface procedures in call to
997 (compare_actual_formal), where ranks are checked for assumed
1000 2006-02-08 Francois-Xavier Coudert <coudert@clipper.ens.fr>
1003 * trans-decl.c (gfc_generate_function_code): Add new argument,
1004 pedantic, to set_std call.
1006 2006-02-06 Thomas Koenig <Thomas.Koenig@online.de>
1009 * gfortran.texi: Document the GFORTRAN_CONVERT_UNIT environment
1011 * invoke.texi: Mention the "Runtime" chapter.
1012 Document the -fconvert= option.
1013 * gfortran.h: Add options_convert.
1014 * lang.opt: Add fconvert=little-endian, fconvert=big-endian,
1015 fconvert=native and fconvert=swap.
1016 * trans-decl.c (top level): Add gfor_fndecl_set_convert.
1017 (gfc_build_builtin_function_decls): Set gfor_fndecl_set_convert.
1018 (gfc_generate_function_code): If -fconvert was specified,
1019 and this is the main program, add a call to set_convert().
1020 * options.c: Handle the -fconvert options.
1022 2006-02-06 Roger Sayle <roger@eyesopen.com>
1024 * trans-stmt.c (gfc_evaluate_where_mask): Allow the NMASK argument
1025 to be NULL to indicate that the not mask isn't required.
1026 (gfc_trans_where_2): Remove PMASK argument. Avoid calculating the
1027 pending mask for the last clause of a WHERE chain. Update recursive
1029 (gfc_trans_forall_1): Update call to gfc_trans_where_2.
1030 (gfc_trans_where): Likewise.
1032 2006-02-06 Jakub Jelinek <jakub@redhat.com>
1034 Backport from gomp-20050608-branch
1035 * trans-decl.c (create_function_arglist): Handle dummy functions.
1037 * trans-decl.c (gfc_get_symbol_decl): Revert explicit setting of
1039 (gfc_trans_vla_type_sizes): Also "gimplify"
1040 GFC_TYPE_ARRAY_DATAPTR_TYPE for GFC_DESCRIPTOR_TYPE_P types.
1041 * trans-array.c (gfc_trans_deferred_array): Call
1042 gfc_trans_vla_type_sizes.
1044 * trans-decl.c (saved_function_decls, saved_parent_function_decls):
1045 Remove unnecessary initialization.
1046 (create_function_arglist): Make sure __result has complete type.
1047 (gfc_get_fake_result_decl): Change current_fake_result_decl into
1048 a tree chain. For entry master, create a separate variable
1049 for each result name. For BT_CHARACTER results, call
1050 gfc_finish_var_decl on length even if it has been already created,
1051 but not pushdecl'ed.
1052 (gfc_trans_vla_type_sizes): For function/entry result, adjust
1053 result value type, not the FUNCTION_TYPE.
1054 (gfc_generate_function_code): Adjust for current_fake_result_decl
1056 (gfc_trans_deferred_vars): Likewise. Call gfc_trans_vla_type_sizes
1057 even on result if it is assumed-length character.
1059 * trans-decl.c (gfc_trans_dummy_character): Add SYM argument.
1060 Call gfc_trans_vla_type_sizes.
1061 (gfc_trans_auto_character_variable): Call gfc_trans_vla_type_sizes.
1062 (gfc_trans_vla_one_sizepos, gfc_trans_vla_type_sizes_1,
1063 gfc_trans_vla_type_sizes): New functions.
1064 (gfc_trans_deferred_vars): Adjust gfc_trans_dummy_character
1065 callers. Call gfc_trans_vla_type_sizes on assumed-length
1066 character parameters.
1067 * trans-array.c (gfc_trans_array_bounds,
1068 gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias): Call
1069 gfc_trans_vla_type_sizes.
1070 * trans.h (gfc_trans_vla_type_sizes): New prototype.
1072 * trans-decl.c (gfc_build_qualified_array): For non-assumed-size
1073 arrays without constant size, create also an index var for
1074 GFC_TYPE_ARRAY_SIZE (type). If the type is incomplete, complete
1076 (gfc_create_string_length): Don't call gfc_defer_symbol_init
1077 if just creating DECL_ARGUMENTS.
1078 (gfc_get_symbol_decl): Call gfc_finish_var_decl and
1079 gfc_defer_symbol_init even if ts.cl->backend_decl is already
1080 set to a VAR_DECL that doesn't have DECL_CONTEXT yet.
1081 (create_function_arglist): Rework, so that hidden length
1082 arguments for CHARACTER parameters are created together with
1083 the parameters. Resolve ts.cl->backend_decl for CHARACTER
1084 parameters. If the argument is a non-constant length array
1085 or CHARACTER, ensure PARM_DECL has different type than
1087 (generate_local_decl): Call gfc_get_symbol_decl even
1088 for non-referenced non-constant length CHARACTER parameters
1089 after optionally issuing warnings.
1090 * trans-array.c (gfc_trans_array_bounds): Set last stride
1091 to GFC_TYPE_ARRAY_SIZE (type) to initialize it as well.
1092 (gfc_trans_dummy_array_bias): Initialize GFC_TYPE_ARRAY_SIZE (type)
1095 * trans-expr.c (gfc_conv_expr_val): Fix comment typo.
1097 * trans-stmt.c (gfc_trans_simple_do): Fix comment.
1099 2006-02-04 Roger Sayle <roger@eyesopen.com>
1101 * dependency.c (gfc_check_dependency): Remove unused vars and nvars
1102 arguments. Replace with an "identical" argument. A full array
1103 reference to the same symbol is a dependency if identical is true.
1104 * dependency.h (gfc_check_dependency): Update prototype.
1105 * trans-array.h (gfc_check_dependency): Delete duplicate prototype.
1106 * trans-stmt.c: #include dependency.h for gfc_check_dependency.
1107 (gfc_trans_forall_1): Update calls to gfc_check_dependency.
1108 (gfc_trans_where_2): Likewise. Remove unneeded variables.
1109 (gfc_trans_where_3): New function for simple non-dependent WHEREs.
1110 (gfc_trans_where): Call gfc_trans_where_3 to translate simple
1111 F90-style WHERE statements without internal dependencies.
1112 * Make-lang.in (trans-stmt.o): Depend upon dependency.h.
1114 2006-02-05 H.J. Lu <hongjiu.lu@intel.com>
1118 * resolve.c (resolve_types): New function.
1119 (resolve_codes): Likewise.
1120 (gfc_resolve): Use them.
1122 2006-02-05 Roger Sayle <roger@eyesopen.com>
1124 * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE
1125 masks instead of LOGICAL*4.
1127 2006-02-05 Jakub Jelinek <jakub@redhat.com>
1129 * resolve.c (resolve_symbol): Initialize constructor_expr to NULL.
1131 2006-02-04 Thomas Koenig <Thomas.Koenig@online.de>
1134 check.c (identical_dimen_shape): New function.
1135 (check_dot_product): Use identical_dimen_shape() to check sizes
1137 (gfc_check_matmul): Likewise.
1138 (gfc_check_merge): Check conformance between tsource and fsource
1139 and between tsource and mask.
1140 (gfc_check_pack): Check conformance between array and mask.
1142 2006-02-03 Steven G. Kargl <kargls@comcast>
1143 Paul Thomas <pault@gcc.gnu.org>
1146 * resolve.c (resolve_symbol): Default initialization of derived type
1147 component reguires the SAVE attribute.
1149 2006-02-02 Steven G. Kargl <kargls@comcast>
1152 match.c (gfc_match_nullify): Free the list from head not tail.
1155 * match.c (match_forall_header): Fix internal error caused by bogus
1159 2006-01-31 Thomas Koenig <Thomas.Koenig@online.de>
1162 expr.c (gfc_check_conformance): Reorder error message
1164 check.c(gfc_check_minloc_maxloc): Call gfc_check_conformance
1165 for checking arguments array and mask.
1166 (check_reduction): Likewise.
1168 2006-01-30 Erik Edelmann <eedelman@gcc.gnu.org>
1171 * trans-io.c (set_internal_unit): Check the rank of the
1172 expression node itself instead of its symbol.
1174 2006-01-29 Paul Thomas <pault@gcc.gnu.org>
1180 * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
1181 if actual argument is not a variable.
1183 2006-01-28 Paul Thomas <pault@gcc.gnu.org>
1186 * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
1187 the lvalue is a use associated procedure.
1191 * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
1192 character lengths are not the same. Use gfc_dep_compare_expr for the
1194 * gfortran.h: Add prototype for gfc_dep_compare_expr.
1195 * dependency.h: Remove prototype for gfc_dep_compare_expr.
1197 2006-01-27 Paul Thomas <pault@gcc.gnu.org>
1200 * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
1201 generic_ids exempted from assumed size checking.
1203 2006-01-27 Jakub Jelinek <jakub@redhat.com>
1206 * Make-lang.in (fortran/scanner.o): Depend on toplev.h.
1207 * lang.opt (fpreprocessed): New option.
1208 * scanner.c: Include toplev.h.
1209 (gfc_src_file, gfc_src_preprocessor_lines): New variables.
1210 (preprocessor_line): Unescape filename if there were any
1212 (load_file): If initial and gfc_src_file is not NULL,
1213 use it rather than opening the file. If gfc_src_preprocessor_lines
1214 has non-NULL elements, pass it to preprocessor_line.
1215 (unescape_filename, gfc_read_orig_filename): New functions.
1216 * gfortran.h (gfc_option_t): Add flag_preprocessed.
1217 (gfc_read_orig_filename): New prototype.
1218 * options.c (gfc_init_options): Clear flag_preprocessed.
1219 (gfc_post_options): If flag_preprocessed, call
1220 gfc_read_orig_filename.
1221 (gfc_handle_option): Handle OPT_fpreprocessed.
1222 * lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
1225 2006-01-27 Erik Edelmann <eedelman@gcc.gnu.org>
1227 * symbol.c (free_old_symbol): Fix confusing comment, and add code
1228 to free old_symbol->formal.
1230 2006-01-26 Paul Thomas <pault@gcc.gnu.org>
1233 * resolve.c (resolve_function): Exclude statement functions from
1234 global reference checking.
1240 * resolve.c (resolve_function): Declare a gfc_symbol to replace the
1241 references through the symtree to the symbol associated with the
1242 function expresion. Give error on reference to an assumed character
1243 length function is defined in an interface or an external function
1244 that is not a dummy argument.
1245 (resolve_symbol): Give error if an assumed character length function
1246 is array-valued, pointer-valued, pure or recursive. Emit warning
1247 that character(*) value functions are obsolescent in F95.
1250 * trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
1251 prevents any assumed character length function call from getting here
1252 except intrinsics such as SPREAD. In this case, ensure that no
1253 segfault occurs from referencing non-existent charlen->length->
1254 expr_type and provide a backend_decl for the charlen from the charlen
1255 of the first actual argument.
1257 Cure temp name confusion.
1258 * trans-expr.c (gfc_get_interface_mapping_array): Change name of
1259 temporary from "parm" to "ifm" to avoid clash with temp coming from
1262 2006-01-25 Erik Edelmann <eedelman@gcc.gnu.org>
1265 * symbol.c (free_old_symbol): New function.
1266 (gfc_commit_symbols): Use it.
1267 (gfc_commit_symbol): New function.
1268 (gfc_use_derived): Use it.
1269 * gfortran.h: Add prototype for gfc_commit_symbol.
1270 * intrinsic.c (gfc_find_function): Search in 'conversion'
1271 if not found in 'functions'.
1272 (gfc_convert_type_warn): Add a symtree to the new
1273 expression node, and commit the new symtree->n.sym.
1274 * resolve.c (gfc_resolve_index): Make sure typespec is
1275 properly initialized.
1277 2006-01-23 Paul Thomas <pault@gcc.gnu.org>
1280 * decl.c (get_proc_name): Replace subroutine and function attributes
1281 in "already defined" test by the formal arglist pointer being non-NULL.
1283 Fix regression in testing of admissability of attributes.
1284 * symbol.c (gfc_add_attribute): If the current_attr has non-zero
1285 intent, do not do the check for a dummy being used.
1286 * decl.c (attr_decl1): Add current_attr.intent as the third argument
1287 in the call to gfc_add_attribute.
1288 * gfortran.h: Add the third argument to the prototype for
1291 2006-01-21 Joseph S. Myers <joseph@codesourcery.com>
1293 * gfortranspec.c (lang_specific_driver): Update copyright notice
1296 2006-01-21 Paul Thomas <pault@gcc.gnu.org>
1300 * decl.c (get_proc_name): If there is an existing
1301 symbol in the encompassing namespace, call errors
1302 if it is a procedure of the same name or the kind
1303 field is set, indicating a type declaration.
1309 * decl.c (add_global_entry): New function to check
1310 for existing global symbol with this name and to
1311 create new one if none exists.
1312 (gfc_match_entry): Call add_global_entry before
1313 matching argument lists for subroutine and function
1315 * gfortran.h: Prototype for existing function,
1317 * resolve.c (resolve_global_procedure): New function
1318 to check global symbols for procedures.
1319 (resolve_call, resolve_function): Calls to this
1320 new function for non-contained and non-module
1322 * match.c (match_common): Add check for existing
1323 global symbol, creat one if none exists and emit
1324 error if there is a clash.
1325 * parse.c (global_used): Remove static and use the
1326 gsymbol name rather than the new_block name, so that
1327 the function can be called from resolve.c.
1328 (parse_block_data, parse_module, add_global_procedure):
1329 Improve checks for existing gsymbols. Emit error if
1330 already defined or if references were to another type.
1334 * trans-expr.c (gfc_conv_aliased_arg): New function called by
1335 gfc_conv_function_call that coverts an expression for an aliased
1336 component reference to a derived type array into a temporary array
1337 of the same type as the component. The temporary is passed as an
1338 actual argument for the procedure call and is copied back to the
1339 derived type after the call.
1340 (is_aliased_array): New function that detects an array reference
1341 that is followed by a component reference.
1342 (gfc_conv_function_call): Detect an aliased actual argument with
1343 is_aliased_array and convert it to a temporary and back again
1344 using gfc_conv_aliased_arg.
1346 2006-01-19 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
1348 * gfortranspec.c: Update copyright years.
1349 * trans.c: Likewise.
1350 * trans-array.c: Likewise.
1351 * trans-array.h: Likewise.
1352 * trans-decl.c: Likewise.
1353 * trans-stmt.c: Likewise.
1354 * trans-stmt.h: Likewise.
1355 * trans-types.c: Likewise.
1357 2006-01-18 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
1361 * gfortran.h (BBT_HEADER): Move definition up.
1362 (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'.
1363 * io.c (format_asterisk): Adapt initializer.
1364 * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
1366 (warn_unused_label): Take gfc_st_label label as argument, adapt to
1368 (gfc_resolve): Adapt call to warn_unused_label.
1369 * symbol.c (compare_st_labels): New function.
1370 (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to
1371 using balanced binary tree.
1372 * decl.c (match_char_length, gfc_match_old_kind_spec): Do away
1374 (warn_unused_label): Adapt to binary tree.
1375 * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL.
1376 * primary.c (match_kind_param): Do away with cnt.
1378 2006-01-18 Paul Thomas <pault@gcc.gnu.org>
1383 * symbol.c (check_conflict): Add pointer valued elemental
1384 functions and internal procedures with the external attribute
1385 to the list of conflicts.
1386 (gfc_add_attribute): New catch-all function to perform the
1387 checking of symbol attributes for attribute declaration
1389 * decl.c (attr_decl1): Call gfc_add_attribute for each of -
1390 (gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
1391 gfc_match_pointer, gfc_match_dimension, gfc_match_target):
1392 Remove spurious calls to checks in symbol.c. Set the
1393 attribute directly and use the call to attr_decl() for
1395 * gfortran.h: Add prototype for gfc_add_attribute.
1398 * resolve.c (resolve_function): Exclude PRESENT from assumed size
1399 argument checking. Replace strcmp's with comparisons with generic
1402 2006-01-16 Rafael
\81Ávila de Esp
\81índola <rafael.espindola@gmail.com>
1404 * gfortranspec.c (lang_specific_spec_functions): Remove.
1406 2006-01-16 Richard Guenther <rguenther@suse.de>
1408 * trans-stmt.c (gfc_trans_if_1): Use fold_buildN and build_int_cst.
1409 (gfc_trans_arithmetic_if): Likewise.
1410 (gfc_trans_simple_do): Likewise.
1411 (gfc_trans_do): Likewise.
1412 (gfc_trans_do_while): Likewise.
1413 (gfc_trans_logical_select): Likewise.
1414 (gfc_trans_forall_loop): Likewise.
1415 (generate_loop_for_temp_to_lhs): Likewise.
1416 (generate_loop_for_rhs_to_temp): Likewise.
1417 (gfc_trans_allocate): Likewise.
1418 * trans.c (gfc_add_expr_to_block): Do not fold expr again.
1420 2006-01-16 Richard Guenther <rguenther@suse.de>
1422 * trans-expr.c (gfc_conv_function_call): Use fold_build2.
1423 * trans-stmt.c (gfc_trans_goto): Likewise. Use build_int_cst.
1424 * trans.c (gfc_trans_runtime_check): Don't fold the condition
1427 2006-01-13 Steven G. Kargl <kargls@comcast.net>
1430 * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove
1431 unneeded parenthesis. Fix-up the head of the list (2 lines gleaned
1434 2006-01-13 Diego Novillo <dnovillo@redhat.com>
1436 * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement
1439 2006-01-11 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
1441 * parse.c (next_fixed): Remove superfluous string concatenation.
1443 2006-01-11 Bernhard Fischer <rep.nop@aon.at>
1446 * scanner.c (load_line): use maxlen to determine the line-length used
1447 for padding lines in fixed form.
1449 2006-01-11 Paul Thomas <pault@gcc.gnu.org>
1452 * trans-types.c (copy_dt_decls_ifequal): Copy backend decl for
1455 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
1458 * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
1459 to avoid type mismatch.
1461 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
1464 * trans-decl.c (gfc_generate_function_code): Move the NULLing of
1465 current_fake_result_decl down to below generate_local_vars.
1467 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
1470 * trans-expr.c (gfc_to_single_character): New function that converts
1471 string to single character if its length is 1.
1472 (gfc_build_compare_string):New function that compare string and handle
1473 single character specially.
1474 (gfc_conv_expr_op): Use gfc_build_compare_string.
1475 (gfc_trans_string_copy): Use gfc_to_single_character.
1476 * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
1477 gfc_build_compare_string.
1478 * trans.h (gfc_build_compare_string): Add prototype.
1480 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
1482 * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
1484 (gfc_simplify_ichar): Get the result from unsinged char and in the
1485 range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
1487 2006-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
1490 * resolve.c (resolve_fntype): Check that PUBLIC functions
1491 aren't of PRIVATE type.
1493 2006-01-07 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
1495 * decl.c (gfc_match_function_decl): Correctly error out in case of
1496 omitted function argument list.
1498 2006-01-07 Paul Thomas <pault@gcc.gnu.org>
1501 * trans-array.c (gfc_reverse_ss): Remove static attribute.
1502 (gfc_walk_elemental_function_args): Replace gfc_expr * argument for
1503 the function call with the corresponding gfc_actual_arglist*. Change
1505 (gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
1506 now requires the actual argument list instead of the expression for
1508 * trans-array.h: Modify the prototype for gfc_walk_elemental_function_args
1509 and provide a prototype for gfc_reverse_ss.
1510 * trans-stmt.h (gfc_trans_call): Add the scalarization code for the case
1511 where an elemental subroutine has array valued actual arguments.
1517 * resolve.c (check_assumed_size_reference): New function to check for upper
1518 bound in assumed size array references.
1519 (resolve_assumed_size_actual): New function to do a very restricted scan
1520 of actual argument expressions of those procedures for which incomplete
1521 assumed size array references are not allowed.
1522 (resolve_function, resolve_call): Switch off assumed size checking of
1523 actual arguments, except for elemental procedures and intrinsic
1524 inquiry functions, in some circumstances.
1525 (resolve_variable): Call check_assumed_size_reference.
1527 2006-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1530 * io.c (next_char_not_space): New function that returns the next
1531 character that is not white space.
1532 (format_lex): Use the new function to skip whitespace within
1535 2006-01-05 Erik Edelmann <eedelman@gcc.gnu.org>
1538 * expr.c (gfc_expr_set_symbols_referenced): New function.
1539 * gfortran.h: Add a function prototype for it.
1540 * resolve.c (resolve_function): Use it for
1541 use associated character functions lengths.
1542 * expr.c, gfortran.h, resolve.c: Updated copyright years.
1544 2006-01-03 Steven G. Kargl <kargls@comcast.net>
1547 * resolve.c (resolve_forall_iterators): Check for scalar variables;
1548 Check stride is nonzero.
1550 2006-01-02 Steven G. Kargl <kargls@comcast.net>
1553 * parse.c (next_free): Check for whitespace after the label.
1554 * match.c (gfc_match_small_literal_int): Initialize cnt variable.
1556 2006-01-01 Steven G. Kargl <kargls@comcast.net>
1558 * ChangeLog: Split previous years into ...
1559 * ChangeLog-2002: here.
1560 * ChangeLog-2003: here.
1561 * ChangeLog-2004: here.
1562 * ChangeLog-2005: here.