OSDN Git Service

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