re PR fortran/27351 (Use variable after free in gfc_conv_array_transpose)
[gcc.git] / gcc / fortran / ChangeLog
1 2006-04-29 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR fortran/27351
4 * trans-array.c (gfc_conv_array_transpose): Move gcc_assert
5 before gfc_conv_expr_descriptor.
6
7 2006-04-23 Paul Thomas <pault@gcc.gnu.org>
8
9 PR fortran/25099
10 * resolve.c (resolve_call): Check conformity of elemental
11 subroutine actual arguments.
12
13 2006-04-22 Jakub Jelinek <jakub@redhat.com>
14
15 PR fortran/26769
16 * iresolve.c (gfc_resolve_reshape): Use reshape_r16 for real(16).
17 (gfc_resolve_transpose): Use transpose_r16 for real(16).
18
19 2006-04-21 Paul Thomas <pault@gcc.gnu.org>
20
21 PR fortran/27122
22 * resolve.c (resolve_function): Remove general restriction on auto
23 character length function interfaces.
24 (gfc_resolve_uops): Check restrictions on defined operator
25 procedures.
26 (resolve_types): Call the check for defined operators.
27
28 PR fortran/27113
29 * trans-array.c (gfc_trans_array_constructor_subarray): Remove
30 redundant gfc_todo_error.
31 (get_array_ctor_var_strlen): Remove typo in enum.
32
33 2006-04-18 Bernhard Fischer <aldot@gcc.gnu.org>
34
35 * parse.c (next_free): Use consistent error string between
36 free-form and fixed-form for illegal statement label of zero.
37 (next_fixed): Use consistent warning string between free-form
38 and fixed-form for statement labels for empty statements.
39
40 2006-04-18 Steve Ellcey <sje@cup.hp.com>
41
42 * trans-io.c (gfc_build_io_library_fndecls): Align pad.
43
44 2006-04-16 Thomas Koenig <Thomas.Koenig@online.de>
45
46 PR fortran/26017
47 * trans-array.c(gfc_array_init_size): Introduce or_expr
48 which is true if the size along any dimension
49 is negative. Create a temporary variable with base
50 name size. If or_expr is true, set the temporary to 0,
51 to the normal size otherwise.
52
53 2006-04-16 Paul Thomas <pault@gcc.gnu.org>
54
55 PR fortran/26822
56 * intrinsic.c (add_functions): Mark LOGICAL as elemental.
57
58 PR fortran/26787
59 * expr.c (gfc_check_assign): Extend scope of error to include
60 assignments to a procedure in the main program or, from a
61 module or internal procedure that is not that represented by
62 the lhs symbol. Use VARIABLE rather than l-value in message.
63
64 PR fortran/27096
65 * trans-array.c (gfc_trans_deferred_array): If the backend_decl
66 is not a descriptor, dereference and then test and use the type.
67
68 PR fortran/25597
69 * trans-decl.c (gfc_trans_deferred_vars): Check if an array
70 result, is also automatic character length. If so, process
71 the character length.
72
73 PR fortran/18803
74 PR fortran/25669
75 PR fortran/26834
76 * trans_intrinsic.c (gfc_walk_intrinsic_bound): Set
77 data.info.dimen for bound intrinsics.
78 * trans_array.c (gfc_conv_ss_startstride): Pick out LBOUND and
79 UBOUND intrinsics and supply their shape information to the ss
80 and the loop.
81
82 PR fortran/27124
83 * trans_expr.c (gfc_trans_function_call): Add a new block, post,
84 in to which all the argument post blocks are put. Add this block
85 to se->pre after a byref call or to se->post, otherwise.
86
87 2006-04-14 Roger Sayle <roger@eyesopen.com>
88
89 * trans-io.c (set_string): Use fold_build2 and build_int_cst instead
90 of build2 and convert to construct "x < 0" rather than "x <= -1".
91
92 2006-04-13 Richard Henderson <rth@redhat.com>
93
94 * trans-openmp.c (gfc_trans_omp_sections): Adjust for changed
95 number of operands to OMP_SECTIONS.
96
97 2006-04-08 Kazu Hirata <kazu@codesourcery.com>
98
99 * gfortran.texi: Fix typos. Follow spelling conventions.
100 * resolve.c, trans-expr.c, trans-stmt.c: Fix comment typos.
101 Follow spelling conventions.
102
103 2006-04-05 Roger Sayle <roger@eyesopen.com>
104
105 * dependency.c (get_no_elements): Delete function.
106 (get_deps): Delete function.
107 (transform_sections): Delete function.
108 (gfc_check_section_vs_section): Significant rewrite.
109
110 2006-04-04 H.J. Lu <hongjiu.lu@intel.com>
111
112 PR fortran/25619
113 * trans-array.c (gfc_conv_expr_descriptor): Only dereference
114 character pointer when copying temporary.
115
116 PR fortran/23634
117 * trans-array.c (gfc_conv_expr_descriptor): Properly copy
118 temporary character with non constant size.
119
120 2006-04-03 Paul Thomas <pault@gcc.gnu.org>
121
122 PR fortran/26891
123 * trans.h: Prototype for gfc_conv_missing_dummy.
124 * trans-expr (gfc_conv_missing_dummy): New function
125 (gfc_conv_function_call): Call it and tidy up some of the code.
126 * trans-intrinsic (gfc_conv_intrinsic_function_args): The same.
127
128 PR fortran/26976
129 * array.c (gfc_array_dimen_size): If available, return shape[dimen].
130 * resolve.c (resolve_function): If available, use the argument
131 shape for the function expression.
132 * iresolve.c (gfc_resolve_transfer): Set shape[0] = size.
133
134 2006-04-02 Erik Edelmann <eedelman@gcc.gnu.org>
135
136 * trans-array.c (gfc_trans_dealloc_allocated): Take a
137 tree representation of the array to be deallocated as argument
138 instead of its gfc_symbol.
139 (gfc_trans_deferred_array): Update call to
140 gfc_trans_dealloc_allocated.
141 * trans-array.h (gfc_trans_dealloc_allocated): Update
142 prototype.
143 * trans-expr.c (gfc_conv_function_call): Update call to
144 gfc_trans_dealloc_allocated, get indirect reference to dummy
145 arguments.
146
147 2006-04-01 Roger Sayle <roger@eyesopen.com>
148
149 PR fortran/25270
150 * trans-array.c (gfc_trans_allocate_array_storage): In array index
151 calculations use gfc_index_zero_node and gfc_index_one_node instead
152 of integer_zero_node and integer_one_node respectively.
153 (gfc_conv_array_transpose): Likewise.
154 (gfc_conv_ss_startstride): Likewise.
155 (gfc_trans_dummy_array_bias): Likewise.
156
157 2006-04-01 Roger Sayle <roger@eyesopen.com>
158
159 * dependency.c (gfc_is_inside_range): Delete.
160 (gfc_check_element_vs_section): Significant rewrite.
161
162 2006-04-01 Roger Sayle <roger@eyesopen.com>
163
164 * dependency.c (gfc_dep_compare_expr): Strip parentheses and unary
165 plus operators when comparing expressions. Handle comparisons of
166 the form "X+C vs. X", "X vs. X+C", "X-C vs. X" and "X vs. X-C" where
167 C is an integer constant. Handle comparisons of the form "P+Q vs.
168 R+S" and "P-Q vs. R-S". Handle comparisons of integral extensions
169 specially (increasing functions) so extend(A) > extend(B), when A>B.
170 (gfc_check_element_vs_element): Move test later, so that we ignore
171 the fact that "A < B" or "A > B" when A or B contains a forall index.
172
173 2006-03-31 Asher Langton <langton2@llnl.gov>
174
175 PR fortran/25358
176 * expr.c (gfc_check_assign): Allow cray pointee to be assumes-size.
177
178 2006-03-30 Paul Thomas <paulthomas2@wanadoo.fr>
179 Bud Davis <bdavis9659@sbcglobal.net>
180
181 PR 21130
182 * module.c (load_needed): Traverse entire tree before returning.
183
184 2006-03-30 Roger Sayle <roger@eyesopen.com>
185
186 PR middle-end/22375
187 * trans.c (gfc_trans_runtime_check): Promote the arguments of
188 __builtin_expect to the correct types, and the result back to
189 boolean_type_node.
190
191 2006-03-29 Carlos O'Donell <carlos@codesourcery.com>
192
193 * Make-lang.in: Rename docdir to gcc_docdir.
194
195 2006-03-28 Steven G. Kargl <kargls@comcast.net>
196
197 * intrinsic.texi: s/floor/float in previous commit.
198
199 2006-03-28 Paul Thomas <pault@gcc.gnu.org>
200
201 PR fortran/26779
202 * resolve.c (resolve_fl_procedure): Do not check the access of
203 derived types for internal procedures.
204
205 2006-03-27 Jakub Jelinek <jakub@redhat.com>
206
207 * io.c (check_io_constraints): Don't look at
208 dt->advance->value.charater.string, unless it is a CHARACTER
209 constant.
210
211 * f95-lang.c (gfc_get_alias_set): New function.
212 (LANG_HOOKS_GET_ALIAS_SET): Define.
213
214 2006-03-25 Steven G. Kargl <kargls@comcast.net>
215
216 PR fortran/26816
217 * intrinsic.c (add_functions): Allow FLOAT to accept all integer kinds.
218 * intrinsic.texi: Document FLOAT.
219
220 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>
221
222 PR fortran/26769
223 * iresolve.c (gfc_resolve_reshape): Remove doubling of
224 kind for complex. For real(kind=10), call reshape_r10.
225 (gfc_resolve_transpose): For real(kind=10), call
226 transpose_r10.
227
228 2006-03-25 Roger Sayle <roger@eyesopen.com>
229
230 * dependency.c (gfc_check_dependency): Improve handling of pointers;
231 Two variables of different types can't have a dependency, and two
232 variables with the same symbol are equal, even if pointers.
233
234 2006-03-24 Roger Sayle <roger@eyesopen.com>
235
236 * gfortran.h (gfc_symbol): Add a new "forall_index" bit field.
237 * match.c (match_forall_iterator): Set forall_index field on
238 the iteration variable's symbol.
239 * dependency.c (contains_forall_index_p): New function to
240 traverse a gfc_expr to check whether it contains a variable
241 with forall_index set in it's symbol.
242 (gfc_check_element_vs_element): Return GFC_DEP_EQUAL for scalar
243 constant expressions that don't variables used as FORALL indices.
244
245 2006-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
246
247 PR driver/22600
248 * error.c (gfc_fatal_error): Return ICE_EXIT_CODE instead of 4.
249
250 2006-03-22 Thomas Koenig <Thomas.Koenig@online.de>
251
252 PR fortran/19303
253 * gfortran.h (gfc_option_t): Add record_marker.
254 * lang.opt: Add -frecord-marker=4 and -frecord-marker=8.
255 * trans-decl.c: Add gfor_fndecl_set_record_marker.
256 (gfc_build_builtin_function_decls): Set
257 gfor_fndecl_set_record_marker.
258 (gfc_generate_function_code): If we are in the main program
259 and -frecord-marker was provided, call set_record_marker.
260 * options.c (gfc_handle_option): Add handling for
261 -frecord-marker=4 and -frecord-marker=8.
262 * invoke.texi: Document -frecord-marker.
263
264 2006-03-22 Paul Thomas <pault@gcc.gnu.org>
265
266 PR fortran/17298
267 * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): New
268 function to implement array valued TRANSFER intrinsic.
269 (gfc_conv_intrinsic_function): Call the new function if TRANSFER
270 and non-null se->ss.
271 (gfc_walk_intrinsic_function): Treat TRANSFER as one of the
272 special cases by calling gfc_walk_intrinsic_libfunc directly.
273
274 2006-03-21 Toon Moene <toon@moene.indiv.nluug.nl>
275
276 * options.c (gfc_init_options): Initialize
277 flag_argument_noalias to 3.
278
279 2006-03-20 Thomas Koenig <Thomas.Koenig@online.de>
280
281 PR fortran/20935
282 * iresolve.c (gfc_resolve_maxloc): If mask is scalar,
283 prefix the function name with an "s". If the mask is scalar
284 or if its kind is smaller than gfc_default_logical_kind,
285 coerce it to default kind.
286 (gfc_resolve_maxval): Likewise.
287 (gfc_resolve_minloc): Likewise.
288 (gfc_resolve_minval): Likewise.
289 (gfc_resolve_product): Likewise.
290 (gfc_resolve_sum): Likewise.
291
292 2006-03-19 Paul Thomas <pault@gcc.gnu.org>
293
294 PR fortran/26741
295 *expr.c (external_spec_function): Permit elemental functions.
296
297 PR fortran/26716
298 *interface.c (compare_actual_formal): Detect call for procedure
299 usage and require rank checking, in this case, for assumed shape
300 and deferred shape arrays.
301 (gfc_procedure_use): Revert to pre-PR25070 call to
302 compare_actual_formal that does not require rank checking..
303
304 2006-03-16 Roger Sayle <roger@eyesopen.com>
305
306 * gfortran.h (gfc_equiv_info): Add length field.
307 * trans-common.c (copy_equiv_list_to_ns): Set the length field.
308 * dependency.c (gfc_are_equivalenced_arrays): Use both the offset
309 and length fields to determine whether the two equivalenced symbols
310 overlap in memory.
311
312 2006-03-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
313
314 PR fortran/19101
315 * gfortran.h: Add warn_ampersand.
316 * invoke.texi: Add documentation for new option.
317 * lang.opt: Add Wampersand.
318 * options.c (gfc_init_options): Initialize warn_ampersand.
319 (gfc_post_options): Set the warn if pedantic.
320 (set_Wall): Set warn_ampersand.
321 (gfc_handle_option: Add Wampersand for itself, -std=f95, and -std=f2003.
322 * scanner.c (gfc_next_char_literal): Add test for missing '&' in
323 continued character constant and give warning if missing.
324
325 2006-03-14 Steven G. Kargl <kargls@comcast.net>
326
327 PR 18537
328 * gfortran.h: Wrap Copyright line.
329 (gfc_option_t): add warn_tabs member.
330 * lang.opt: Update Coyright year. Add the Wtabs.
331 * invoke.texi: Document -Wtabs.
332 * scanner.c (gfc_gobble_whitespace): Use warn_tabs. Add linenum to
333 suppress multiple warnings.
334 (load_line): Use warn_tabs. Add linenum, current_line, seen_comment
335 to suppress multiple warnings.
336 * options.c (gfc_init_options): Initialize warn_tabs.
337 (set_Wall): set warn_tabs for -Wall.
338 (gfc_post_options): Adjust flag_tabs depending on -pedantic.
339 (gfc_handle_option): Process command-line option -W[no-]tabs
340
341 2006-03-13 Paul Thomas <pault@gcc.gnu.org>
342
343 PR fortran/25378
344 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set the initial position to zero and
345 modify the condition for updating it, to implement the F2003 requirement for all(mask)
346 is false.
347
348 2006-03-13 Jakub Jelinek <jakub@redhat.com>
349
350 * trans-openmp.c (gfc_trans_omp_variable): Handle references
351 to parent result.
352 * trans-expr.c (gfc_conv_variable): Remove useless setting
353 of parent_flag, formatting.
354
355 * trans-decl.c (gfc_get_fake_result_decl): Re-add setting of
356 GFC_DECL_RESULT flag.
357
358 2003-03-11 Roger Sayle <roger@eyesopen.com>
359
360 * dependency.c (gfc_dep_compare_expr) <EXPR_OP>: Allow unary and
361 binary operators to compare equal if their operands are equal.
362 <EXPR_FUNCTION>: Allow "constant" intrinsic conversion functions
363 to compare equal, if their operands are equal.
364
365 2006-03-11 Erik Edelmann <eedelman@gcc.gnu.org>
366
367 * symbol.c (check_conflict): Allow allocatable function results,
368 except for elemental functions.
369 * trans-array.c (gfc_trans_allocate_temp_array): Rename to ...
370 (gfc_trans_create_temp_array): ... this, and add new argument
371 callee_alloc.
372 (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call
373 to gfc_trans_allocate_temp_array.
374 * trans-array.h (gfc_trans_allocate_temp_array): Update prototype.
375 * trans-expr.c (gfc_conv_function_call): Use new arg of
376 gfc_trans_create_temp_array avoid pre-allocation of temporary
377 result variables of pointer AND allocatable functions.
378 (gfc_trans_arrayfunc_assign): Return NULL for allocatable
379 functions.
380 * resolve.c (resolve_symbol): Copy value of 'allocatable' attribute
381 from sym->result to sym.
382
383 2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
384
385 * trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
386 attribute from sym to new_sym. Call build_fold_indirect_ref()
387 for allocatable arguments.
388
389 2006-03-09 Paul Thomas <pault@gcc.gnu.org>
390
391 PR fortran/26257
392 * trans-array.c (gfc_conv_expr_descriptor): Exclude calculation of
393 the offset and data when se->data_not_needed is set.
394 * trans.h: Include the data_not_need bit in gfc_se.
395 * trans-intrinsic.c (gfc_conv_intrinsic_size): Set it for SIZE.
396
397 2006-03-06 Paul Thomas <pault@gcc.gnu.org>
398 Erik Edelmann <eedelman@gcc.gnu.org>
399
400 * trans-array.c (gfc_trans_dealloc_allocated): New function.
401 (gfc_trans_deferred_array): Use it, instead of inline code.
402 * trans-array.h: Prototype for gfc_trans_dealloc_allocated().
403 * trans-expr.c (gfc_conv_function_call): Deallocate allocated
404 ALLOCATABLE, INTENT(OUT) arguments upon procedure entry.
405
406 2006-03-06 Paul Thomas <pault@gcc.gnu.org>
407
408 PR fortran/26107
409 * resolve.c (resolve_function): Add name after test for pureness.
410
411 PR fortran/19546
412 * trans-expr.c (gfc_conv_variable): Detect reference to parent result,
413 store current_function_decl, replace with parent, whilst calls are
414 made to gfc_get_fake_result_decl, and restore afterwards. Signal this
415 to gfc_get_fake_result_decl with a new argument, parent_flag.
416 * trans-stmt.c (gfc_trans_return): gfc_get_fake_result_decl 2nd arg
417 is set to zero.
418 * trans.h: Add parent_flag to gfc_get_fake_result_decl prototype.
419 * trans-decl.c (gfc_get_fake_result_decl): On parent_flag, being set,
420 add decl to parent function. Replace refs to current_fake_result_decl
421 with refs to this_result_decl.
422 (gfc_generate_function_code): Null parent_fake_result_decl before the
423 translation of code for contained procedures. Set parent_flag to zero
424 in call to gfc_get_fake_result_decl.
425 * trans-intrinsic.c (gfc_conv_intrinsic_len): The same.
426
427 2006-03-05 Steven G. Kargl <kargls@comcast.net>
428
429 * simplify.c (gfc_simplify_verify): Fix return when SET=''.
430
431 2006-03-05 Erik Edelmann <eedelman@gcc.gnu.org>
432
433 PR fortran/16136
434 * symbol.c (conf_std): New macro.
435 (check_conflict): Use it to allow ALLOCATABLE dummy
436 arguments for F2003.
437 * trans-expr.c (gfc_conv_function_call): Pass the
438 address of the array descriptor when dummy argument is
439 ALLOCATABLE.
440 * interface.c (compare_allocatable): New function.
441 (compare_actual_formal): Use it.
442 * resolve.c (resolve_deallocate_expr,
443 resolve_allocate_expr): Check that INTENT(IN) variables
444 aren't (de)allocated.
445 * gfortran.texi (Fortran 2003 status): List ALLOCATABLE
446 dummy arguments as supported.
447
448 2006-03-03 Roger Sayle <roger@eyesopen.com>
449
450 * dependency.c (gfc_check_element_vs_element): Revert last change.
451
452 2006-03-03 Roger Sayle <roger@eyesopen.com>
453
454 * dependency.c (gfc_check_element_vs_element): Consider two
455 unordered scalar subscripts as (potentially) equal.
456
457 2006-03-03 Roger Sayle <roger@eyesopen.com>
458
459 * dependency.c (gfc_check_dependency): Call gfc_dep_resolver to
460 check whether two array references have a dependency.
461 (gfc_check_element_vs_element): Assume lref and rref must be
462 REF_ARRAYs. If gfc_dep_compare_expr returns -2, assume these
463 references could potentially overlap.
464 (gfc_dep_resolver): Whitespace and comment tweaks. Assume a
465 dependency if the references have different depths. Rewrite
466 final term to clarrify we only have a dependency for overlaps.
467
468 2006-03-03 Thomas Koenig <Thomas.Koenig@online.de>
469
470 PR fortran/25031
471 * trans-array.h: Adjust gfc_array_allocate prototype.
472 * trans-array.c (gfc_array_allocate): Change type of
473 gfc_array_allocatate to bool. Function returns true if
474 it operates on an array. Change second argument to gfc_expr.
475 Find last reference in chain.
476 If the function operates on an allocatable array, emit call to
477 allocate_array() or allocate64_array().
478 * trans-stmt.c (gfc_trans_allocate): Code to follow to last
479 reference has been moved to gfc_array_allocate.
480 * trans.h: Add declaration for gfor_fndecl_allocate_array and
481 gfor_fndecl_allocate64_array.
482 (gfc_build_builtin_function_decls): Add gfor_fndecl_allocate_array
483 and gfor_fndecl_allocate64_array.
484
485 2006-03-01 Roger Sayle <roger@eyesopen.com>
486
487 * trans-stmt.c (generate_loop_for_temp_to_lhs): Add an additional
488 INVERT argument to invert the sense of the WHEREMASK argument.
489 Remove unneeded code to AND together a list of masks.
490 (generate_loop_for_rhs_to_temp): Likewise.
491 (gfc_trans_assign_need_temp): Likewise.
492 (gfc_trans_forall_1): Likewise.
493 (gfc_evaluate_where_mask): Likewise, add a new INVERT argument
494 to specify the sense of the MASK argument.
495 (gfc_trans_where_assign): Likewise.
496 (gfc_trans_where_2): Likewise. Restructure code that decides
497 whether we need to allocate zero, one or two temporary masks.
498 If this is a top-level WHERE (i.e. the incoming MASK is NULL),
499 we only need to allocate at most one temporary mask, and can
500 invert it's sense to provide the complementary pending execution
501 mask. Only calculate the size of the required temporary arrays
502 if we need any.
503 (gfc_trans_where): Update call to gfc_trans_where_2.
504
505 2006-03-01 Paul Thomas <pault@gcc.gnu.org>
506
507 * iresolve.c (gfc_resolve_dot_product): Remove any difference in
508 treatment of logical types.
509 * trans-intrinsic.c (gfc_conv_intrinsic_dot_product): New function.
510
511 PR fortran/26393
512 * trans-decl.c (gfc_get_symbol_decl): Extend condition that symbols
513 must be referenced to include unreferenced symbols in an interface
514 body.
515
516 PR fortran/20938
517 * trans-array.c (gfc_conv_resolve_dependencies): Add call to
518 gfc_are_equivalenced_arrays.
519 * symbol.c (gfc_free_equiv_infos, gfc_free_equiv_lists): New
520 functions. (gfc_free_namespace): Call them.
521 * trans-common.c (copy_equiv_list_to_ns): New function.
522 (add_equivalences): Call it.
523 * gfortran.h: Add equiv_lists to gfc_namespace and define
524 gfc_equiv_list and gfc_equiv_info.
525 * dependency.c (gfc_are_equivalenced_arrays): New function.
526 (gfc_check_dependency): Call it.
527 * dependency.h: Prototype for gfc_are_equivalenced_arrays.
528
529 2006-03-01 Roger Sayle <roger@eyesopen.com>
530
531 * dependency.c (gfc_is_same_range): Compare the stride, lower and
532 upper bounds when testing array reference ranges for equality.
533 (gfc_check_dependency): Fix indentation whitespace.
534 (gfc_check_element_vs_element): Likewise.
535 (gfc_dep_resolver): Likewise.
536
537 2006-02-28 Thomas Koenig <Thomas.Koenig@online.de>
538
539 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
540 If the mask expression exists and has rank 0, enclose the
541 generated loop in an "if (mask)". Put the default
542 initialization into the else branch.
543
544 2006-02-25 Thomas Koenig <Thomas.Koenig@online.de>
545
546 PR fortran/23092
547 * trans-intrinsic.c (gfc_conv_intrinsic_arith): If the
548 mask expression exists and has rank 0, enclose the generated
549 loop in an "if (mask)".
550 * (gfc_conv_intrinsic_minmaxloc): Likewise.
551
552 2006-02-24 Paul Thomas <pault@gcc.gnu.org>
553
554 PR fortran/26409
555 * resolve.c (resolve_contained_functions, resolve_types,
556 gfc_resolve): Revert patch of 2006-02-19.
557
558 2006-02-24 Paul Thomas <pault@gcc.gnu.org>
559
560 PR fortran/24519
561 * dependency.c (gfc_is_same_range): Correct typo.
562 (gfc_check_section_vs_section): Call gfc_is_same_range.
563
564 PR fortran/25395
565 * trans-common.c (add_equivalences): Add a new flag that is set when
566 an equivalence is seen that prevents more from being reset until the
567 start of a new traversal of the list, thus ensuring completion of
568 all the equivalences.
569
570 2006-02-23 Erik Edelmann <eedelman@gcc.gnu.org>
571
572 * module.c (read_module): Remove redundant code lines.
573
574 2006-02-20 Rafael \81Ávila de Esp\81índola <rafael.espindola@gmail.com>
575 * Make-lang.in (FORTRAN): Remove
576 (.PHONY): Remove F95 and f95. Add fortran
577
578 2006-02-20 Roger Sayle <roger@eyesopen.com>
579
580 * trans-stmt.c (gfc_trans_where_2): Avoid updating unused current
581 execution mask for empty WHERE/ELSEWHERE clauses. Don't allocate
582 temporary mask arrays if they won't be used.
583
584 2006-02-20 Roger Sayle <roger@eyesopen.com>
585
586 * trans-stmt.c (gfc_trans_where_assign): Remove code to handle
587 traversing a linked list of MASKs. The MASK is now always a
588 single element requiring no ANDing during the assignment.
589
590 2006-02-19 Thomas Koenig <Thomas.Koenig@online.de>
591
592 * gfortran.texi: Document environment variables which
593 influence runtime behavior.
594
595 2006-02-19 H.J. Lu <hongjiu.lu@intel.com>
596
597 * resolve.c (resolve_contained_functions): Call resolve_entries
598 first.
599 (resolve_types): Remove calls to resolve_entries and
600 resolve_contained_functions.
601 (gfc_resolve): Call resolve_contained_functions.
602
603 2006-02-19 Erik Edelmann <eedelman@gcc.gnu.org>
604
605 PR fortran/26201
606 * intrinsic.c (gfc_convert_type_warn): Call
607 gfc_intrinsic_symbol() on the newly created symbol.
608
609 2006-02-19 Paul Thomas <pault@gcc.gnu.org>
610
611 PR fortran/25054
612 * resolve.c (is_non_constant_shape_array): New function.
613 (resolve_fl_variable): Remove code for the new function and call it.
614 (resolve_fl_namelist): New function. Add test for namelist array
615 with non-constant shape, using is_non_constant_shape_array.
616 (resolve_symbol): Remove code for resolve_fl_namelist and call it.
617
618 PR fortran/25089
619 * match.c (match_namelist): Increment the refs field of an accepted
620 namelist object symbol.
621 * resolve.c (resolve_fl_namelist): Test namelist objects for a conflict
622 with contained or module procedures.
623
624 2006-02-18 Roger Sayle <roger@eyesopen.com>
625
626 * trans-stmt.c (struct temporary_list): Delete.
627 (gfc_trans_where_2): Major reorganization. Remove no longer needed
628 TEMP argument. Allocate and deallocate the control mask and
629 pending control mask locally.
630 (gfc_trans_forall_1): Delete TEMP local variable, and update
631 call to gfc_trans_where_2. No need to deallocate arrays after.
632 (gfc_evaluate_where_mask): Major reorganization. Change return
633 type to void. Pass in parent execution mask, MASK, and two
634 already allocated mask arrays CMASK and PMASK. On return
635 CMASK := MASK & COND, PMASK := MASK & !COND. MASK, CMASK and
636 CMASK may all be NULL, or refer to the same temporary arrays.
637 (gfc_trans_where): Update call to gfc_trans_where_2. We no
638 longer need a TEMP variable or to deallocate temporary arrays
639 allocated by gfc_trans_where_2.
640
641 2006-02-18 Danny Smith <dannysmith@users.sourceforeg.net>
642
643 * gfortran.h (gfc_add_attribute): Change uint to unsigned int.
644 * symbol.c (gfc_add_attribute): Likewise for definition.
645 * resolve.c (resolve_global_procedure): Likewise for variable 'type'.
646
647 2006-02-17 Richard Sandiford <richard@codesourcery.com>
648
649 * trans-common.c: Include rtl.h earlier.
650 * trans-decl.c: Likewise.
651
652 2006-02-16 Jakub Jelinek <jakub@redhat.com>
653
654 PR fortran/26224
655 * parse.c (parse_omp_do, parse_omp_structured_block): Call
656 gfc_commit_symbols and gfc_warning_check.
657
658 * openmp.c (resolve_omp_clauses): Add a dummy case label to workaround
659 PR middle-end/26316.
660
661 2006-02-16 Paul Thomas <pault@gcc.gnu.org>
662
663 PR fortran/24557
664 * trans-expr.c (gfc_add_interface_mapping): Use the actual argument
665 for character(*) arrays, rather than casting to the type and kind
666 parameters of the formal argument.
667
668 2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
669
670 PR fortran/26054
671 * options.c: Do not warn for Fortran 2003 features by default.
672
673 2006-02-15 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
674
675 * check.c: Update copyright years.
676
677 * check.c (gfc_check_minloc_maxloc, check_reduction): Don't call
678 dim_range_check on not-present optional dim argument.
679
680 2006-02-15 Jakub Jelinek <jakub@redhat.com>
681
682 PR libgomp/25938
683 PR libgomp/25984
684 * Make-lang.in (install-finclude-dir): New goal.
685 (fortran.install-common): Depend on install-finclude-dir.
686 * lang-specs.h: If not -nostdinc, add -I finclude.
687
688 2006-02-14 Thomas Koenig <Thomas.Koenig@online.de>
689
690 PR fortran/25045
691 * check.c (dim_check): Perform all checks if dim is optional.
692 (gfc_check_minloc_maxloc): Use dim_check and dim_rank_check
693 to check dim argument.
694 (check_reduction): Likewise.
695
696 2006-02-14 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
697
698 PR fortran/26277
699 * io.c (match_ltag): Mark label as referenced.
700
701 2006-02-14 Jakub Jelinek <jakub@redhat.com>
702 Richard Henderson <rth@redhat.com>
703 Diego Novillo <dnovillo@redhat.com>
704
705 * invoke.texi: Document -fopenmp.
706 * gfortran.texi (Extensions): Document OpenMP.
707
708 Backport from gomp-20050608-branch
709 * trans-openmp.c: Call build_omp_clause instead of
710 make_node when creating OMP_CLAUSE_* trees.
711 (gfc_trans_omp_reduction_list): Remove argument 'code'.
712 Adjust all callers.
713
714 * trans.h (build4_v): Define.
715 * trans-openmp.c: Call build4_v to create OMP_PARALLEL nodes.
716 Call build3_v to create OMP_SECTIONS nodes.
717
718 PR fortran/25162
719 * openmp.c (gfc_match_omp_variable_list): Call gfc_set_sym_referenced
720 on all symbols added to the variable list.
721
722 * openmp.c (gfc_match_omp_clauses): Fix check for non-INTRINSIC
723 procedure symbol in REDUCTION.
724
725 * trans-openmp.c (gfc_trans_omp_array_reduction): Use gfc_add
726 for MINUS_EXPR OMP_CLAUSE_REDUCTION_CODE.
727
728 * trans-openmp.c (gfc_trans_omp_do): Add PBLOCK argument. If PBLOCK
729 is non-NULL, evaluate INIT/COND/INCR and chunk size expressions in
730 that statement block.
731 (gfc_trans_omp_parallel_do): Pass non-NULL PBLOCK to gfc_trans_omp_do
732 for non-ordered non-static combined loops.
733 (gfc_trans_omp_directive): Pass NULL PBLOCK to gfc_trans_omp_do.
734
735 * openmp.c: Include target.h and toplev.h.
736 (gfc_match_omp_threadprivate): Emit diagnostic if target does
737 not support TLS.
738 * Make-lang.in (fortran/openmp.o): Add dependencies on
739 target.h and toplev.h.
740
741 * trans-decl.c (gfc_get_fake_result_decl): Set GFC_DECL_RESULT.
742 * trans-openmp.c (gfc_omp_privatize_by_reference): Make
743 DECL_ARTIFICIAL vars predetermined shared except GFC_DECL_RESULT.
744 (gfc_omp_disregard_value_expr): Handle GFC_DECL_RESULT.
745 (gfc_trans_omp_variable): New function.
746 (gfc_trans_omp_variable_list, gfc_trans_omp_reduction_list): Use it.
747 * trans.h (GFC_DECL_RESULT): Define.
748
749 * trans-openmp.c (gfc_omp_firstprivatize_type_sizes): New function.
750 * f95-lang.c (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
751 * trans.h (gfc_omp_firstprivatize_type_sizes): New prototype.
752
753 * trans-openmp.c (gfc_omp_privatize_by_reference): Return
754 true if a pointer has GFC_DECL_SAVED_DESCRIPTOR set.
755 (gfc_trans_omp_array_reduction, gfc_trans_omp_reduction_list): New
756 functions.
757 (gfc_trans_omp_clauses): Add WHERE argument. Call
758 gfc_trans_omp_reduction_list rather than gfc_trans_omp_variable_list
759 for reductions.
760 (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
761 gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
762 gfc_trans_omp_sections, gfc_trans_omp_single): Adjust
763 gfc_trans_omp_clauses callers.
764
765 * openmp.c (omp_current_do_code): New var.
766 (gfc_resolve_omp_do_blocks): New function.
767 (gfc_resolve_omp_parallel_blocks): Call it.
768 (gfc_resolve_do_iterator): Add CODE argument. Don't propagate
769 predetermination if argument is !$omp do or !$omp parallel do
770 iteration variable.
771 * resolve.c (resolve_code): Call gfc_resolve_omp_do_blocks
772 for EXEC_OMP_DO. Adjust gfc_resolve_do_iterator caller.
773 * fortran.h (gfc_resolve_omp_do_blocks): New prototype.
774 (gfc_resolve_do_iterator): Add CODE argument.
775
776 * trans.h (gfc_omp_predetermined_sharing,
777 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
778 prototypes.
779 (GFC_DECL_COMMON_OR_EQUIV, GFC_DECL_CRAY_POINTEE): Define.
780 * trans-openmp.c (gfc_omp_predetermined_sharing,
781 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
782 functions.
783 * trans-common.c (build_equiv_decl, build_common_decl,
784 create_common): Set GFC_DECL_COMMON_OR_EQUIV flag on the decls.
785 * trans-decl.c (gfc_finish_cray_pointee): Set GFC_DECL_CRAY_POINTEE
786 on the decl.
787 * f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_SHARING,
788 LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
789 LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE): Define.
790
791 * openmp.c (resolve_omp_clauses): Remove extraneous comma.
792
793 * symbol.c (check_conflict): Add conflict between cray_pointee and
794 threadprivate.
795 * openmp.c (gfc_match_omp_threadprivate): Fail if
796 gfc_add_threadprivate returned FAILURE.
797 (resolve_omp_clauses): Diagnose Cray pointees in SHARED,
798 {,FIRST,LAST}PRIVATE and REDUCTION clauses and Cray pointers in
799 {FIRST,LAST}PRIVATE and REDUCTION clauses.
800
801 * resolve.c (omp_workshare_flag): New variable.
802 (resolve_function): Diagnose use of non-ELEMENTAL user defined
803 function in WORKSHARE construct.
804 (resolve_code): Cleanup forall_save use. Make sure omp_workshare_flag
805 is set to correct value in different contexts.
806
807 * openmp.c (resolve_omp_clauses): Replace %s with '%s' when printing
808 variable name.
809 (resolve_omp_atomic): Likewise.
810
811 PR fortran/24493
812 * scanner.c (skip_free_comments): Set at_bol at the beginning of the
813 loop, not before it.
814 (skip_fixed_comments): Handle ! comments in the middle of line here
815 as well.
816 (gfc_skip_comments): Use skip_fixed_comments for FIXED_FORM even if
817 not at BOL.
818 (gfc_next_char_literal): Fix expected canonicalized *$omp string.
819
820 * trans-openmp.c (gfc_trans_omp_do): Use make_node and explicit
821 initialization to build OMP_FOR instead of build.
822
823 * trans-decl.c (gfc_gimplify_function): Invoke
824 diagnose_omp_structured_block_errors.
825
826 * trans-openmp.c (gfc_trans_omp_master): Use OMP_MASTER.
827 (gfc_trans_omp_ordered): Use OMP_ORDERED.
828
829 * gfortran.h (gfc_resolve_do_iterator, gfc_resolve_blocks,
830 gfc_resolve_omp_parallel_blocks): New prototypes.
831 * resolve.c (resolve_blocks): Renamed to...
832 (gfc_resolve_blocks): ... this. Remove static.
833 (gfc_resolve_forall): Adjust caller.
834 (resolve_code): Only call gfc_resolve_blocks if code->block != 0
835 and not for EXEC_OMP_PARALLEL* directives. Call
836 gfc_resolve_omp_parallel_blocks for EXEC_OMP_PARALLEL* directives.
837 Call gfc_resolve_do_iterator if resolved successfully EXEC_DO
838 iterator.
839 * openmp.c: Include pointer-set.h.
840 (omp_current_ctx): New variable.
841 (gfc_resolve_omp_parallel_blocks, gfc_resolve_do_iterator): New
842 functions.
843 * Make-lang.in (fortran/openmp.o): Depend on pointer-set.h.
844
845 * openmp.c (gfc_match_omp_clauses): For max/min/iand/ior/ieor,
846 look up symbol if it exists, use its name instead and, if it is not
847 INTRINSIC, issue diagnostics.
848
849 * parse.c (parse_omp_do): Handle implied end do properly.
850 (parse_executable): If parse_omp_do returned ST_IMPLIED_ENDDO,
851 return it instead of continuing.
852
853 * trans-openmp.c (gfc_trans_omp_critical): Update for changed
854 operand numbering.
855 (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
856 gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
857 gfc_trans_omp_sections, gfc_trans_omp_single): Likewise.
858
859 * trans.h (gfc_omp_privatize_by_reference): New prototype.
860 * f95-lang.c (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Redefine
861 to gfc_omp_privatize_by_reference.
862 * trans-openmp.c (gfc_omp_privatize_by_reference): New function.
863
864 * trans-stmt.h (gfc_trans_omp_directive): Add comment.
865
866 * openmp.c (gfc_match_omp_variable_list): Add ALLOW_COMMON argument.
867 Disallow COMMON matching if it is set.
868 (gfc_match_omp_clauses, gfc_match_omp_flush): Adjust all callers.
869 (resolve_omp_clauses): Show locus in error messages. Check that
870 variable types in reduction clauses are appropriate for reduction
871 operators.
872
873 * resolve.c (resolve_symbol): Don't error if a threadprivate module
874 variable isn't SAVEd.
875
876 * trans-openmp.c (gfc_trans_omp_do): Put count into BLOCK, not BODY.
877 Fix typo in condition. Fix DOVAR initialization.
878
879 * openmp.c (gfc_match_omp_clauses): Match min/iand/ior/ieor
880 rather than .min. etc.
881
882 * trans-openmpc.c (omp_not_yet): Remove.
883 (gfc_trans_omp_parallel_do): Keep listprivate clause on parallel.
884 Force creation of BIND_EXPR around the workshare construct.
885 (gfc_trans_omp_parallel_sections): Likewise.
886 (gfc_trans_omp_parallel_workshare): Likewise.
887
888 * types.def (BT_I16, BT_FN_I16_VPTR_I16,
889 BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
890
891 * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_DEFAULT.
892 (gfc_trans_omp_code): New function.
893 (gfc_trans_omp_do): Use it, remove omp_not_yet uses.
894 (gfc_trans_omp_parallel, gfc_trans_omp_single): Likewise.
895 (gfc_trans_omp_sections): Likewise. Only treat empty last section
896 specially if lastprivate clause is present.
897 * f95-lang.c (gfc_init_builtin_functions): Create BUILT_IN_TRAP
898 builtin.
899
900 * trans-openmp.c (gfc_trans_omp_variable_list): Update for
901 OMP_CLAUSE_DECL name change.
902 (gfc_trans_omp_do): Likewise.
903
904 * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_REDUCTION
905 clauses.
906 (gfc_trans_omp_atomic): Build OMP_ATOMIC instead of expanding
907 sync builtins directly.
908 (gfc_trans_omp_single): Build OMP_SINGLE statement.
909
910 * trans-openmp.c (gfc_trans_add_clause): New.
911 (gfc_trans_omp_variable_list): Take a tree code and build the clause
912 node here. Link it to the head of a list.
913 (gfc_trans_omp_clauses): Update to match.
914 (gfc_trans_omp_do): Use gfc_trans_add_clause.
915
916 * trans-openmp.c (gfc_trans_omp_clauses): Change second argument to
917 gfc_omp_clauses *. Use gfc_evaluate_now instead of creating
918 temporaries by hand.
919 (gfc_trans_omp_atomic, gfc_trans_omp_critical): Use buildN_v macros.
920 (gfc_trans_omp_do): New function.
921 (gfc_trans_omp_master): Dont' check for gfc_trans_code returning NULL.
922 (gfc_trans_omp_parallel): Adjust gfc_trans_omp_clauses caller.
923 Use buildN_v macros.
924 (gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_sections,
925 gfc_trans_omp_parallel_workshare, gfc_trans_omp_sections,
926 gfc_trans_omp_single, gfc_trans_omp_workshare): New functions.
927 (gfc_trans_omp_directive): Use them.
928 * parse.c (parse_omp_do): Allow new_st.op == EXEC_NOP.
929 * openmp.c (resolve_omp_clauses): Check for list items present
930 in multiple clauses.
931 (resolve_omp_do): Check that iteration variable is not THREADPRIVATE
932 and is not present in any clause variable lists other than PRIVATE
933 or LASTPRIVATE.
934
935 * gfortran.h (symbol_attribute): Add threadprivate bit.
936 (gfc_common_head): Add threadprivate member, change use_assoc
937 and saved into char to save space.
938 (gfc_add_threadprivate): New prototype.
939 * symbol.c (check_conflict): Handle threadprivate.
940 (gfc_add_threadprivate): New function.
941 (gfc_copy_attr): Copy threadprivate.
942 * trans-openmp.c (gfc_trans_omp_clauses): Avoid creating a temporary
943 if IF or NUM_THREADS is constant. Create OMP_CLAUSE_SCHEDULE and
944 OMP_CLAUSE_ORDERED.
945 * resolve.c (resolve_symbol): Complain if a THREADPRIVATE symbol
946 outside a module and not in COMMON has is not SAVEd.
947 (resolve_equivalence): Ensure THREADPRIVATE objects don't get
948 EQUIVALENCEd.
949 * trans-common.c: Include target.h and rtl.h.
950 (build_common_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
951 * trans-decl.c: Include rtl.h.
952 (gfc_finish_var_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
953 * dump-parse-tree.c (gfc_show_attr): Handle THREADPRIVATE.
954 * Make-lang.in (fortran/trans-decl.o): Depend on $(RTL_H).
955 (fortran/trans-common.o): Depend on $(RTL_H) and $(TARGET_H).
956 * openmp.c (gfc_match_omp_variable_list): Ensure COMMON block
957 is from current namespace.
958 (gfc_match_omp_threadprivate): Rewrite.
959 (resolve_omp_clauses): Check some clause restrictions.
960 * module.c (ab_attribute): Add AB_THREADPRIVATE.
961 (attr_bits): Add THREADPRIVATE.
962 (mio_symbol_attribute, mio_symbol_attribute): Handle threadprivate.
963 (load_commons, write_common, write_blank_common): Adjust for type
964 change of saved, store/load threadprivate bit from the integer
965 as well.
966
967 * types.def (BT_FN_UINT_UINT): New.
968 (BT_FN_VOID_UINT_UINT): Remove.
969
970 * trans-openmp.c (gfc_trans_omp_clauses, gfc_trans_omp_barrier,
971 gfc_trans_omp_critical, gfc_trans_omp_flush, gfc_trans_omp_master,
972 gfc_trans_omp_ordered, gfc_trans_omp_parallel): New functions.
973 (gfc_trans_omp_directive): Use them.
974
975 * openmp.c (expr_references_sym): Add SE argument, don't look
976 into SE tree.
977 (is_conversion): New function.
978 (resolve_omp_atomic): Adjust expr_references_sym callers. Handle
979 promoted expressions.
980 * trans-openmp.c (gfc_trans_omp_atomic): New function.
981 (gfc_trans_omp_directive): Call it.
982
983 * f95-lang.c (builtin_type_for_size): New function.
984 (gfc_init_builtin_functions): Initialize synchronization and
985 OpenMP builtins.
986 * types.def: New file.
987 * Make-lang.in (f95-lang.o): Depend on $(BUILTINS_DEF) and
988 fortran/types.def.
989
990 * trans-openmp.c: Rename GOMP_* tree codes into OMP_*.
991
992 * dump-parse-tree.c (show_symtree): Don't crash if ns->proc_name
993 is NULL.
994
995 * dump-parse-tree.c (gfc_show_namelist, gfc_show_omp_node): New
996 functions.
997 (gfc_show_code_node): Call gfc_show_omp_node for EXEC_OMP_* nodes.
998
999 * parse.c (parse_omp_do): Call pop_state before next_statement.
1000 * openmp.c (expr_references_sym, resolve_omp_atomic, resolve_omp_do):
1001 New functions.
1002 (gfc_resolve_omp_directive): Call them.
1003 * match.c (match_exit_cycle): Issue error if EXIT or CYCLE statement
1004 leaves an OpenMP structured block or if EXIT terminates !$omp do
1005 loop.
1006
1007 * Make-lang.in (F95_PARSER_OBJS): Add fortran/openmp.o.
1008 (F95_OBJS): Add fortran/trans-openmp.o.
1009 (fortran/trans-openmp.o): Depend on $(GFORTRAN_TRANS_DEPS).
1010 * lang.opt: Add -fopenmp option.
1011 * options.c (gfc_init_options): Initialize it.
1012 (gfc_handle_option): Handle it.
1013 * gfortran.h (ST_OMP_ATOMIC, ST_OMP_BARRIER, ST_OMP_CRITICAL,
1014 ST_OMP_END_CRITICAL, ST_OMP_END_DO, ST_OMP_END_MASTER,
1015 ST_OMP_END_ORDERED, ST_OMP_END_PARALLEL, ST_OMP_END_PARALLEL_DO,
1016 ST_OMP_END_PARALLEL_SECTIONS, ST_OMP_END_PARALLEL_WORKSHARE,
1017 ST_OMP_END_SECTIONS, ST_OMP_END_SINGLE, ST_OMP_END_WORKSHARE,
1018 ST_OMP_DO, ST_OMP_FLUSH, ST_OMP_MASTER, ST_OMP_ORDERED,
1019 ST_OMP_PARALLEL, ST_OMP_PARALLEL_DO, ST_OMP_PARALLEL_SECTIONS,
1020 ST_OMP_PARALLEL_WORKSHARE, ST_OMP_SECTIONS, ST_OMP_SECTION,
1021 ST_OMP_SINGLE, ST_OMP_THREADPRIVATE, ST_OMP_WORKSHARE): New
1022 statement codes.
1023 (OMP_LIST_PRIVATE, OMP_LIST_FIRSTPRIVATE, OMP_LIST_LASTPRIVATE,
1024 OMP_LIST_COPYPRIVATE, OMP_LIST_SHARED, OMP_LIST_COPYIN,
1025 OMP_LIST_PLUS, OMP_LIST_REDUCTION_FIRST, OMP_LIST_MULT,
1026 OMP_LIST_SUB, OMP_LIST_AND, OMP_LIST_OR, OMP_LIST_EQV,
1027 OMP_LIST_NEQV, OMP_LIST_MAX, OMP_LIST_MIN, OMP_LIST_IAND,
1028 OMP_LIST_IOR, OMP_LIST_IEOR, OMP_LIST_REDUCTION_LAST, OMP_LIST_NUM):
1029 New OpenMP variable list types.
1030 (gfc_omp_clauses): New typedef.
1031 (gfc_get_omp_clauses): Define.
1032 (EXEC_OMP_CRITICAL, EXEC_OMP_DO, EXEC_OMP_FLUSH, EXEC_OMP_MASTER,
1033 EXEC_OMP_ORDERED, EXEC_OMP_PARALLEL, EXEC_OMP_PARALLEL_DO,
1034 EXEC_OMP_PARALLEL_SECTIONS, EXEC_OMP_PARALLEL_WORKSHARE,
1035 EXEC_OMP_SECTIONS, EXEC_OMP_SINGLE, EXEC_OMP_WORKSHARE,
1036 EXEC_OMP_ATOMIC, EXEC_OMP_BARRIER, EXEC_OMP_END_NOWAIT,
1037 EXEC_OMP_END_SINGLE): New OpenMP gfc_exec_op codes.
1038 (struct gfc_code): Add omp_clauses, omp_name, omp_namelist
1039 and omp_bool fields to ext union.
1040 (flag_openmp): Declare.
1041 (gfc_free_omp_clauses, gfc_resolve_omp_directive): New prototypes.
1042 * scanner.c (openmp_flag, openmp_locus): New variables.
1043 (skip_free_comments, skip_fixed_comments, gfc_next_char_literal):
1044 Handle OpenMP directive lines and conditional compilation magic
1045 comments.
1046 * parse.h (COMP_OMP_STRUCTURED_BLOCK): New compile state.
1047 * parse.c (decode_omp_directive, parse_omp_do, parse_omp_atomic,
1048 parse_omp_structured_block): New functions.
1049 (next_free, next_fixed): Parse OpenMP directives.
1050 (case_executable, case_exec_markers, case_decl): Add ST_OMP_*
1051 codes.
1052 (gfc_ascii_statement): Handle ST_OMP_* codes.
1053 (parse_executable): Rearrange the loop slightly, so that
1054 parse_omp_do can return next_statement.
1055 * match.h (gfc_match_omp_eos, gfc_match_omp_atomic,
1056 gfc_match_omp_barrier, gfc_match_omp_critical, gfc_match_omp_do,
1057 gfc_match_omp_flush, gfc_match_omp_master, gfc_match_omp_ordered,
1058 gfc_match_omp_parallel, gfc_match_omp_parallel_do,
1059 gfc_match_omp_parallel_sections, gfc_match_omp_parallel_workshare,
1060 gfc_match_omp_sections, gfc_match_omp_single,
1061 gfc_match_omp_threadprivate, gfc_match_omp_workshare,
1062 gfc_match_omp_end_nowait, gfc_match_omp_end_single): New prototypes.
1063 * resolve.c (resolve_blocks): Ignore EXEC_OMP_* block directives.
1064 (resolve_code): Call gfc_resolve_omp_directive on EXEC_OMP_*
1065 directives.
1066 * trans.c (gfc_trans_code): Call gfc_trans_omp_directive for
1067 EXEC_OMP_* directives.
1068 * st.c (gfc_free_statement): Handle EXEC_OMP_* statement freeing.
1069 * trans-stmt.h (gfc_trans_omp_directive): New prototype.
1070 * openmp.c: New file.
1071 * trans-openmp.c: New file.
1072
1073 2006-02-13 Andrew Pinski <pinskia@physics.uc.edu>
1074 Jakub Jelinek <jakub@redhat.com>
1075
1076 PR fortran/26246
1077 * trans-decl.c (gfc_get_symbol_decl, gfc_get_fake_result_decl): Use
1078 gfc_add_decl_to_function rather than gfc_finish_var_decl on length.
1079
1080 2006-02-13 Paul Thomas <pault@gcc.gnu.org>
1081
1082 PR fortran/26074
1083 PR fortran/25103
1084 * resolve.c (resolve_symbol): Extend the requirement that module
1085 arrays have constant bounds to those in the main program. At the
1086 same time simplify the array bounds, to avoiding trapping parameter
1087 array references, and exclude automatic character length from main
1088 and modules. Rearrange resolve_symbol and resolve_derived to put as
1089 each flavor together, as much as is possible and move all specific
1090 code for flavors FL_VARIABLE, FL_PROCEDURE and FL_PARAMETER into new
1091 functions.
1092 (resolve_fl_var_and_proc, resolve_fl_variable, resolve_fl_procedure):
1093 New functions to do work of resolve_symbol.
1094 (resolve_index_expr): New function that is called from resolved_symbol
1095 and is extracted from resolve_charlen.
1096 (resolve_charlen): Call this new function.
1097 (resolve_fl_derived): Renamed resolve_derived to be consistent with
1098 the naming of the new functions for the other flavours. Change the
1099 charlen checking so that the style is consistent with other similar
1100 checks. Add the generation of the gfc_dt_list, removed from resolve_
1101 symbol.
1102
1103 PR fortran/20861
1104 * resolve.c (resolve_actual_arglist): Prevent internal procedures
1105 from being dummy arguments.
1106
1107 PR fortran/20871
1108 * resolve.c (resolve_actual_arglist): Prevent pure but non-intrinsic
1109 procedures from being dummy arguments.
1110
1111 PR fortran/25083
1112 * resolve.c (check_data_variable): Add test that data variable is in
1113 COMMON.
1114
1115 PR fortran/25088
1116 * resolve.c (resolve_call): Add test that the subroutine does not
1117 have a type.
1118
1119 2006-02-12 Erik Edelmann <eedelman@gcc.gnu.org>
1120
1121 PR fortran/25806
1122 * trans-array.c (gfc_trans_allocate_array_storage): New argument
1123 dealloc; free the temporary only if dealloc is true.
1124 (gfc_trans_allocate_temp_array): New argument bool dealloc, to be
1125 passed onwards to gfc_trans_allocate_array_storage.
1126 (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
1127 gfc_trans_allocate_temp_array.
1128 * trans-array.h (gfc_trans_allocate_temp_array): Update function
1129 prototype.
1130 * trans-expr.c (gfc_conv_function_call): Set new argument 'dealloc'
1131 to gfc_trans_allocate_temp_array to false in case of functions
1132 returning pointers.
1133 (gfc_trans_arrayfunc_assign): Return NULL for functions returning
1134 pointers.
1135
1136 2006-02-10 Steven G. Kargl <kargls@comcast.net>
1137
1138 PR fortran/20858
1139 *decl.c (variable_decl): Improve error message. Remove initialization
1140 typespec. Wrap long line.
1141 *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type,
1142 and rank.
1143 *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank
1144 are set.
1145
1146
1147 2006-02-10 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
1148
1149 PR fortran/14771
1150 * arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES.
1151 * expr.c (check_intrinsic_op): Likewise.
1152 * module.c (mio_expr): Likewise.
1153
1154 2006-02-09 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
1155
1156 * dump-parse-tree.c: Update copyright years.
1157 * matchexp.c: Likewise.
1158 * module.c: Likewise.
1159
1160 PR fortran/14771
1161 * gfortran.h (gfc_intrinsic_op): Add INTRINSIC_PARENTHESES.
1162 * dump-parse-tree (gfc_show_expr): Handle INTRINSIC_PARENTHESES.
1163 * expr.c (simplify_intrinsic_op): Treat INTRINSIC_PARENTHESES as
1164 if it were INTRINSIC_UPLUS.
1165 * resolve.c (resolve_operator): Handle INTRINSIC_PARENTHESES.
1166 * match.c (intrinsic_operators): Add INTRINSIC_PARENTHESES.
1167 * matchexp.c (match_primary): Record parentheses surrounding
1168 numeric expressions.
1169 * module.c (intrinsics): Add INTRINSIC_PARENTHESES for module
1170 dumping.
1171 * trans-expr.c (gfc_conv_expr_op): Handle INTRINSIC_PARENTHESES.
1172
1173 2006-02-09 Paul Thomas <pault@gcc.gnu.org>
1174
1175 PR fortran/26038
1176 * trans-stmt.c (gfc_trans_allocate): Provide assumed character length
1177 scalar with missing backend_decl for the hidden dummy charlen.
1178
1179 PR fortran/25059
1180 * interface.c (gfc_extend_assign): Remove detection of non-PURE
1181 subroutine in assignment interface, with gfc_error, and put it in
1182 * resolve.c (resolve_code).
1183
1184 PR fortran/25070
1185 * interface.c (gfc_procedure_use): Flag rank checking for non-
1186 elemental, contained or interface procedures in call to
1187 (compare_actual_formal), where ranks are checked for assumed
1188 shape arrays..
1189
1190 2006-02-08 Francois-Xavier Coudert <coudert@clipper.ens.fr>
1191
1192 PR libfortran/25425
1193 * trans-decl.c (gfc_generate_function_code): Add new argument,
1194 pedantic, to set_std call.
1195
1196 2006-02-06 Thomas Koenig <Thomas.Koenig@online.de>
1197
1198 PR libfortran/23815
1199 * gfortran.texi: Document the GFORTRAN_CONVERT_UNIT environment
1200 variable.
1201 * invoke.texi: Mention the "Runtime" chapter.
1202 Document the -fconvert= option.
1203 * gfortran.h: Add options_convert.
1204 * lang.opt: Add fconvert=little-endian, fconvert=big-endian,
1205 fconvert=native and fconvert=swap.
1206 * trans-decl.c (top level): Add gfor_fndecl_set_convert.
1207 (gfc_build_builtin_function_decls): Set gfor_fndecl_set_convert.
1208 (gfc_generate_function_code): If -fconvert was specified,
1209 and this is the main program, add a call to set_convert().
1210 * options.c: Handle the -fconvert options.
1211
1212 2006-02-06 Roger Sayle <roger@eyesopen.com>
1213
1214 * trans-stmt.c (gfc_evaluate_where_mask): Allow the NMASK argument
1215 to be NULL to indicate that the not mask isn't required.
1216 (gfc_trans_where_2): Remove PMASK argument. Avoid calculating the
1217 pending mask for the last clause of a WHERE chain. Update recursive
1218 call.
1219 (gfc_trans_forall_1): Update call to gfc_trans_where_2.
1220 (gfc_trans_where): Likewise.
1221
1222 2006-02-06 Jakub Jelinek <jakub@redhat.com>
1223
1224 Backport from gomp-20050608-branch
1225 * trans-decl.c (create_function_arglist): Handle dummy functions.
1226
1227 * trans-decl.c (gfc_get_symbol_decl): Revert explicit setting of
1228 TYPE_SIZE_UNIT.
1229 (gfc_trans_vla_type_sizes): Also "gimplify"
1230 GFC_TYPE_ARRAY_DATAPTR_TYPE for GFC_DESCRIPTOR_TYPE_P types.
1231 * trans-array.c (gfc_trans_deferred_array): Call
1232 gfc_trans_vla_type_sizes.
1233
1234 * trans-decl.c (saved_function_decls, saved_parent_function_decls):
1235 Remove unnecessary initialization.
1236 (create_function_arglist): Make sure __result has complete type.
1237 (gfc_get_fake_result_decl): Change current_fake_result_decl into
1238 a tree chain. For entry master, create a separate variable
1239 for each result name. For BT_CHARACTER results, call
1240 gfc_finish_var_decl on length even if it has been already created,
1241 but not pushdecl'ed.
1242 (gfc_trans_vla_type_sizes): For function/entry result, adjust
1243 result value type, not the FUNCTION_TYPE.
1244 (gfc_generate_function_code): Adjust for current_fake_result_decl
1245 changes.
1246 (gfc_trans_deferred_vars): Likewise. Call gfc_trans_vla_type_sizes
1247 even on result if it is assumed-length character.
1248
1249 * trans-decl.c (gfc_trans_dummy_character): Add SYM argument.
1250 Call gfc_trans_vla_type_sizes.
1251 (gfc_trans_auto_character_variable): Call gfc_trans_vla_type_sizes.
1252 (gfc_trans_vla_one_sizepos, gfc_trans_vla_type_sizes_1,
1253 gfc_trans_vla_type_sizes): New functions.
1254 (gfc_trans_deferred_vars): Adjust gfc_trans_dummy_character
1255 callers. Call gfc_trans_vla_type_sizes on assumed-length
1256 character parameters.
1257 * trans-array.c (gfc_trans_array_bounds,
1258 gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias): Call
1259 gfc_trans_vla_type_sizes.
1260 * trans.h (gfc_trans_vla_type_sizes): New prototype.
1261
1262 * trans-decl.c (gfc_build_qualified_array): For non-assumed-size
1263 arrays without constant size, create also an index var for
1264 GFC_TYPE_ARRAY_SIZE (type). If the type is incomplete, complete
1265 it as 0..size-1.
1266 (gfc_create_string_length): Don't call gfc_defer_symbol_init
1267 if just creating DECL_ARGUMENTS.
1268 (gfc_get_symbol_decl): Call gfc_finish_var_decl and
1269 gfc_defer_symbol_init even if ts.cl->backend_decl is already
1270 set to a VAR_DECL that doesn't have DECL_CONTEXT yet.
1271 (create_function_arglist): Rework, so that hidden length
1272 arguments for CHARACTER parameters are created together with
1273 the parameters. Resolve ts.cl->backend_decl for CHARACTER
1274 parameters. If the argument is a non-constant length array
1275 or CHARACTER, ensure PARM_DECL has different type than
1276 its DECL_ARG_TYPE.
1277 (generate_local_decl): Call gfc_get_symbol_decl even
1278 for non-referenced non-constant length CHARACTER parameters
1279 after optionally issuing warnings.
1280 * trans-array.c (gfc_trans_array_bounds): Set last stride
1281 to GFC_TYPE_ARRAY_SIZE (type) to initialize it as well.
1282 (gfc_trans_dummy_array_bias): Initialize GFC_TYPE_ARRAY_SIZE (type)
1283 variable as well.
1284
1285 * trans-expr.c (gfc_conv_expr_val): Fix comment typo.
1286
1287 * trans-stmt.c (gfc_trans_simple_do): Fix comment.
1288
1289 2006-02-04 Roger Sayle <roger@eyesopen.com>
1290
1291 * dependency.c (gfc_check_dependency): Remove unused vars and nvars
1292 arguments. Replace with an "identical" argument. A full array
1293 reference to the same symbol is a dependency if identical is true.
1294 * dependency.h (gfc_check_dependency): Update prototype.
1295 * trans-array.h (gfc_check_dependency): Delete duplicate prototype.
1296 * trans-stmt.c: #include dependency.h for gfc_check_dependency.
1297 (gfc_trans_forall_1): Update calls to gfc_check_dependency.
1298 (gfc_trans_where_2): Likewise. Remove unneeded variables.
1299 (gfc_trans_where_3): New function for simple non-dependent WHEREs.
1300 (gfc_trans_where): Call gfc_trans_where_3 to translate simple
1301 F90-style WHERE statements without internal dependencies.
1302 * Make-lang.in (trans-stmt.o): Depend upon dependency.h.
1303
1304 2006-02-05 H.J. Lu <hongjiu.lu@intel.com>
1305
1306 PR fortran/26041
1307 PR fortran/26064
1308 * resolve.c (resolve_types): New function.
1309 (resolve_codes): Likewise.
1310 (gfc_resolve): Use them.
1311
1312 2006-02-05 Roger Sayle <roger@eyesopen.com>
1313
1314 * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE
1315 masks instead of LOGICAL*4.
1316
1317 2006-02-05 Jakub Jelinek <jakub@redhat.com>
1318
1319 * resolve.c (resolve_symbol): Initialize constructor_expr to NULL.
1320
1321 2006-02-04 Thomas Koenig <Thomas.Koenig@online.de>
1322
1323 PR fortran/25075
1324 check.c (identical_dimen_shape): New function.
1325 (check_dot_product): Use identical_dimen_shape() to check sizes
1326 for dot_product.
1327 (gfc_check_matmul): Likewise.
1328 (gfc_check_merge): Check conformance between tsource and fsource
1329 and between tsource and mask.
1330 (gfc_check_pack): Check conformance between array and mask.
1331
1332 2006-02-03 Steven G. Kargl <kargls@comcast>
1333 Paul Thomas <pault@gcc.gnu.org>
1334
1335 PR fortran/20845
1336 * resolve.c (resolve_symbol): Default initialization of derived type
1337 component reguires the SAVE attribute.
1338
1339 2006-02-02 Steven G. Kargl <kargls@comcast>
1340
1341 PR fortran/24958
1342 match.c (gfc_match_nullify): Free the list from head not tail.
1343
1344 PR fortran/25072
1345 * match.c (match_forall_header): Fix internal error caused by bogus
1346 gfc_epxr pointers.
1347
1348
1349 2006-01-31 Thomas Koenig <Thomas.Koenig@online.de>
1350
1351 PR fortran/26039
1352 expr.c (gfc_check_conformance): Reorder error message
1353 to avoid plural.
1354 check.c(gfc_check_minloc_maxloc): Call gfc_check_conformance
1355 for checking arguments array and mask.
1356 (check_reduction): Likewise.
1357
1358 2006-01-30 Erik Edelmann <eedelman@gcc.gnu.org>
1359
1360 PR fortran/24266
1361 * trans-io.c (set_internal_unit): Check the rank of the
1362 expression node itself instead of its symbol.
1363
1364 2006-01-29 Paul Thomas <pault@gcc.gnu.org>
1365
1366 PR fortran/18578
1367 PR fortran/18579
1368 PR fortran/20857
1369 PR fortran/20885
1370 * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
1371 if actual argument is not a variable.
1372
1373 2006-01-28 Paul Thomas <pault@gcc.gnu.org>
1374
1375 PR fortran/17911
1376 * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
1377 the lvalue is a use associated procedure.
1378
1379 PR fortran/20895
1380 PR fortran/25030
1381 * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
1382 character lengths are not the same. Use gfc_dep_compare_expr for the
1383 comparison.
1384 * gfortran.h: Add prototype for gfc_dep_compare_expr.
1385 * dependency.h: Remove prototype for gfc_dep_compare_expr.
1386
1387 2006-01-27 Paul Thomas <pault@gcc.gnu.org>
1388
1389 PR fortran/25964
1390 * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
1391 generic_ids exempted from assumed size checking.
1392
1393 2006-01-27 Jakub Jelinek <jakub@redhat.com>
1394
1395 PR fortran/25324
1396 * Make-lang.in (fortran/scanner.o): Depend on toplev.h.
1397 * lang.opt (fpreprocessed): New option.
1398 * scanner.c: Include toplev.h.
1399 (gfc_src_file, gfc_src_preprocessor_lines): New variables.
1400 (preprocessor_line): Unescape filename if there were any
1401 backslashes.
1402 (load_file): If initial and gfc_src_file is not NULL,
1403 use it rather than opening the file. If gfc_src_preprocessor_lines
1404 has non-NULL elements, pass it to preprocessor_line.
1405 (unescape_filename, gfc_read_orig_filename): New functions.
1406 * gfortran.h (gfc_option_t): Add flag_preprocessed.
1407 (gfc_read_orig_filename): New prototype.
1408 * options.c (gfc_init_options): Clear flag_preprocessed.
1409 (gfc_post_options): If flag_preprocessed, call
1410 gfc_read_orig_filename.
1411 (gfc_handle_option): Handle OPT_fpreprocessed.
1412 * lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
1413 sources.
1414
1415 2006-01-27 Erik Edelmann <eedelman@gcc.gnu.org>
1416
1417 * symbol.c (free_old_symbol): Fix confusing comment, and add code
1418 to free old_symbol->formal.
1419
1420 2006-01-26 Paul Thomas <pault@gcc.gnu.org>
1421
1422 PR fortran/25964
1423 * resolve.c (resolve_function): Exclude statement functions from
1424 global reference checking.
1425
1426 PR fortran/25084
1427 PR fortran/20852
1428 PR fortran/25085
1429 PR fortran/25086
1430 * resolve.c (resolve_function): Declare a gfc_symbol to replace the
1431 references through the symtree to the symbol associated with the
1432 function expresion. Give error on reference to an assumed character
1433 length function is defined in an interface or an external function
1434 that is not a dummy argument.
1435 (resolve_symbol): Give error if an assumed character length function
1436 is array-valued, pointer-valued, pure or recursive. Emit warning
1437 that character(*) value functions are obsolescent in F95.
1438
1439 PR fortran/25416
1440 * trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
1441 prevents any assumed character length function call from getting here
1442 except intrinsics such as SPREAD. In this case, ensure that no
1443 segfault occurs from referencing non-existent charlen->length->
1444 expr_type and provide a backend_decl for the charlen from the charlen
1445 of the first actual argument.
1446
1447 Cure temp name confusion.
1448 * trans-expr.c (gfc_get_interface_mapping_array): Change name of
1449 temporary from "parm" to "ifm" to avoid clash with temp coming from
1450 trans-array.c.
1451
1452 2006-01-25 Erik Edelmann <eedelman@gcc.gnu.org>
1453
1454 PR fortran/25716
1455 * symbol.c (free_old_symbol): New function.
1456 (gfc_commit_symbols): Use it.
1457 (gfc_commit_symbol): New function.
1458 (gfc_use_derived): Use it.
1459 * gfortran.h: Add prototype for gfc_commit_symbol.
1460 * intrinsic.c (gfc_find_function): Search in 'conversion'
1461 if not found in 'functions'.
1462 (gfc_convert_type_warn): Add a symtree to the new
1463 expression node, and commit the new symtree->n.sym.
1464 * resolve.c (gfc_resolve_index): Make sure typespec is
1465 properly initialized.
1466
1467 2006-01-23 Paul Thomas <pault@gcc.gnu.org>
1468
1469 PR fortran/25901
1470 * decl.c (get_proc_name): Replace subroutine and function attributes
1471 in "already defined" test by the formal arglist pointer being non-NULL.
1472
1473 Fix regression in testing of admissability of attributes.
1474 * symbol.c (gfc_add_attribute): If the current_attr has non-zero
1475 intent, do not do the check for a dummy being used.
1476 * decl.c (attr_decl1): Add current_attr.intent as the third argument
1477 in the call to gfc_add_attribute.
1478 * gfortran.h: Add the third argument to the prototype for
1479 gfc_add_attribute.
1480
1481 2006-01-21 Joseph S. Myers <joseph@codesourcery.com>
1482
1483 * gfortranspec.c (lang_specific_driver): Update copyright notice
1484 date.
1485
1486 2006-01-21 Paul Thomas <pault@gcc.gnu.org>
1487
1488 PR fortran/25124
1489 PR fortran/25625
1490 * decl.c (get_proc_name): If there is an existing
1491 symbol in the encompassing namespace, call errors
1492 if it is a procedure of the same name or the kind
1493 field is set, indicating a type declaration.
1494
1495 PR fortran/20881
1496 PR fortran/23308
1497 PR fortran/25538
1498 PR fortran/25710
1499 * decl.c (add_global_entry): New function to check
1500 for existing global symbol with this name and to
1501 create new one if none exists.
1502 (gfc_match_entry): Call add_global_entry before
1503 matching argument lists for subroutine and function
1504 entries.
1505 * gfortran.h: Prototype for existing function,
1506 global_used.
1507 * resolve.c (resolve_global_procedure): New function
1508 to check global symbols for procedures.
1509 (resolve_call, resolve_function): Calls to this
1510 new function for non-contained and non-module
1511 procedures.
1512 * match.c (match_common): Add check for existing
1513 global symbol, creat one if none exists and emit
1514 error if there is a clash.
1515 * parse.c (global_used): Remove static and use the
1516 gsymbol name rather than the new_block name, so that
1517 the function can be called from resolve.c.
1518 (parse_block_data, parse_module, add_global_procedure):
1519 Improve checks for existing gsymbols. Emit error if
1520 already defined or if references were to another type.
1521 Set defined flag.
1522
1523 PR fortran/PR24276
1524 * trans-expr.c (gfc_conv_aliased_arg): New function called by
1525 gfc_conv_function_call that coverts an expression for an aliased
1526 component reference to a derived type array into a temporary array
1527 of the same type as the component. The temporary is passed as an
1528 actual argument for the procedure call and is copied back to the
1529 derived type after the call.
1530 (is_aliased_array): New function that detects an array reference
1531 that is followed by a component reference.
1532 (gfc_conv_function_call): Detect an aliased actual argument with
1533 is_aliased_array and convert it to a temporary and back again
1534 using gfc_conv_aliased_arg.
1535
1536 2006-01-19 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
1537
1538 * gfortranspec.c: Update copyright years.
1539 * trans.c: Likewise.
1540 * trans-array.c: Likewise.
1541 * trans-array.h: Likewise.
1542 * trans-decl.c: Likewise.
1543 * trans-stmt.c: Likewise.
1544 * trans-stmt.h: Likewise.
1545 * trans-types.c: Likewise.
1546
1547 2006-01-18 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
1548
1549 PR fortran/18540
1550 PR fortran/18937
1551 * gfortran.h (BBT_HEADER): Move definition up.
1552 (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'.
1553 * io.c (format_asterisk): Adapt initializer.
1554 * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
1555 as extension.
1556 (warn_unused_label): Take gfc_st_label label as argument, adapt to
1557 new data structure.
1558 (gfc_resolve): Adapt call to warn_unused_label.
1559 * symbol.c (compare_st_labels): New function.
1560 (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to
1561 using balanced binary tree.
1562 * decl.c (match_char_length, gfc_match_old_kind_spec): Do away
1563 with 'cnt'.
1564 (warn_unused_label): Adapt to binary tree.
1565 * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL.
1566 * primary.c (match_kind_param): Do away with cnt.
1567
1568 2006-01-18 Paul Thomas <pault@gcc.gnu.org>
1569
1570 PR fortran/20869
1571 PR fortran/20875
1572 PR fortran/25024
1573 * symbol.c (check_conflict): Add pointer valued elemental
1574 functions and internal procedures with the external attribute
1575 to the list of conflicts.
1576 (gfc_add_attribute): New catch-all function to perform the
1577 checking of symbol attributes for attribute declaration
1578 statements.
1579 * decl.c (attr_decl1): Call gfc_add_attribute for each of -
1580 (gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
1581 gfc_match_pointer, gfc_match_dimension, gfc_match_target):
1582 Remove spurious calls to checks in symbol.c. Set the
1583 attribute directly and use the call to attr_decl() for
1584 checking.
1585 * gfortran.h: Add prototype for gfc_add_attribute.
1586
1587 PR fortran/25785
1588 * resolve.c (resolve_function): Exclude PRESENT from assumed size
1589 argument checking. Replace strcmp's with comparisons with generic
1590 codes.
1591
1592 2006-01-16 Rafael \81Ávila de Esp\81índola <rafael.espindola@gmail.com>
1593
1594 * gfortranspec.c (lang_specific_spec_functions): Remove.
1595
1596 2006-01-16 Richard Guenther <rguenther@suse.de>
1597
1598 * trans-stmt.c (gfc_trans_if_1): Use fold_buildN and build_int_cst.
1599 (gfc_trans_arithmetic_if): Likewise.
1600 (gfc_trans_simple_do): Likewise.
1601 (gfc_trans_do): Likewise.
1602 (gfc_trans_do_while): Likewise.
1603 (gfc_trans_logical_select): Likewise.
1604 (gfc_trans_forall_loop): Likewise.
1605 (generate_loop_for_temp_to_lhs): Likewise.
1606 (generate_loop_for_rhs_to_temp): Likewise.
1607 (gfc_trans_allocate): Likewise.
1608 * trans.c (gfc_add_expr_to_block): Do not fold expr again.
1609
1610 2006-01-16 Richard Guenther <rguenther@suse.de>
1611
1612 * trans-expr.c (gfc_conv_function_call): Use fold_build2.
1613 * trans-stmt.c (gfc_trans_goto): Likewise. Use build_int_cst.
1614 * trans.c (gfc_trans_runtime_check): Don't fold the condition
1615 again.
1616
1617 2006-01-13 Steven G. Kargl <kargls@comcast.net>
1618
1619 PR fortran/25756
1620 * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove
1621 unneeded parenthesis. Fix-up the head of the list (2 lines gleaned
1622 from g95).
1623
1624 2006-01-13 Diego Novillo <dnovillo@redhat.com>
1625
1626 * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement
1627 nodes.
1628
1629 2006-01-11 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
1630
1631 * parse.c (next_fixed): Remove superfluous string concatenation.
1632
1633 2006-01-11 Bernhard Fischer <rep.nop@aon.at>
1634
1635 PR fortran/25486
1636 * scanner.c (load_line): use maxlen to determine the line-length used
1637 for padding lines in fixed form.
1638
1639 2006-01-11 Paul Thomas <pault@gcc.gnu.org>
1640
1641 PR fortran/25730
1642 * trans-types.c (copy_dt_decls_ifequal): Copy backend decl for
1643 character lengths.
1644
1645 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
1646
1647 fortran/24936
1648 * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
1649 to avoid type mismatch.
1650
1651 2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
1652
1653 PR fortran/21977
1654 * trans-decl.c (gfc_generate_function_code): Move the NULLing of
1655 current_fake_result_decl down to below generate_local_vars.
1656
1657 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
1658
1659 PR fortran/12456
1660 * trans-expr.c (gfc_to_single_character): New function that converts
1661 string to single character if its length is 1.
1662 (gfc_build_compare_string):New function that compare string and handle
1663 single character specially.
1664 (gfc_conv_expr_op): Use gfc_build_compare_string.
1665 (gfc_trans_string_copy): Use gfc_to_single_character.
1666 * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
1667 gfc_build_compare_string.
1668 * trans.h (gfc_build_compare_string): Add prototype.
1669
1670 2006-01-09 Feng Wang <fengwang@nudt.edu.cn>
1671
1672 * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
1673 constant.
1674 (gfc_simplify_ichar): Get the result from unsinged char and in the
1675 range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
1676
1677 2006-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
1678
1679 PR fortran/25093
1680 * resolve.c (resolve_fntype): Check that PUBLIC functions
1681 aren't of PRIVATE type.
1682
1683 2006-01-07 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
1684
1685 * decl.c (gfc_match_function_decl): Correctly error out in case of
1686 omitted function argument list.
1687
1688 2006-01-07 Paul Thomas <pault@gcc.gnu.org>
1689
1690 PR fortran/22146
1691 * trans-array.c (gfc_reverse_ss): Remove static attribute.
1692 (gfc_walk_elemental_function_args): Replace gfc_expr * argument for
1693 the function call with the corresponding gfc_actual_arglist*. Change
1694 code accordingly.
1695 (gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
1696 now requires the actual argument list instead of the expression for
1697 the function call.
1698 * trans-array.h: Modify the prototype for gfc_walk_elemental_function_args
1699 and provide a prototype for gfc_reverse_ss.
1700 * trans-stmt.h (gfc_trans_call): Add the scalarization code for the case
1701 where an elemental subroutine has array valued actual arguments.
1702
1703 PR fortran/25029
1704 PR fortran/21256
1705 PR fortran/20868
1706 PR fortran/20870
1707 * resolve.c (check_assumed_size_reference): New function to check for upper
1708 bound in assumed size array references.
1709 (resolve_assumed_size_actual): New function to do a very restricted scan
1710 of actual argument expressions of those procedures for which incomplete
1711 assumed size array references are not allowed.
1712 (resolve_function, resolve_call): Switch off assumed size checking of
1713 actual arguments, except for elemental procedures and intrinsic
1714 inquiry functions, in some circumstances.
1715 (resolve_variable): Call check_assumed_size_reference.
1716
1717 2006-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1718
1719 PR fortran/24268
1720 * io.c (next_char_not_space): New function that returns the next
1721 character that is not white space.
1722 (format_lex): Use the new function to skip whitespace within
1723 a format string.
1724
1725 2006-01-05 Erik Edelmann <eedelman@gcc.gnu.org>
1726
1727 PR fortran/23675
1728 * expr.c (gfc_expr_set_symbols_referenced): New function.
1729 * gfortran.h: Add a function prototype for it.
1730 * resolve.c (resolve_function): Use it for
1731 use associated character functions lengths.
1732 * expr.c, gfortran.h, resolve.c: Updated copyright years.
1733
1734 2006-01-03 Steven G. Kargl <kargls@comcast.net>
1735
1736 PR fortran/25101
1737 * resolve.c (resolve_forall_iterators): Check for scalar variables;
1738 Check stride is nonzero.
1739
1740 2006-01-02 Steven G. Kargl <kargls@comcast.net>
1741
1742 PR fortran/24640
1743 * parse.c (next_free): Check for whitespace after the label.
1744 * match.c (gfc_match_small_literal_int): Initialize cnt variable.
1745
1746 2006-01-01 Steven G. Kargl <kargls@comcast.net>
1747
1748 * ChangeLog: Split previous years into ...
1749 * ChangeLog-2002: here.
1750 * ChangeLog-2003: here.
1751 * ChangeLog-2004: here.
1752 * ChangeLog-2005: here.