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