1 2006-03-14 Steven G. Kargl <kargls@comcast.net>
4 * gfortran.h: Wrap Copyright line.
5 (gfc_option_t): add warn_tabs member.
6 * lang.opt: Update Coyright year. Add the Wtabs.
7 * invoke.texi: Document -Wtabs.
8 * scanner.c (gfc_gobble_whitespace): Use warn_tabs. Add linenum to
9 suppress multiple warnings.
10 (load_line): Use warn_tabs. Add linenum, current_line, seen_comment
11 to suppress multiple warnings.
12 * options.c (gfc_init_options): Initialize warn_tabs.
13 (set_Wall): set warn_tabs for -Wall.
14 (gfc_post_options): Adjust flag_tabs depending on -pedantic.
15 (gfc_handle_option): Process command-line option -W[no-]tabs
17 2006-03-13 Paul Thomas <pault@gcc.gnu.org>
20 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set the initial position to zero and
21 modify the condition for updating it, to implement the F2003 requirement for all(mask)
24 2006-03-13 Jakub Jelinek <jakub@redhat.com>
26 * trans-openmp.c (gfc_trans_omp_variable): Handle references
28 * trans-expr.c (gfc_conv_variable): Remove useless setting
29 of parent_flag, formatting.
31 * trans-decl.c (gfc_get_fake_result_decl): Re-add setting of
34 2003-03-11 Roger Sayle <roger@eyesopen.com>
36 * dependency.c (gfc_dep_compare_expr) <EXPR_OP>: Allow unary and
37 binary operators to compare equal if their operands are equal.
38 <EXPR_FUNCTION>: Allow "constant" intrinsic conversion functions
39 to compare equal, if their operands are equal.
41 2006-03-11 Erik Edelmann <eedelman@gcc.gnu.org>
43 * symbol.c (check_conflict): Allow allocatable function results,
44 except for elemental functions.
45 * trans-array.c (gfc_trans_allocate_temp_array): Rename to ...
46 (gfc_trans_create_temp_array): ... this, and add new argument
48 (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call
49 to gfc_trans_allocate_temp_array.
50 * trans-array.h (gfc_trans_allocate_temp_array): Update prototype.
51 * trans-expr.c (gfc_conv_function_call): Use new arg of
52 gfc_trans_create_temp_array avoid pre-allocation of temporary
53 result variables of pointer AND allocatable functions.
54 (gfc_trans_arrayfunc_assign): Return NULL for allocatable
56 * resolve.c (resolve_symbol): Copy value of 'allocatable' attribute
57 from sym->result to sym.
59 2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
61 * trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
62 attribute from sym to new_sym. Call build_fold_indirect_ref()
63 for allocatable arguments.
65 2006-03-09 Paul Thomas <pault@gcc.gnu.org>
68 * trans-array.c (gfc_conv_expr_descriptor): Exclude calculation of
69 the offset and data when se->data_not_needed is set.
70 * trans.h: Include the data_not_need bit in gfc_se.
71 * trans-intrinsic.c (gfc_conv_intrinsic_size): Set it for SIZE.
73 2006-03-06 Paul Thomas <pault@gcc.gnu.org>
74 Erik Edelmann <eedelman@gcc.gnu.org>
76 * trans-array.c (gfc_trans_dealloc_allocated): New function.
77 (gfc_trans_deferred_array): Use it, instead of inline code.
78 * trans-array.h: Prototype for gfc_trans_dealloc_allocated().
79 * trans-expr.c (gfc_conv_function_call): Deallocate allocated
80 ALLOCATABLE, INTENT(OUT) arguments upon procedure entry.
82 2006-03-06 Paul Thomas <pault@gcc.gnu.org>
85 * resolve.c (resolve_function): Add name after test for pureness.
88 * trans-expr.c (gfc_conv_variable): Detect reference to parent result,
89 store current_function_decl, replace with parent, whilst calls are
90 made to gfc_get_fake_result_decl, and restore afterwards. Signal this
91 to gfc_get_fake_result_decl with a new argument, parent_flag.
92 * trans-stmt.c (gfc_trans_return): gfc_get_fake_result_decl 2nd arg
94 * trans.h: Add parent_flag to gfc_get_fake_result_decl prototype.
95 * trans-decl.c (gfc_get_fake_result_decl): On parent_flag, being set,
96 add decl to parent function. Replace refs to current_fake_result_decl
97 with refs to this_result_decl.
98 (gfc_generate_function_code): Null parent_fake_result_decl before the
99 translation of code for contained procedures. Set parent_flag to zero
100 in call to gfc_get_fake_result_decl.
101 * trans-intrinsic.c (gfc_conv_intrinsic_len): The same.
103 2006-03-05 Steven G. Kargl <kargls@comcast.net>
105 * simplify.c (gfc_simplify_verify): Fix return when SET=''.
107 2006-03-05 Erik Edelmann <eedelman@gcc.gnu.org>
110 * symbol.c (conf_std): New macro.
111 (check_conflict): Use it to allow ALLOCATABLE dummy
113 * trans-expr.c (gfc_conv_function_call): Pass the
114 address of the array descriptor when dummy argument is
116 * interface.c (compare_allocatable): New function.
117 (compare_actual_formal): Use it.
118 * resolve.c (resolve_deallocate_expr,
119 resolve_allocate_expr): Check that INTENT(IN) variables
120 aren't (de)allocated.
121 * gfortran.texi (Fortran 2003 status): List ALLOCATABLE
122 dummy arguments as supported.
124 2006-03-03 Roger Sayle <roger@eyesopen.com>
126 * dependency.c (gfc_check_element_vs_element): Revert last change.
128 2006-03-03 Roger Sayle <roger@eyesopen.com>
130 * dependency.c (gfc_check_element_vs_element): Consider two
131 unordered scalar subscripts as (potentially) equal.
133 2006-03-03 Roger Sayle <roger@eyesopen.com>
135 * dependency.c (gfc_check_dependency): Call gfc_dep_resolver to
136 check whether two array references have a dependency.
137 (gfc_check_element_vs_element): Assume lref and rref must be
138 REF_ARRAYs. If gfc_dep_compare_expr returns -2, assume these
139 references could potentially overlap.
140 (gfc_dep_resolver): Whitespace and comment tweaks. Assume a
141 dependency if the references have different depths. Rewrite
142 final term to clarrify we only have a dependency for overlaps.
144 2006-03-03 Thomas Koenig <Thomas.Koenig@online.de>
147 * trans-array.h: Adjust gfc_array_allocate prototype.
148 * trans-array.c (gfc_array_allocate): Change type of
149 gfc_array_allocatate to bool. Function returns true if
150 it operates on an array. Change second argument to gfc_expr.
151 Find last reference in chain.
152 If the function operates on an allocatable array, emit call to
153 allocate_array() or allocate64_array().
154 * trans-stmt.c (gfc_trans_allocate): Code to follow to last
155 reference has been moved to gfc_array_allocate.
156 * trans.h: Add declaration for gfor_fndecl_allocate_array and
157 gfor_fndecl_allocate64_array.
158 (gfc_build_builtin_function_decls): Add gfor_fndecl_allocate_array
159 and gfor_fndecl_allocate64_array.
161 2006-03-01 Roger Sayle <roger@eyesopen.com>
163 * trans-stmt.c (generate_loop_for_temp_to_lhs): Add an additional
164 INVERT argument to invert the sense of the WHEREMASK argument.
165 Remove unneeded code to AND together a list of masks.
166 (generate_loop_for_rhs_to_temp): Likewise.
167 (gfc_trans_assign_need_temp): Likewise.
168 (gfc_trans_forall_1): Likewise.
169 (gfc_evaluate_where_mask): Likewise, add a new INVERT argument
170 to specify the sense of the MASK argument.
171 (gfc_trans_where_assign): Likewise.
172 (gfc_trans_where_2): Likewise. Restructure code that decides
173 whether we need to allocate zero, one or two temporary masks.
174 If this is a top-level WHERE (i.e. the incoming MASK is NULL),
175 we only need to allocate at most one temporary mask, and can
176 invert it's sense to provide the complementary pending execution
177 mask. Only calculate the size of the required temporary arrays
179 (gfc_trans_where): Update call to gfc_trans_where_2.
181 2006-03-01 Paul Thomas <pault@gcc.gnu.org>
183 * iresolve.c (gfc_resolve_dot_product): Remove any difference in
184 treatment of logical types.
185 * trans-intrinsic.c (gfc_conv_intrinsic_dot_product): New function.
188 * trans-decl.c (gfc_get_symbol_decl): Extend condition that symbols
189 must be referenced to include unreferenced symbols in an interface
193 * trans-array.c (gfc_conv_resolve_dependencies): Add call to
194 gfc_are_equivalenced_arrays.
195 * symbol.c (gfc_free_equiv_infos, gfc_free_equiv_lists): New
196 functions. (gfc_free_namespace): Call them.
197 * trans-common.c (copy_equiv_list_to_ns): New function.
198 (add_equivalences): Call it.
199 * gfortran.h: Add equiv_lists to gfc_namespace and define
200 gfc_equiv_list and gfc_equiv_info.
201 * dependency.c (gfc_are_equivalenced_arrays): New function.
202 (gfc_check_dependency): Call it.
203 * dependency.h: Prototype for gfc_are_equivalenced_arrays.
205 2006-03-01 Roger Sayle <roger@eyesopen.com>
207 * dependency.c (gfc_is_same_range): Compare the stride, lower and
208 upper bounds when testing array reference ranges for equality.
209 (gfc_check_dependency): Fix indentation whitespace.
210 (gfc_check_element_vs_element): Likewise.
211 (gfc_dep_resolver): Likewise.
213 2006-02-28 Thomas Koenig <Thomas.Koenig@online.de>
215 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
216 If the mask expression exists and has rank 0, enclose the
217 generated loop in an "if (mask)". Put the default
218 initialization into the else branch.
220 2006-02-25 Thomas Koenig <Thomas.Koenig@online.de>
223 * trans-intrinsic.c (gfc_conv_intrinsic_arith): If the
224 mask expression exists and has rank 0, enclose the generated
225 loop in an "if (mask)".
226 * (gfc_conv_intrinsic_minmaxloc): Likewise.
228 2006-02-24 Paul Thomas <pault@gcc.gnu.org>
231 * resolve.c (resolve_contained_functions, resolve_types,
232 gfc_resolve): Revert patch of 2006-02-19.
234 2006-02-24 Paul Thomas <pault@gcc.gnu.org>
237 * dependency.c (gfc_is_same_range): Correct typo.
238 (gfc_check_section_vs_section): Call gfc_is_same_range.
241 * trans-common.c (add_equivalences): Add a new flag that is set when
242 an equivalence is seen that prevents more from being reset until the
243 start of a new traversal of the list, thus ensuring completion of
244 all the equivalences.
246 2006-02-23 Erik Edelmann <eedelman@gcc.gnu.org>
248 * module.c (read_module): Remove redundant code lines.
250 2006-02-20 Rafael
\81Ávila de Esp
\81índola <rafael.espindola@gmail.com>
251 * Make-lang.in (FORTRAN): Remove
252 (.PHONY): Remove F95 and f95. Add fortran
254 2006-02-20 Roger Sayle <roger@eyesopen.com>
256 * trans-stmt.c (gfc_trans_where_2): Avoid updating unused current
257 execution mask for empty WHERE/ELSEWHERE clauses. Don't allocate
258 temporary mask arrays if they won't be used.
260 2006-02-20 Roger Sayle <roger@eyesopen.com>
262 * trans-stmt.c (gfc_trans_where_assign): Remove code to handle
263 traversing a linked list of MASKs. The MASK is now always a
264 single element requiring no ANDing during the assignment.
266 2006-02-19 Thomas Koenig <Thomas.Koenig@online.de>
268 * gfortran.texi: Document environment variables which
269 influence runtime behavior.
271 2006-02-19 H.J. Lu <hongjiu.lu@intel.com>
273 * resolve.c (resolve_contained_functions): Call resolve_entries
275 (resolve_types): Remove calls to resolve_entries and
276 resolve_contained_functions.
277 (gfc_resolve): Call resolve_contained_functions.
279 2006-02-19 Erik Edelmann <eedelman@gcc.gnu.org>
282 * intrinsic.c (gfc_convert_type_warn): Call
283 gfc_intrinsic_symbol() on the newly created symbol.
285 2006-02-19 Paul Thomas <pault@gcc.gnu.org>
288 * resolve.c (is_non_constant_shape_array): New function.
289 (resolve_fl_variable): Remove code for the new function and call it.
290 (resolve_fl_namelist): New function. Add test for namelist array
291 with non-constant shape, using is_non_constant_shape_array.
292 (resolve_symbol): Remove code for resolve_fl_namelist and call it.
295 * match.c (match_namelist): Increment the refs field of an accepted
296 namelist object symbol.
297 * resolve.c (resolve_fl_namelist): Test namelist objects for a conflict
298 with contained or module procedures.
300 2006-02-18 Roger Sayle <roger@eyesopen.com>
302 * trans-stmt.c (struct temporary_list): Delete.
303 (gfc_trans_where_2): Major reorganization. Remove no longer needed
304 TEMP argument. Allocate and deallocate the control mask and
305 pending control mask locally.
306 (gfc_trans_forall_1): Delete TEMP local variable, and update
307 call to gfc_trans_where_2. No need to deallocate arrays after.
308 (gfc_evaluate_where_mask): Major reorganization. Change return
309 type to void. Pass in parent execution mask, MASK, and two
310 already allocated mask arrays CMASK and PMASK. On return
311 CMASK := MASK & COND, PMASK := MASK & !COND. MASK, CMASK and
312 CMASK may all be NULL, or refer to the same temporary arrays.
313 (gfc_trans_where): Update call to gfc_trans_where_2. We no
314 longer need a TEMP variable or to deallocate temporary arrays
315 allocated by gfc_trans_where_2.
317 2006-02-18 Danny Smith <dannysmith@users.sourceforeg.net>
319 * gfortran.h (gfc_add_attribute): Change uint to unsigned int.
320 * symbol.c (gfc_add_attribute): Likewise for definition.
321 * resolve.c (resolve_global_procedure): Likewise for variable 'type'.
323 2006-02-17 Richard Sandiford <richard@codesourcery.com>
325 * trans-common.c: Include rtl.h earlier.
326 * trans-decl.c: Likewise.
328 2006-02-16 Jakub Jelinek <jakub@redhat.com>
331 * parse.c (parse_omp_do, parse_omp_structured_block): Call
332 gfc_commit_symbols and gfc_warning_check.
334 * openmp.c (resolve_omp_clauses): Add a dummy case label to workaround
337 2006-02-16 Paul Thomas <pault@gcc.gnu.org>
340 * trans-expr.c (gfc_add_interface_mapping): Use the actual argument
341 for character(*) arrays, rather than casting to the type and kind
342 parameters of the formal argument.
344 2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
347 * options.c: Do not warn for Fortran 2003 features by default.
349 2006-02-15 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
351 * check.c: Update copyright years.
353 * check.c (gfc_check_minloc_maxloc, check_reduction): Don't call
354 dim_range_check on not-present optional dim argument.
356 2006-02-15 Jakub Jelinek <jakub@redhat.com>
360 * Make-lang.in (install-finclude-dir): New goal.
361 (fortran.install-common): Depend on install-finclude-dir.
362 * lang-specs.h: If not -nostdinc, add -I finclude.
364 2006-02-14 Thomas Koenig <Thomas.Koenig@online.de>
367 * check.c (dim_check): Perform all checks if dim is optional.
368 (gfc_check_minloc_maxloc): Use dim_check and dim_rank_check
369 to check dim argument.
370 (check_reduction): Likewise.
372 2006-02-14 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
375 * io.c (match_ltag): Mark label as referenced.
377 2006-02-14 Jakub Jelinek <jakub@redhat.com>
378 Richard Henderson <rth@redhat.com>
379 Diego Novillo <dnovillo@redhat.com>
381 * invoke.texi: Document -fopenmp.
382 * gfortran.texi (Extensions): Document OpenMP.
384 Backport from gomp-20050608-branch
385 * trans-openmp.c: Call build_omp_clause instead of
386 make_node when creating OMP_CLAUSE_* trees.
387 (gfc_trans_omp_reduction_list): Remove argument 'code'.
390 * trans.h (build4_v): Define.
391 * trans-openmp.c: Call build4_v to create OMP_PARALLEL nodes.
392 Call build3_v to create OMP_SECTIONS nodes.
395 * openmp.c (gfc_match_omp_variable_list): Call gfc_set_sym_referenced
396 on all symbols added to the variable list.
398 * openmp.c (gfc_match_omp_clauses): Fix check for non-INTRINSIC
399 procedure symbol in REDUCTION.
401 * trans-openmp.c (gfc_trans_omp_array_reduction): Use gfc_add
402 for MINUS_EXPR OMP_CLAUSE_REDUCTION_CODE.
404 * trans-openmp.c (gfc_trans_omp_do): Add PBLOCK argument. If PBLOCK
405 is non-NULL, evaluate INIT/COND/INCR and chunk size expressions in
406 that statement block.
407 (gfc_trans_omp_parallel_do): Pass non-NULL PBLOCK to gfc_trans_omp_do
408 for non-ordered non-static combined loops.
409 (gfc_trans_omp_directive): Pass NULL PBLOCK to gfc_trans_omp_do.
411 * openmp.c: Include target.h and toplev.h.
412 (gfc_match_omp_threadprivate): Emit diagnostic if target does
414 * Make-lang.in (fortran/openmp.o): Add dependencies on
415 target.h and toplev.h.
417 * trans-decl.c (gfc_get_fake_result_decl): Set GFC_DECL_RESULT.
418 * trans-openmp.c (gfc_omp_privatize_by_reference): Make
419 DECL_ARTIFICIAL vars predetermined shared except GFC_DECL_RESULT.
420 (gfc_omp_disregard_value_expr): Handle GFC_DECL_RESULT.
421 (gfc_trans_omp_variable): New function.
422 (gfc_trans_omp_variable_list, gfc_trans_omp_reduction_list): Use it.
423 * trans.h (GFC_DECL_RESULT): Define.
425 * trans-openmp.c (gfc_omp_firstprivatize_type_sizes): New function.
426 * f95-lang.c (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
427 * trans.h (gfc_omp_firstprivatize_type_sizes): New prototype.
429 * trans-openmp.c (gfc_omp_privatize_by_reference): Return
430 true if a pointer has GFC_DECL_SAVED_DESCRIPTOR set.
431 (gfc_trans_omp_array_reduction, gfc_trans_omp_reduction_list): New
433 (gfc_trans_omp_clauses): Add WHERE argument. Call
434 gfc_trans_omp_reduction_list rather than gfc_trans_omp_variable_list
436 (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
437 gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
438 gfc_trans_omp_sections, gfc_trans_omp_single): Adjust
439 gfc_trans_omp_clauses callers.
441 * openmp.c (omp_current_do_code): New var.
442 (gfc_resolve_omp_do_blocks): New function.
443 (gfc_resolve_omp_parallel_blocks): Call it.
444 (gfc_resolve_do_iterator): Add CODE argument. Don't propagate
445 predetermination if argument is !$omp do or !$omp parallel do
447 * resolve.c (resolve_code): Call gfc_resolve_omp_do_blocks
448 for EXEC_OMP_DO. Adjust gfc_resolve_do_iterator caller.
449 * fortran.h (gfc_resolve_omp_do_blocks): New prototype.
450 (gfc_resolve_do_iterator): Add CODE argument.
452 * trans.h (gfc_omp_predetermined_sharing,
453 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
455 (GFC_DECL_COMMON_OR_EQUIV, GFC_DECL_CRAY_POINTEE): Define.
456 * trans-openmp.c (gfc_omp_predetermined_sharing,
457 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
459 * trans-common.c (build_equiv_decl, build_common_decl,
460 create_common): Set GFC_DECL_COMMON_OR_EQUIV flag on the decls.
461 * trans-decl.c (gfc_finish_cray_pointee): Set GFC_DECL_CRAY_POINTEE
463 * f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_SHARING,
464 LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
465 LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE): Define.
467 * openmp.c (resolve_omp_clauses): Remove extraneous comma.
469 * symbol.c (check_conflict): Add conflict between cray_pointee and
471 * openmp.c (gfc_match_omp_threadprivate): Fail if
472 gfc_add_threadprivate returned FAILURE.
473 (resolve_omp_clauses): Diagnose Cray pointees in SHARED,
474 {,FIRST,LAST}PRIVATE and REDUCTION clauses and Cray pointers in
475 {FIRST,LAST}PRIVATE and REDUCTION clauses.
477 * resolve.c (omp_workshare_flag): New variable.
478 (resolve_function): Diagnose use of non-ELEMENTAL user defined
479 function in WORKSHARE construct.
480 (resolve_code): Cleanup forall_save use. Make sure omp_workshare_flag
481 is set to correct value in different contexts.
483 * openmp.c (resolve_omp_clauses): Replace %s with '%s' when printing
485 (resolve_omp_atomic): Likewise.
488 * scanner.c (skip_free_comments): Set at_bol at the beginning of the
490 (skip_fixed_comments): Handle ! comments in the middle of line here
492 (gfc_skip_comments): Use skip_fixed_comments for FIXED_FORM even if
494 (gfc_next_char_literal): Fix expected canonicalized *$omp string.
496 * trans-openmp.c (gfc_trans_omp_do): Use make_node and explicit
497 initialization to build OMP_FOR instead of build.
499 * trans-decl.c (gfc_gimplify_function): Invoke
500 diagnose_omp_structured_block_errors.
502 * trans-openmp.c (gfc_trans_omp_master): Use OMP_MASTER.
503 (gfc_trans_omp_ordered): Use OMP_ORDERED.
505 * gfortran.h (gfc_resolve_do_iterator, gfc_resolve_blocks,
506 gfc_resolve_omp_parallel_blocks): New prototypes.
507 * resolve.c (resolve_blocks): Renamed to...
508 (gfc_resolve_blocks): ... this. Remove static.
509 (gfc_resolve_forall): Adjust caller.
510 (resolve_code): Only call gfc_resolve_blocks if code->block != 0
511 and not for EXEC_OMP_PARALLEL* directives. Call
512 gfc_resolve_omp_parallel_blocks for EXEC_OMP_PARALLEL* directives.
513 Call gfc_resolve_do_iterator if resolved successfully EXEC_DO
515 * openmp.c: Include pointer-set.h.
516 (omp_current_ctx): New variable.
517 (gfc_resolve_omp_parallel_blocks, gfc_resolve_do_iterator): New
519 * Make-lang.in (fortran/openmp.o): Depend on pointer-set.h.
521 * openmp.c (gfc_match_omp_clauses): For max/min/iand/ior/ieor,
522 look up symbol if it exists, use its name instead and, if it is not
523 INTRINSIC, issue diagnostics.
525 * parse.c (parse_omp_do): Handle implied end do properly.
526 (parse_executable): If parse_omp_do returned ST_IMPLIED_ENDDO,
527 return it instead of continuing.
529 * trans-openmp.c (gfc_trans_omp_critical): Update for changed
531 (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
532 gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
533 gfc_trans_omp_sections, gfc_trans_omp_single): Likewise.
535 * trans.h (gfc_omp_privatize_by_reference): New prototype.
536 * f95-lang.c (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Redefine
537 to gfc_omp_privatize_by_reference.
538 * trans-openmp.c (gfc_omp_privatize_by_reference): New function.
540 * trans-stmt.h (gfc_trans_omp_directive): Add comment.
542 * openmp.c (gfc_match_omp_variable_list): Add ALLOW_COMMON argument.
543 Disallow COMMON matching if it is set.
544 (gfc_match_omp_clauses, gfc_match_omp_flush): Adjust all callers.
545 (resolve_omp_clauses): Show locus in error messages. Check that
546 variable types in reduction clauses are appropriate for reduction
549 * resolve.c (resolve_symbol): Don't error if a threadprivate module
550 variable isn't SAVEd.
552 * trans-openmp.c (gfc_trans_omp_do): Put count into BLOCK, not BODY.
553 Fix typo in condition. Fix DOVAR initialization.
555 * openmp.c (gfc_match_omp_clauses): Match min/iand/ior/ieor
556 rather than .min. etc.
558 * trans-openmpc.c (omp_not_yet): Remove.
559 (gfc_trans_omp_parallel_do): Keep listprivate clause on parallel.
560 Force creation of BIND_EXPR around the workshare construct.
561 (gfc_trans_omp_parallel_sections): Likewise.
562 (gfc_trans_omp_parallel_workshare): Likewise.
564 * types.def (BT_I16, BT_FN_I16_VPTR_I16,
565 BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
567 * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_DEFAULT.
568 (gfc_trans_omp_code): New function.
569 (gfc_trans_omp_do): Use it, remove omp_not_yet uses.
570 (gfc_trans_omp_parallel, gfc_trans_omp_single): Likewise.
571 (gfc_trans_omp_sections): Likewise. Only treat empty last section
572 specially if lastprivate clause is present.
573 * f95-lang.c (gfc_init_builtin_functions): Create BUILT_IN_TRAP
576 * trans-openmp.c (gfc_trans_omp_variable_list): Update for
577 OMP_CLAUSE_DECL name change.
578 (gfc_trans_omp_do): Likewise.
580 * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_REDUCTION
582 (gfc_trans_omp_atomic): Build OMP_ATOMIC instead of expanding
583 sync builtins directly.
584 (gfc_trans_omp_single): Build OMP_SINGLE statement.
586 * trans-openmp.c (gfc_trans_add_clause): New.
587 (gfc_trans_omp_variable_list): Take a tree code and build the clause
588 node here. Link it to the head of a list.
589 (gfc_trans_omp_clauses): Update to match.
590 (gfc_trans_omp_do): Use gfc_trans_add_clause.
592 * trans-openmp.c (gfc_trans_omp_clauses): Change second argument to
593 gfc_omp_clauses *. Use gfc_evaluate_now instead of creating
595 (gfc_trans_omp_atomic, gfc_trans_omp_critical): Use buildN_v macros.
596 (gfc_trans_omp_do): New function.
597 (gfc_trans_omp_master): Dont' check for gfc_trans_code returning NULL.
598 (gfc_trans_omp_parallel): Adjust gfc_trans_omp_clauses caller.
600 (gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_sections,
601 gfc_trans_omp_parallel_workshare, gfc_trans_omp_sections,
602 gfc_trans_omp_single, gfc_trans_omp_workshare): New functions.
603 (gfc_trans_omp_directive): Use them.
604 * parse.c (parse_omp_do): Allow new_st.op == EXEC_NOP.
605 * openmp.c (resolve_omp_clauses): Check for list items present
607 (resolve_omp_do): Check that iteration variable is not THREADPRIVATE
608 and is not present in any clause variable lists other than PRIVATE
611 * gfortran.h (symbol_attribute): Add threadprivate bit.
612 (gfc_common_head): Add threadprivate member, change use_assoc
613 and saved into char to save space.
614 (gfc_add_threadprivate): New prototype.
615 * symbol.c (check_conflict): Handle threadprivate.
616 (gfc_add_threadprivate): New function.
617 (gfc_copy_attr): Copy threadprivate.
618 * trans-openmp.c (gfc_trans_omp_clauses): Avoid creating a temporary
619 if IF or NUM_THREADS is constant. Create OMP_CLAUSE_SCHEDULE and
621 * resolve.c (resolve_symbol): Complain if a THREADPRIVATE symbol
622 outside a module and not in COMMON has is not SAVEd.
623 (resolve_equivalence): Ensure THREADPRIVATE objects don't get
625 * trans-common.c: Include target.h and rtl.h.
626 (build_common_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
627 * trans-decl.c: Include rtl.h.
628 (gfc_finish_var_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
629 * dump-parse-tree.c (gfc_show_attr): Handle THREADPRIVATE.
630 * Make-lang.in (fortran/trans-decl.o): Depend on $(RTL_H).
631 (fortran/trans-common.o): Depend on $(RTL_H) and $(TARGET_H).
632 * openmp.c (gfc_match_omp_variable_list): Ensure COMMON block
633 is from current namespace.
634 (gfc_match_omp_threadprivate): Rewrite.
635 (resolve_omp_clauses): Check some clause restrictions.
636 * module.c (ab_attribute): Add AB_THREADPRIVATE.
637 (attr_bits): Add THREADPRIVATE.
638 (mio_symbol_attribute, mio_symbol_attribute): Handle threadprivate.
639 (load_commons, write_common, write_blank_common): Adjust for type
640 change of saved, store/load threadprivate bit from the integer
643 * types.def (BT_FN_UINT_UINT): New.
644 (BT_FN_VOID_UINT_UINT): Remove.
646 * trans-openmp.c (gfc_trans_omp_clauses, gfc_trans_omp_barrier,
647 gfc_trans_omp_critical, gfc_trans_omp_flush, gfc_trans_omp_master,
648 gfc_trans_omp_ordered, gfc_trans_omp_parallel): New functions.
649 (gfc_trans_omp_directive): Use them.
651 * openmp.c (expr_references_sym): Add SE argument, don't look
653 (is_conversion): New function.
654 (resolve_omp_atomic): Adjust expr_references_sym callers. Handle
655 promoted expressions.
656 * trans-openmp.c (gfc_trans_omp_atomic): New function.
657 (gfc_trans_omp_directive): Call it.
659 * f95-lang.c (builtin_type_for_size): New function.
660 (gfc_init_builtin_functions): Initialize synchronization and
662 * types.def: New file.
663 * Make-lang.in (f95-lang.o): Depend on $(BUILTINS_DEF) and
666 * trans-openmp.c: Rename GOMP_* tree codes into OMP_*.
668 * dump-parse-tree.c (show_symtree): Don't crash if ns->proc_name
671 * dump-parse-tree.c (gfc_show_namelist, gfc_show_omp_node): New
673 (gfc_show_code_node): Call gfc_show_omp_node for EXEC_OMP_* nodes.
675 * parse.c (parse_omp_do): Call pop_state before next_statement.
676 * openmp.c (expr_references_sym, resolve_omp_atomic, resolve_omp_do):
678 (gfc_resolve_omp_directive): Call them.
679 * match.c (match_exit_cycle): Issue error if EXIT or CYCLE statement
680 leaves an OpenMP structured block or if EXIT terminates !$omp do
683 * Make-lang.in (F95_PARSER_OBJS): Add fortran/openmp.o.
684 (F95_OBJS): Add fortran/trans-openmp.o.
685 (fortran/trans-openmp.o): Depend on $(GFORTRAN_TRANS_DEPS).
686 * lang.opt: Add -fopenmp option.
687 * options.c (gfc_init_options): Initialize it.
688 (gfc_handle_option): Handle it.
689 * gfortran.h (ST_OMP_ATOMIC, ST_OMP_BARRIER, ST_OMP_CRITICAL,
690 ST_OMP_END_CRITICAL, ST_OMP_END_DO, ST_OMP_END_MASTER,
691 ST_OMP_END_ORDERED, ST_OMP_END_PARALLEL, ST_OMP_END_PARALLEL_DO,
692 ST_OMP_END_PARALLEL_SECTIONS, ST_OMP_END_PARALLEL_WORKSHARE,
693 ST_OMP_END_SECTIONS, ST_OMP_END_SINGLE, ST_OMP_END_WORKSHARE,
694 ST_OMP_DO, ST_OMP_FLUSH, ST_OMP_MASTER, ST_OMP_ORDERED,
695 ST_OMP_PARALLEL, ST_OMP_PARALLEL_DO, ST_OMP_PARALLEL_SECTIONS,
696 ST_OMP_PARALLEL_WORKSHARE, ST_OMP_SECTIONS, ST_OMP_SECTION,
697 ST_OMP_SINGLE, ST_OMP_THREADPRIVATE, ST_OMP_WORKSHARE): New
699 (OMP_LIST_PRIVATE, OMP_LIST_FIRSTPRIVATE, OMP_LIST_LASTPRIVATE,
700 OMP_LIST_COPYPRIVATE, OMP_LIST_SHARED, OMP_LIST_COPYIN,
701 OMP_LIST_PLUS, OMP_LIST_REDUCTION_FIRST, OMP_LIST_MULT,
702 OMP_LIST_SUB, OMP_LIST_AND, OMP_LIST_OR, OMP_LIST_EQV,
703 OMP_LIST_NEQV, OMP_LIST_MAX, OMP_LIST_MIN, OMP_LIST_IAND,
704 OMP_LIST_IOR, OMP_LIST_IEOR, OMP_LIST_REDUCTION_LAST, OMP_LIST_NUM):
705 New OpenMP variable list types.
706 (gfc_omp_clauses): New typedef.
707 (gfc_get_omp_clauses): Define.
708 (EXEC_OMP_CRITICAL, EXEC_OMP_DO, EXEC_OMP_FLUSH, EXEC_OMP_MASTER,
709 EXEC_OMP_ORDERED, EXEC_OMP_PARALLEL, EXEC_OMP_PARALLEL_DO,
710 EXEC_OMP_PARALLEL_SECTIONS, EXEC_OMP_PARALLEL_WORKSHARE,
711 EXEC_OMP_SECTIONS, EXEC_OMP_SINGLE, EXEC_OMP_WORKSHARE,
712 EXEC_OMP_ATOMIC, EXEC_OMP_BARRIER, EXEC_OMP_END_NOWAIT,
713 EXEC_OMP_END_SINGLE): New OpenMP gfc_exec_op codes.
714 (struct gfc_code): Add omp_clauses, omp_name, omp_namelist
715 and omp_bool fields to ext union.
716 (flag_openmp): Declare.
717 (gfc_free_omp_clauses, gfc_resolve_omp_directive): New prototypes.
718 * scanner.c (openmp_flag, openmp_locus): New variables.
719 (skip_free_comments, skip_fixed_comments, gfc_next_char_literal):
720 Handle OpenMP directive lines and conditional compilation magic
722 * parse.h (COMP_OMP_STRUCTURED_BLOCK): New compile state.
723 * parse.c (decode_omp_directive, parse_omp_do, parse_omp_atomic,
724 parse_omp_structured_block): New functions.
725 (next_free, next_fixed): Parse OpenMP directives.
726 (case_executable, case_exec_markers, case_decl): Add ST_OMP_*
728 (gfc_ascii_statement): Handle ST_OMP_* codes.
729 (parse_executable): Rearrange the loop slightly, so that
730 parse_omp_do can return next_statement.
731 * match.h (gfc_match_omp_eos, gfc_match_omp_atomic,
732 gfc_match_omp_barrier, gfc_match_omp_critical, gfc_match_omp_do,
733 gfc_match_omp_flush, gfc_match_omp_master, gfc_match_omp_ordered,
734 gfc_match_omp_parallel, gfc_match_omp_parallel_do,
735 gfc_match_omp_parallel_sections, gfc_match_omp_parallel_workshare,
736 gfc_match_omp_sections, gfc_match_omp_single,
737 gfc_match_omp_threadprivate, gfc_match_omp_workshare,
738 gfc_match_omp_end_nowait, gfc_match_omp_end_single): New prototypes.
739 * resolve.c (resolve_blocks): Ignore EXEC_OMP_* block directives.
740 (resolve_code): Call gfc_resolve_omp_directive on EXEC_OMP_*
742 * trans.c (gfc_trans_code): Call gfc_trans_omp_directive for
743 EXEC_OMP_* directives.
744 * st.c (gfc_free_statement): Handle EXEC_OMP_* statement freeing.
745 * trans-stmt.h (gfc_trans_omp_directive): New prototype.
746 * openmp.c: New file.
747 * trans-openmp.c: New file.
749 2006-02-13 Andrew Pinski <pinskia@physics.uc.edu>
750 Jakub Jelinek <jakub@redhat.com>
753 * trans-decl.c (gfc_get_symbol_decl, gfc_get_fake_result_decl): Use
754 gfc_add_decl_to_function rather than gfc_finish_var_decl on length.
756 2006-02-13 Paul Thomas <pault@gcc.gnu.org>
760 * resolve.c (resolve_symbol): Extend the requirement that module
761 arrays have constant bounds to those in the main program. At the
762 same time simplify the array bounds, to avoiding trapping parameter
763 array references, and exclude automatic character length from main
764 and modules. Rearrange resolve_symbol and resolve_derived to put as
765 each flavor together, as much as is possible and move all specific
766 code for flavors FL_VARIABLE, FL_PROCEDURE and FL_PARAMETER into new
768 (resolve_fl_var_and_proc, resolve_fl_variable, resolve_fl_procedure):
769 New functions to do work of resolve_symbol.
770 (resolve_index_expr): New function that is called from resolved_symbol
771 and is extracted from resolve_charlen.
772 (resolve_charlen): Call this new function.
773 (resolve_fl_derived): Renamed resolve_derived to be consistent with
774 the naming of the new functions for the other flavours. Change the
775 charlen checking so that the style is consistent with other similar
776 checks. Add the generation of the gfc_dt_list, removed from resolve_
780 * resolve.c (resolve_actual_arglist): Prevent internal procedures
781 from being dummy arguments.
784 * resolve.c (resolve_actual_arglist): Prevent pure but non-intrinsic
785 procedures from being dummy arguments.
788 * resolve.c (check_data_variable): Add test that data variable is in
792 * resolve.c (resolve_call): Add test that the subroutine does not
795 2006-02-12 Erik Edelmann <eedelman@gcc.gnu.org>
798 * trans-array.c (gfc_trans_allocate_array_storage): New argument
799 dealloc; free the temporary only if dealloc is true.
800 (gfc_trans_allocate_temp_array): New argument bool dealloc, to be
801 passed onwards to gfc_trans_allocate_array_storage.
802 (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
803 gfc_trans_allocate_temp_array.
804 * trans-array.h (gfc_trans_allocate_temp_array): Update function
806 * trans-expr.c (gfc_conv_function_call): Set new argument 'dealloc'
807 to gfc_trans_allocate_temp_array to false in case of functions
809 (gfc_trans_arrayfunc_assign): Return NULL for functions returning
812 2006-02-10 Steven G. Kargl <kargls@comcast.net>
815 *decl.c (variable_decl): Improve error message. Remove initialization
816 typespec. Wrap long line.
817 *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type,
819 *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank
823 2006-02-10 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
826 * arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES.
827 * expr.c (check_intrinsic_op): Likewise.
828 * module.c (mio_expr): Likewise.
830 2006-02-09 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
832 * dump-parse-tree.c: Update copyright years.
833 * matchexp.c: Likewise.
834 * module.c: Likewise.
837 * gfortran.h (gfc_intrinsic_op): Add INTRINSIC_PARENTHESES.
838 * dump-parse-tree (gfc_show_expr): Handle INTRINSIC_PARENTHESES.
839 * expr.c (simplify_intrinsic_op): Treat INTRINSIC_PARENTHESES as
840 if it were INTRINSIC_UPLUS.
841 * resolve.c (resolve_operator): Handle INTRINSIC_PARENTHESES.
842 * match.c (intrinsic_operators): Add INTRINSIC_PARENTHESES.
843 * matchexp.c (match_primary): Record parentheses surrounding
845 * module.c (intrinsics): Add INTRINSIC_PARENTHESES for module
847 * trans-expr.c (gfc_conv_expr_op): Handle INTRINSIC_PARENTHESES.
849 2006-02-09 Paul Thomas <pault@gcc.gnu.org>
852 * trans-stmt.c (gfc_trans_allocate): Provide assumed character length
853 scalar with missing backend_decl for the hidden dummy charlen.
856 * interface.c (gfc_extend_assign): Remove detection of non-PURE
857 subroutine in assignment interface, with gfc_error, and put it in
858 * resolve.c (resolve_code).
861 * interface.c (gfc_procedure_use): Flag rank checking for non-
862 elemental, contained or interface procedures in call to
863 (compare_actual_formal), where ranks are checked for assumed
866 2006-02-08 Francois-Xavier Coudert <coudert@clipper.ens.fr>
869 * trans-decl.c (gfc_generate_function_code): Add new argument,
870 pedantic, to set_std call.
872 2006-02-06 Thomas Koenig <Thomas.Koenig@online.de>
875 * gfortran.texi: Document the GFORTRAN_CONVERT_UNIT environment
877 * invoke.texi: Mention the "Runtime" chapter.
878 Document the -fconvert= option.
879 * gfortran.h: Add options_convert.
880 * lang.opt: Add fconvert=little-endian, fconvert=big-endian,
881 fconvert=native and fconvert=swap.
882 * trans-decl.c (top level): Add gfor_fndecl_set_convert.
883 (gfc_build_builtin_function_decls): Set gfor_fndecl_set_convert.
884 (gfc_generate_function_code): If -fconvert was specified,
885 and this is the main program, add a call to set_convert().
886 * options.c: Handle the -fconvert options.
888 2006-02-06 Roger Sayle <roger@eyesopen.com>
890 * trans-stmt.c (gfc_evaluate_where_mask): Allow the NMASK argument
891 to be NULL to indicate that the not mask isn't required.
892 (gfc_trans_where_2): Remove PMASK argument. Avoid calculating the
893 pending mask for the last clause of a WHERE chain. Update recursive
895 (gfc_trans_forall_1): Update call to gfc_trans_where_2.
896 (gfc_trans_where): Likewise.
898 2006-02-06 Jakub Jelinek <jakub@redhat.com>
900 Backport from gomp-20050608-branch
901 * trans-decl.c (create_function_arglist): Handle dummy functions.
903 * trans-decl.c (gfc_get_symbol_decl): Revert explicit setting of
905 (gfc_trans_vla_type_sizes): Also "gimplify"
906 GFC_TYPE_ARRAY_DATAPTR_TYPE for GFC_DESCRIPTOR_TYPE_P types.
907 * trans-array.c (gfc_trans_deferred_array): Call
908 gfc_trans_vla_type_sizes.
910 * trans-decl.c (saved_function_decls, saved_parent_function_decls):
911 Remove unnecessary initialization.
912 (create_function_arglist): Make sure __result has complete type.
913 (gfc_get_fake_result_decl): Change current_fake_result_decl into
914 a tree chain. For entry master, create a separate variable
915 for each result name. For BT_CHARACTER results, call
916 gfc_finish_var_decl on length even if it has been already created,
918 (gfc_trans_vla_type_sizes): For function/entry result, adjust
919 result value type, not the FUNCTION_TYPE.
920 (gfc_generate_function_code): Adjust for current_fake_result_decl
922 (gfc_trans_deferred_vars): Likewise. Call gfc_trans_vla_type_sizes
923 even on result if it is assumed-length character.
925 * trans-decl.c (gfc_trans_dummy_character): Add SYM argument.
926 Call gfc_trans_vla_type_sizes.
927 (gfc_trans_auto_character_variable): Call gfc_trans_vla_type_sizes.
928 (gfc_trans_vla_one_sizepos, gfc_trans_vla_type_sizes_1,
929 gfc_trans_vla_type_sizes): New functions.
930 (gfc_trans_deferred_vars): Adjust gfc_trans_dummy_character
931 callers. Call gfc_trans_vla_type_sizes on assumed-length
932 character parameters.
933 * trans-array.c (gfc_trans_array_bounds,
934 gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias): Call
935 gfc_trans_vla_type_sizes.
936 * trans.h (gfc_trans_vla_type_sizes): New prototype.
938 * trans-decl.c (gfc_build_qualified_array): For non-assumed-size
939 arrays without constant size, create also an index var for
940 GFC_TYPE_ARRAY_SIZE (type). If the type is incomplete, complete
942 (gfc_create_string_length): Don't call gfc_defer_symbol_init
943 if just creating DECL_ARGUMENTS.
944 (gfc_get_symbol_decl): Call gfc_finish_var_decl and
945 gfc_defer_symbol_init even if ts.cl->backend_decl is already
946 set to a VAR_DECL that doesn't have DECL_CONTEXT yet.
947 (create_function_arglist): Rework, so that hidden length
948 arguments for CHARACTER parameters are created together with
949 the parameters. Resolve ts.cl->backend_decl for CHARACTER
950 parameters. If the argument is a non-constant length array
951 or CHARACTER, ensure PARM_DECL has different type than
953 (generate_local_decl): Call gfc_get_symbol_decl even
954 for non-referenced non-constant length CHARACTER parameters
955 after optionally issuing warnings.
956 * trans-array.c (gfc_trans_array_bounds): Set last stride
957 to GFC_TYPE_ARRAY_SIZE (type) to initialize it as well.
958 (gfc_trans_dummy_array_bias): Initialize GFC_TYPE_ARRAY_SIZE (type)
961 * trans-expr.c (gfc_conv_expr_val): Fix comment typo.
963 * trans-stmt.c (gfc_trans_simple_do): Fix comment.
965 2006-02-04 Roger Sayle <roger@eyesopen.com>
967 * dependency.c (gfc_check_dependency): Remove unused vars and nvars
968 arguments. Replace with an "identical" argument. A full array
969 reference to the same symbol is a dependency if identical is true.
970 * dependency.h (gfc_check_dependency): Update prototype.
971 * trans-array.h (gfc_check_dependency): Delete duplicate prototype.
972 * trans-stmt.c: #include dependency.h for gfc_check_dependency.
973 (gfc_trans_forall_1): Update calls to gfc_check_dependency.
974 (gfc_trans_where_2): Likewise. Remove unneeded variables.
975 (gfc_trans_where_3): New function for simple non-dependent WHEREs.
976 (gfc_trans_where): Call gfc_trans_where_3 to translate simple
977 F90-style WHERE statements without internal dependencies.
978 * Make-lang.in (trans-stmt.o): Depend upon dependency.h.
980 2006-02-05 H.J. Lu <hongjiu.lu@intel.com>
984 * resolve.c (resolve_types): New function.
985 (resolve_codes): Likewise.
986 (gfc_resolve): Use them.
988 2006-02-05 Roger Sayle <roger@eyesopen.com>
990 * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE
991 masks instead of LOGICAL*4.
993 2006-02-05 Jakub Jelinek <jakub@redhat.com>
995 * resolve.c (resolve_symbol): Initialize constructor_expr to NULL.
997 2006-02-04 Thomas Koenig <Thomas.Koenig@online.de>
1000 check.c (identical_dimen_shape): New function.
1001 (check_dot_product): Use identical_dimen_shape() to check sizes
1003 (gfc_check_matmul): Likewise.
1004 (gfc_check_merge): Check conformance between tsource and fsource
1005 and between tsource and mask.
1006 (gfc_check_pack): Check conformance between array and mask.
1008 2006-02-03 Steven G. Kargl <kargls@comcast>
1009 Paul Thomas <pault@gcc.gnu.org>
1012 * resolve.c (resolve_symbol): Default initialization of derived type
1013 component reguires the SAVE attribute.
1015 2006-02-02 Steven G. Kargl <kargls@comcast>
1018 match.c (gfc_match_nullify): Free the list from head not tail.
1021 * match.c (match_forall_header): Fix internal error caused by bogus
1025 2006-01-31 Thomas Koenig <Thomas.Koenig@online.de>
1028 expr.c (gfc_check_conformance): Reorder error message
1030 check.c(gfc_check_minloc_maxloc): Call gfc_check_conformance
1031 for checking arguments array and mask.
1032 (check_reduction): Likewise.
1034 2006-01-30 Erik Edelmann <eedelman@gcc.gnu.org>
1037 * trans-io.c (set_internal_unit): Check the rank of the
1038 expression node itself instead of its symbol.
1040 2006-01-29 Paul Thomas <pault@gcc.gnu.org>
1046 * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
1047 if actual argument is not a variable.
1049 2006-01-28 Paul Thomas <pault@gcc.gnu.org>
1052 * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
1053 the lvalue is a use associated procedure.
1057 * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
1058 character lengths are not the same. Use gfc_dep_compare_expr for the
1060 * gfortran.h: Add prototype for gfc_dep_compare_expr.
1061 * dependency.h: Remove prototype for gfc_dep_compare_expr.
1063 2006-01-27 Paul Thomas <pault@gcc.gnu.org>
1066 * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
1067 generic_ids exempted from assumed size checking.
1069 2006-01-27 Jakub Jelinek <jakub@redhat.com>
1072 * Make-lang.in (fortran/scanner.o): Depend on toplev.h.
1073 * lang.opt (fpreprocessed): New option.
1074 * scanner.c: Include toplev.h.
1075 (gfc_src_file, gfc_src_preprocessor_lines): New variables.
1076 (preprocessor_line): Unescape filename if there were any
1078 (load_file): If initial and gfc_src_file is not NULL,
1079 use it rather than opening the file. If gfc_src_preprocessor_lines
1080 has non-NULL elements, pass it to preprocessor_line.
1081 (unescape_filename, gfc_read_orig_filename): New functions.
1082 * gfortran.h (gfc_option_t): Add flag_preprocessed.
1083 (gfc_read_orig_filename): New prototype.
1084 * options.c (gfc_init_options): Clear flag_preprocessed.
1085 (gfc_post_options): If flag_preprocessed, call
1086 gfc_read_orig_filename.
1087 (gfc_handle_option): Handle OPT_fpreprocessed.
1088 * lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
1091 2006-01-27 Erik Edelmann <eedelman@gcc.gnu.org>
1093 * symbol.c (free_old_symbol): Fix confusing comment, and add code
1094 to free old_symbol->formal.
1096 2006-01-26 Paul Thomas <pault@gcc.gnu.org>
1099 * resolve.c (resolve_function): Exclude statement functions from
1100 global reference checking.
1106 * resolve.c (resolve_function): Declare a gfc_symbol to replace the
1107 references through the symtree to the symbol associated with the
1108 function expresion. Give error on reference to an assumed character
1109 length function is defined in an interface or an external function
1110 that is not a dummy argument.
1111 (resolve_symbol): Give error if an assumed character length function
1112 is array-valued, pointer-valued, pure or recursive. Emit warning
1113 that character(*) value functions are obsolescent in F95.
1116 * trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
1117 prevents any assumed character length function call from getting here
1118 except intrinsics such as SPREAD. In this case, ensure that no
1119 segfault occurs from referencing non-existent charlen->length->
1120 expr_type and provide a backend_decl for the charlen from the charlen
1121 of the first actual argument.
1123 Cure temp name confusion.
1124 * trans-expr.c (gfc_get_interface_mapping_array): Change name of
1125 temporary from "parm" to "ifm" to avoid clash with temp coming from
1128 2006-01-25 Erik Edelmann <eedelman@gcc.gnu.org>
1131 * symbol.c (free_old_symbol): New function.
1132 (gfc_commit_symbols): Use it.
1133 (gfc_commit_symbol): New function.
1134 (gfc_use_derived): Use it.
1135 * gfortran.h: Add prototype for gfc_commit_symbol.
1136 * intrinsic.c (gfc_find_function): Search in 'conversion'
1137 if not found in 'functions'.
1138 (gfc_convert_type_warn): Add a symtree to the new
1139 expression node, and commit the new symtree->n.sym.
1140 * resolve.c (gfc_resolve_index): Make sure typespec is
1141 properly initialized.
1143 2006-01-23 Paul Thomas <pault@gcc.gnu.org>
1146 * decl.c (get_proc_name): Replace subroutine and function attributes
1147 in "already defined" test by the formal arglist pointer being non-NULL.
1149 Fix regression in testing of admissability of attributes.
1150 * symbol.c (gfc_add_attribute): If the current_attr has non-zero
1151 intent, do not do the check for a dummy being used.
1152 * decl.c (attr_decl1): Add current_attr.intent as the third argument
1153 in the call to gfc_add_attribute.
1154 * gfortran.h: Add the third argument to the prototype for
1157 2006-01-21 Joseph S. Myers <joseph@codesourcery.com>
1159 * gfortranspec.c (lang_specific_driver): Update copyright notice
1162 2006-01-21 Paul Thomas <pault@gcc.gnu.org>
1166 * decl.c (get_proc_name): If there is an existing
1167 symbol in the encompassing namespace, call errors
1168 if it is a procedure of the same name or the kind
1169 field is set, indicating a type declaration.
1175 * decl.c (add_global_entry): New function to check
1176 for existing global symbol with this name and to
1177 create new one if none exists.
1178 (gfc_match_entry): Call add_global_entry before
1179 matching argument lists for subroutine and function
1181 * gfortran.h: Prototype for existing function,
1183 * resolve.c (resolve_global_procedure): New function
1184 to check global symbols for procedures.
1185 (resolve_call, resolve_function): Calls to this
1186 new function for non-contained and non-module
1188 * match.c (match_common): Add check for existing
1189 global symbol, creat one if none exists and emit
1190 error if there is a clash.
1191 * parse.c (global_used): Remove static and use the
1192 gsymbol name rather than the new_block name, so that
1193 the function can be called from resolve.c.
1194 (parse_block_data, parse_module, add_global_procedure):
1195 Improve checks for existing gsymbols. Emit error if
1196 already defined or if references were to another type.
1200 * trans-expr.c (gfc_conv_aliased_arg): New function called by
1201 gfc_conv_function_call that coverts an expression for an aliased
1202 component reference to a derived type array into a temporary array
1203 of the same type as the component. The temporary is passed as an
1204 actual argument for the procedure call and is copied back to the
1205 derived type after the call.
1206 (is_aliased_array): New function that detects an array reference
1207 that is followed by a component reference.
1208 (gfc_conv_function_call): Detect an aliased actual argument with
1209 is_aliased_array and convert it to a temporary and back again
1210 using gfc_conv_aliased_arg.
1212 2006-01-19 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
1214 * gfortranspec.c: Update copyright years.
1215 * trans.c: Likewise.
1216 * trans-array.c: Likewise.
1217 * trans-array.h: Likewise.
1218 * trans-decl.c: Likewise.
1219 * trans-stmt.c: Likewise.
1220 * trans-stmt.h: Likewise.
1221 * trans-types.c: Likewise.
1223 2006-01-18 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
1227 * gfortran.h (BBT_HEADER): Move definition up.
1228 (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'.
1229 * io.c (format_asterisk): Adapt initializer.
1230 * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
1232 (warn_unused_label): Take gfc_st_label label as argument, adapt to
1234 (gfc_resolve): Adapt call to warn_unused_label.
1235 * symbol.c (compare_st_labels): New function.
1236 (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to
1237 using balanced binary tree.
1238 * decl.c (match_char_length, gfc_match_old_kind_spec): Do away
1240 (warn_unused_label): Adapt to binary tree.
1241 * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL.
1242 * primary.c (match_kind_param): Do away with cnt.
1244 2006-01-18 Paul Thomas <pault@gcc.gnu.org>
1249 * symbol.c (check_conflict): Add pointer valued elemental
1250 functions and internal procedures with the external attribute
1251 to the list of conflicts.
1252 (gfc_add_attribute): New catch-all function to perform the
1253 checking of symbol attributes for attribute declaration
1255 * decl.c (attr_decl1): Call gfc_add_attribute for each of -
1256 (gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
1257 gfc_match_pointer, gfc_match_dimension, gfc_match_target):
1258 Remove spurious calls to checks in symbol.c. Set the
1259 attribute directly and use the call to attr_decl() for
1261 * gfortran.h: Add prototype for gfc_add_attribute.
1264 * resolve.c (resolve_function): Exclude PRESENT from assumed size
1265 argument checking. Replace strcmp's with comparisons with generic
1268 2006-01-16 Rafael
\81Ávila de Esp
\81índola <rafael.espindola@gmail.com>
1270 * gfortranspec.c (lang_specific_spec_functions): Remove.
1272 2006-01-16 Richard Guenther <rguenther@suse.de>
1274 * trans-stmt.c (gfc_trans_if_1): Use fold_buildN and build_int_cst.
1275 (gfc_trans_arithmetic_if): Likewise.
1276 (gfc_trans_simple_do): Likewise.
1277 (gfc_trans_do): Likewise.
1278 (gfc_trans_do_while): Likewise.
1279 (gfc_trans_logical_select): Likewise.
1280 (gfc_trans_forall_loop): Likewise.
1281 (generate_loop_for_temp_to_lhs): Likewise.
1282 (generate_loop_for_rhs_to_temp): Likewise.
1283 (gfc_trans_allocate): Likewise.
1284 * trans.c (gfc_add_expr_to_block): Do not fold expr again.
1286 2006-01-16 Richard Guenther <rguenther@suse.de>
1288 * trans-expr.c (gfc_conv_function_call): Use fold_build2.
1289 * trans-stmt.c (gfc_trans_goto): Likewise. Use build_int_cst.
1290 * trans.c (gfc_trans_runtime_check): Don't fold the condition
1293 2006-01-13 Steven G. Kargl <kargls@comcast.net>
1296 * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove
1297 unneeded parenthesis. Fix-up the head of the list (2 lines gleaned
1300 2006-01-13 Diego Novillo <dnovillo@redhat.com>
1302 * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement
1305 2006-01-11 Tobias Schl
\81üter <tobias.schlueter@physik.uni-muenchen.de>
1307 * parse.c (next_fixed): Remove superfluous string concatenation.
1309 2006-01-11 Bernhard Fischer <rep.nop@aon.at>
1312 * scanner.c (load_line): use maxlen to determine the line-length used
1313 for padding lines in fixed form.
1315 2006-01-11 Paul Thomas <pault@gcc.gnu.org>
1318 * trans-types.c (copy_dt_decls_ifequal): Copy backend decl for
1321 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
1324 * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
1325 to avoid type mismatch.
1327 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
1330 * trans-decl.c (gfc_generate_function_code): Move the NULLing of
1331 current_fake_result_decl down to below generate_local_vars.
1333 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
1336 * trans-expr.c (gfc_to_single_character): New function that converts
1337 string to single character if its length is 1.
1338 (gfc_build_compare_string):New function that compare string and handle
1339 single character specially.
1340 (gfc_conv_expr_op): Use gfc_build_compare_string.
1341 (gfc_trans_string_copy): Use gfc_to_single_character.
1342 * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
1343 gfc_build_compare_string.
1344 * trans.h (gfc_build_compare_string): Add prototype.
1346 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
1348 * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
1350 (gfc_simplify_ichar): Get the result from unsinged char and in the
1351 range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
1353 2006-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
1356 * resolve.c (resolve_fntype): Check that PUBLIC functions
1357 aren't of PRIVATE type.
1359 2006-01-07 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
1361 * decl.c (gfc_match_function_decl): Correctly error out in case of
1362 omitted function argument list.
1364 2006-01-07 Paul Thomas <pault@gcc.gnu.org>
1367 * trans-array.c (gfc_reverse_ss): Remove static attribute.
1368 (gfc_walk_elemental_function_args): Replace gfc_expr * argument for
1369 the function call with the corresponding gfc_actual_arglist*. Change
1371 (gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
1372 now requires the actual argument list instead of the expression for
1374 * trans-array.h: Modify the prototype for gfc_walk_elemental_function_args
1375 and provide a prototype for gfc_reverse_ss.
1376 * trans-stmt.h (gfc_trans_call): Add the scalarization code for the case
1377 where an elemental subroutine has array valued actual arguments.
1383 * resolve.c (check_assumed_size_reference): New function to check for upper
1384 bound in assumed size array references.
1385 (resolve_assumed_size_actual): New function to do a very restricted scan
1386 of actual argument expressions of those procedures for which incomplete
1387 assumed size array references are not allowed.
1388 (resolve_function, resolve_call): Switch off assumed size checking of
1389 actual arguments, except for elemental procedures and intrinsic
1390 inquiry functions, in some circumstances.
1391 (resolve_variable): Call check_assumed_size_reference.
1393 2006-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1396 * io.c (next_char_not_space): New function that returns the next
1397 character that is not white space.
1398 (format_lex): Use the new function to skip whitespace within
1401 2006-01-05 Erik Edelmann <eedelman@gcc.gnu.org>
1404 * expr.c (gfc_expr_set_symbols_referenced): New function.
1405 * gfortran.h: Add a function prototype for it.
1406 * resolve.c (resolve_function): Use it for
1407 use associated character functions lengths.
1408 * expr.c, gfortran.h, resolve.c: Updated copyright years.
1410 2006-01-03 Steven G. Kargl <kargls@comcast.net>
1413 * resolve.c (resolve_forall_iterators): Check for scalar variables;
1414 Check stride is nonzero.
1416 2006-01-02 Steven G. Kargl <kargls@comcast.net>
1419 * parse.c (next_free): Check for whitespace after the label.
1420 * match.c (gfc_match_small_literal_int): Initialize cnt variable.
1422 2006-01-01 Steven G. Kargl <kargls@comcast.net>
1424 * ChangeLog: Split previous years into ...
1425 * ChangeLog-2002: here.
1426 * ChangeLog-2003: here.
1427 * ChangeLog-2004: here.
1428 * ChangeLog-2005: here.