OSDN Git Service

2006-09-11 Paul Thomas <pault@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2006-09-11  Paul Thomas  <pault@gcc.gnu.org>
2
3         PR fortran/28890
4         trans-expr.c (gfc_conv_function_call): Obtain the string length
5         of a dummy character(*) function from the symbol if it is not
6         already translated.  For a call to a character(*) function, use
7         the passed, hidden string length argument, which is available
8         from the backend_decl of the formal argument.
9         resolve.c (resolve_function): It is an error if a function call
10         to a character(*) function is other than a dummy procedure or
11         an intrinsic.
12
13 2006-09-10  Paul Thomas  <pault@gcc.gnu.org>
14
15         PR fortran/28959
16         trans-types.c (gfc_get_derived_type): Use the parent namespace of
17         the procedure if the type's own namespace does not have a parent.
18
19 2006-09-10  Paul Thomas  <pault@gcc.gnu.org>
20
21         PR fortran/28923
22         expr.c (find_array_section): Only use the array lower and upper
23         bounds for the start and end of the sections, where the expr is
24         NULL.
25
26 2006-09-10  Paul Thomas <pault@gcc.gnu.org>
27
28         PR fortran/28914
29         * trans-array.c (gfc_trans_array_constructor_value): Create a temporary
30         loop variable to hold the current loop variable in case it is modified
31         by the array constructor.
32
33 2006-09-07  Steven G. Kargl  <kargls@comcast.net>
34
35         * gfortran.h (gfc_integer_info): Eliminate max_int.
36         * arith.c (gfc_arith_init_1): Remove initialization of max_int.
37         (gfc_arith_done_1): Remove clearing of max_int.
38         (gfc_check_integer_range): Fix range chekcing of overflow.
39         * simplify.c (gfc_simplify_not): Construct mask that was max_int.
40
41 2006-09-05  Paul Thomas <pault@gcc.gnu.org>
42
43         PR fortran/28908
44         * gfortran.h : Restore the gfc_dt_list structure and reference
45         to it in gfc_namespace.
46         * resolve.c (resolve_fl_derived): Restore the building of the
47         list of derived types for the current namespace. Modify the
48         restored code so that a check is made to see if the symbol is
49         already in the list.
50         (resolve_fntype): Make sure that the specification block
51         version of the derived type is used for a module function that
52         returns that type. 
53         * symbol.c (gfc_free_dt_list): Restore.
54         (gfc_free_namespace): Restore call to previous.
55         * trans-types.c (copy_dt_decls_ifequal): Restore.
56         (gfc_get_derived_type): Restore all the paraphenalia for
57         association of derived types, including calls to previous.
58         Modify the restored code such that all derived types are built
59         if their symbols are found in the parent namespace; not just
60         non-module types.  Add backend_decls to like derived types in
61         sibling namespaces, as well as that of the derived type.
62
63 2006-08-30  Kazu Hirata  <kazu@codesourcery.com>
64
65         * match.c: Fix a comment typo.
66
67 2006-08-30  Paul Thomas  <pault@gcc.gnu.org>
68
69         PR fortran/28885
70         * trans-expr.c (gfc_conv_aliased_arg): Ensure that the temp
71         declaration is retained for INTENT(OUT) arguments.
72
73         PR fortran/28873
74         PR fortran/20067
75         * resolve.c (resolve_generic_f): Make error message more
76         comprehensible.
77         (resolve_generic_s): Restructure search for specific procedures
78         to be similar to resolve_generic_f and change to similar error
79         message.  Ensure that symbol reference is refreshed, in case
80         the search produces a NULL.
81         (resolve_specific_s): Restructure search, as above and as
82         resolve_specific_f. Ensure that symbol reference is refreshed,
83         in case the search produces a NULL.
84
85         PR fortran/25077
86         PR fortran/25102
87         * interface.c (check_operator_interface): Throw error if the
88         interface assignment tries to change intrinsic type assigments
89         or has less than two arguments.  Also, it is an error if an
90         interface operator contains an alternate return.
91
92         PR fortran/24866
93         * parse.c (gfc_fixup_sibling_symbols): Do not modify the symbol
94         if it is a dummy in the contained namespace.
95
96 2006-08-29  Steven G. Kargl  <kargls@comcast.net>
97
98         PR fortran/28866
99         * match.c: Wrap copyright.
100         (gfc_match_assignment):  Return MATCH_NO for failed lvalue.  Remove
101         gotos.  Move error handling of FL_PARAMETER to ...
102         * gfc_match_if: Deal with MATCH_NO from above.
103         * primary.c: Wrap copyright.
104         (match_variable): ... here.  Improve error messages.
105
106 2006-08-29  Paul Thomas  <pault@gcc.gnu.org>
107
108         PR fortran/28788
109         * symbol.c (gfc_use_derived): Never eliminate the symbol,
110         following reassociation of use associated derived types.
111
112 2006-08-26  Steven G. Kargl  <kargls@comcast.net>
113
114         * arith.h: Update Copyright dates.  Fix whitespace.
115         * arith.c: Update Copyright dates.  Fix whitespace.  Fix comments.
116         (gfc_arith_done_1): Clean up pedantic_min_int and subnormal.
117
118 2006-08-26  Tobias Burnus  <burnus@net-b.de>
119
120         * gfortran.texi: Note variable initialization causes SAVE attribute.
121         * intrinsic.texi: Clarify support for KIND=16 and KIND=10.
122         Mention -std=f2003.  Cross reference INQUIRE from ACCESS intrinsic.
123         Add missing ) in ACOS.
124
125 2006-08-26  Daniel Franke  <franke.daniel@gmail.com>
126
127         * intrinsic.texi: Update Copyright date.  Added documentation
128         for ACOSH, AND, ASINH, ATANH, CHDIR, FGET, FGETC, FPUT, FPUTC,
129         GETCWD, OR and XOR intrinsics, removed inadvertently introduced
130         doc-stubs for EQV and NEQV, corrected some typographical errors.
131
132 2006-08-24  Daniel Franke  <franke.daniel@gmail.com>,
133             Brooks Moses  <bmoses@stanford.edu>
134
135         * intrinsic.texi: Added doc-stubs for undocumented intrinsics,
136         added a "See Also" section, renamed the "Options" section to
137         "Standard", improved the index, and made numerous minor
138         typo corrections and grammatical fixes.
139
140 2006-08-24  Paul Thomas  <pault@gcc.gnu.org>
141
142         PR fortran/28788
143         * symbol.c (shift_types): Shift the derived type references in
144         formal namespaces.
145         (gfc_use_derived): Return if the derived type symbol is already
146         in another namspace.  Add searches for the derived type in
147         sibling namespaces.
148
149         PR fortran/28771
150         * decl.c (add_init_expr_to_sym): Restore the original but
151         restricted to parameter arrays to fix a regression.
152
153 2006-08-23  Steven G. Kargl  <kargls@comcast.net>
154
155         * gfortran.texi:  Fix last commit where a "no" was deleted and
156         a grammatical error was introduced.
157
158 2006-08-23  Steven G. Kargl  <kargls@comcast.net>
159
160         * gfortran.texi:  Spell check.  Add a few contributors to
161         Chapter 9.  Expand the description of BOZ constant handling.
162
163 2006-08-20  Janne Blomqvist  <jb@gcc.gnu.org>
164
165         PR fortran/25828
166         * gfortran.texi: Mention STREAM I/O among supported F2003
167         features.
168
169 2006-08-20  Paul Thomas  <pault@gcc.gnu.org>
170
171         PR fortran/28601
172         PR fortran/28630
173         * gfortran.h : Eliminate gfc_dt_list structure and reference
174         to it in gfc_namespace.
175         * resolve.c (resolve_fl_derived): Remove the building of the
176         list of derived types for the current namespace.
177         * symbol.c (find_renamed_type): New function to find renamed
178         derived types by symbol name rather than symtree name.
179         (gfc_use_derived): Search parent namespace for identical
180         derived type and use it, even if local version is complete,
181         except in interface bodies. Ensure that renamed derived types
182         are found by call to find_renamed_type. Recurse for derived
183         type components.
184         (gfc_free_dt_list): Remove.
185         (gfc_free_namespace): Remove call to previous.
186         * trans-types.c (copy_dt_decls_ifequal): Remove.
187         (gfc_get_derived_type): Remove all the paraphenalia for
188         association of derived types, including calls to previous.
189         * match.c (gfc_match_allocate): Call gfc_use_derived to
190         associate any derived types that are being allocated.
191
192         PR fortran/20886
193         * resolve.c (resolve_actual_arglist): The passing of
194         a generic procedure name as an actual argument is an
195         error.
196
197         PR fortran/28735
198         * resolve.c (resolve_variable): Check for a symtree before
199         resolving references.
200
201         PR fortran/28762
202         * primary.c (match_variable): Return MATCH_NO if the symbol
203         is that of the program.
204
205         PR fortran/28425
206         * trans-expr.c (gfc_trans_subcomponent_assign): Translate
207         derived type component expressions other than another derived
208         type constructor.
209
210         PR fortran/28496
211         * expr.c (find_array_section): Correct errors in
212         the handling of a missing start value for the
213         index triplet in an array reference.
214
215         PR fortran/18111
216         * trans-decl.c (gfc_build_dummy_array_decl): Before resetting
217         reference to backend_decl, set it DECL_ARTIFICIAL.
218         (gfc_get_symbol_decl): Likewise for original dummy decl, when
219         a copy is made of an array.
220         (create_function_arglist): Likewise for the _entry paramter
221         in entry_masters.
222         (build_entry_thunks): Likewise for dummies in entry thunks.
223
224         PR fortran/28600
225         * trans-decl.c (gfc_get_symbol_decl): Ensure that the
226         DECL_CONTEXT of the length of a character dummy is the
227         same as that of the symbol declaration.
228
229         PR fortran/28771
230         * decl.c (add_init_expr_to_sym): Remove setting of charlen for
231         an initializer of an assumed charlen variable.
232
233         PR fortran/28660
234         * trans-decl.c (generate_expr_decls): New function.
235         (generate_dependency_declarations): New function.
236         (generate_local_decl): Call previous if not either a dummy or
237         a declaration in an entry master.
238
239 2006-08-19  Erik Edelmann  <eedelman@gcc.gnu.org>
240
241         PR fortran/25217
242         * resolve.c (resolve_fl_variable): Set a default initializer for
243         derived types with INTENT(OUT) even if 'flag' is true.
244         * trans-expr.c (gfc_conv_function_call): Insert code to
245         reinitialize INTENT(OUT) arguments of derived type with default
246         initializers.
247
248 2006-08-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
249
250         PR fortran/25828
251         * gfortran.h: Add new pointer for stream position to st_inquire.
252         Rename gfc_large_io_int_kind to gfc_intio_kind.
253         * trans-types.c (gfc_init_kinds): use gfc_intio_kind.
254         * io.c: Add new IO tag for file position going in and another for out.
255         (match_dt_element): Match new tag_spos.
256         (gfc_resolve_dt): Resolve new tag_spos.
257         (gfc_free_inquire): Free inquire->strm_pos.
258         (match_inquire_element): Match new tag_strm_out.
259         (gfc_resolve_inquire): Resolve new tag_strm_out.
260         * trans-io.c: Rename IOPARM_type_large_io_int to IOPARM_type_intio.
261         (gfc_build_st_parameter): Same.
262         (gfc_build_io_library_fndecls) Same. and add build pointer type pintio.
263         (gfc_trans_inquire): Translate strm_pos for inquire.
264         * ioparm.def: Reorder flags to accomodate addition of new inquire
265         flag for strm_pos_out and add it in.
266
267 2006-08-06  Paul Thomas  <pault@gcc.gnu.org>
268
269         PR fortran/28590
270         * parse.c (parse_derived): Remove the test for sequence type
271         components of a sequence type.
272         * resolve.c (resolve_fl_derived): Put the test here so that
273         pointer components are tested.
274
275 2006-08-05  Steven G. Kargl <kargls@comcast.nt>
276
277         PR fortran/28548
278         * resolve.c(resolve_elemental_actual): Add flags.h to use -pedantic
279         and exclude conversion functions in conditional.  Change gfc_error
280         to gfc_warning.
281         (warn_unused_label) Rename to ...
282         (warn_unused_fortran_label) avoid warn_unused_label in flags.h.
283      
284 2006-07-30  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
285
286         * intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
287         (add_subroutines): Add LTIME, GMTIME and CHMOD.
288         * intrinsic.h (gfc_check_access_func, gfc_check_chmod,
289         gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
290         gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
291         gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
292         gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
293         * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
294         GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
295         * iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
296         gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
297         gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
298         * check.c (gfc_check_access_func, gfc_check_chmod,
299         gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
300         * trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
301         (gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
302
303 2006-07-28  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
304
305         * Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies.
306
307 2006-07-26  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
308
309         * intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG,
310         LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
311         (add_subroutines): Add LSTAT intrinsic subroutine.
312         * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2,
313         GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK
314         and GFC_ISYM_MCLOCK8.
315         * iresolve.c (gfc_resolve_int2, gfc_resolve_int8,
316         gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock,
317         gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions.
318         * check.c (gfc_check_intconv): New function.
319         * trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
320         the added GFC_ISYM_*.
321         * simplify.c (gfc_simplify_intconv, gfc_simplify_int2,
322         gfc_simplify_int8, gfc_simplify_long): New functions.
323         * intrinsic.h (gfc_check_intconv, gfc_simplify_int2,
324         gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2,
325         gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat,
326         gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub):
327         Add prototypes.
328
329 2006-07-24  Erik Edelmann  <eedelman@gcc.gnu.org>
330
331         PR fortran/28416
332         * trans-array.c (gfc_conv_array_parameter): Give special treatment for
333         ALLOCATABLEs if they are themselves dummy variables.
334
335 2006-07-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
336
337         PR fortran/25289
338         * gfortran.h: Declare gfc_large_io_int_kind.
339         * trans-types.c (gfc_init_kinds): Set gfc_large_io_int_kind
340         to size 8 or 4.
341         * trans-io.c (enum iofield_type): Add large_io_int type.
342         (gfc_build_st_parameter): Same.
343         (gfc_build_io_library_fndecls): Same.
344         * ioparm_def: Use large_io_int to define rec.
345
346 2006-07-22  Steven Bosscher  <steven@gcc.gnu.org> 
347
348         PR fortran/28439
349         * trans-stmt.c (gfc_trans_arithmetic_if): Evaluate the condition once.
350
351 2006-07-16  Jakub Jelinek  <jakub@redhat.com>
352
353         PR fortran/28390
354         * trans-openmp.c (gfc_trans_omp_do): Look for LASTPRIVATE in
355         code->exp.omp_clauses rather than in the 3rd function argument.
356
357 2006-07-16  Paul Thomas  <pault@gcc.gnu.org>
358
359         PR fortran/28384
360         * trans-common.c (translate_common): If common_segment is NULL
361         emit error that common block does not exist.
362
363         PR fortran/20844
364         * io.c (check_io_constraints): It is an error if an ADVANCE
365         specifier appears without an explicit format.
366
367         PR fortran/28201
368         * resolve.c (resolve_generic_s): For a use_associated function,
369         do not search for an alternative symbol in the parent name
370         space.
371
372         PR fortran/20893
373         * resolve.c (resolve_elemental_actual): New function t combine
374         all the checks of elemental procedure actual arguments. In
375         addition, check of array valued optional args(this PR) has
376         been added.
377         (resolve_function, resolve_call): Remove parts that treated
378         elemental procedure actual arguments and call the above.
379
380 2006-07-14  Steven G. Kargl  <kargls@comcast.net>
381
382         * trans-expr.c (gfc_trans_string_copy): Evaluate the string lengths
383
384 006-07-13  Paul Thomas  <pault@gcc.gnu.org>
385
386         PR fortran/28353
387         * trans-expr.c (gfc_conv_aliased_arg): Missing formal arg means
388         that intent is INOUT (fixes regression).
389
390         PR fortran/25097
391         * check.c (check_present): The only permitted reference is a
392         full array reference.
393
394         PR fortran/20903
395         * decl.c (variable_decl): Add error if a derived type is not
396         from the current namespace if the namespace is an interface
397         body.
398
399 2006-07-12  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
400
401         PR fortran/28163
402         * trans-expr.c (gfc_trans_string_copy): Generate inline code
403         to perform string copying instead of calling a library function.
404         * trans-decl.c (gfc_build_intrinsic_function_decls): Don't build
405         decl for copy_string.
406         * trans.h (gfor_fndecl_copy_string): Remove prototype.
407
408 2006-07-11  Feng Wang  <fengwang@nudt.edu.cn>
409
410         PR fortran/28213
411         * trans-io.c (transfer_expr): Deal with Hollerith constants used in
412         I/O list.
413
414 2006-07-07  Kazu Hirata  <kazu@codesourcery.com>
415
416         * intrinsic.texi: Fix typos.
417
418 2006-07-07  Paul Thomas  <pault@gcc.gnu.org>
419
420         PR fortran/28237
421         PR fortran/23420
422         * io.c (resolve_tag): Any integer that is not an assigned
423         variable is an error.
424
425 2006-07-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
426
427         PR fortran/28129
428         * trans-array.c (gfc_trans_array_bound_check): Add a locus
429         argument, and use it in the error messages.
430         (gfc_conv_array_index_offset): Donc perform bounds checking on
431         the last dimension of assumed-size arrays.
432
433 2006-07-06  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
434
435         PR fortran/27874
436         * trans-stmt.c (compute_inner_temp_size): Don't perform bounds
437         checking when calculating the bounds of scalarization.
438
439 2006-07-05  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
440
441         PR fortran/20892
442         * interface.c (gfc_match_interface): Don't allow dummy procedures
443         to have a generic interface.
444
445 2006-07-04  Paul Thomas  <pault@gcc.gnu.org>
446
447         PR fortran/28174
448         * trans-array.c (gfc_conv_expr_descriptor): When building temp,
449         ensure that the substring reference uses a new charlen.
450         * trans-expr.c (gfc_conv_aliased_arg): Add the formal intent to
451         the argument list, lift the treatment of missing string lengths
452         from the above and implement the use of the intent.
453         (gfc_conv_function_call): Add the extra argument to the call to
454         the above.
455
456         PR fortran/28167
457         * trans-array.c (get_array_ctor_var_strlen): Treat a constant
458         substring reference.
459         * array.c (gfc_resolve_character_array_constructor): Remove 
460         static attribute and add the gfc_ prefix, make use of element
461         charlens for the expression and pick up constant string lengths
462         for expressions that are not themselves constant.
463         * gfortran.h : resolve_character_array_constructor prototype
464         added.
465         * resolve.c (gfc_resolve_expr): Call resolve_character_array_
466         constructor again after expanding the constructor, to ensure
467         that the character length is passed to the expression.
468
469 2006-07-04  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
470             Daniel Franke  <franke.daniel@gmail.com>
471
472         * intrinsic.c (add_subroutines): Add ITIME and IDATE.
473         * intrinsic.h (gfc_check_itime_idate,gfc_resolve_idate,
474         fc_resolve_itime): New protos.
475         * iresolve.c (gfc_resolve_itime, gfc_resolve_idate): New functions.
476         * check.c (gfc_check_itime_idate): New function.
477         * intrinsic.texi: Document the new intrinsics.
478
479 2006-07-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
480
481         * intrinsics/date_and_time.c (itime0,idate0,itime_i4,itime_i8,
482         idate_i4,idate_i8): New functions.
483
484
485 2006-07-03  Asher Langton  <langton2@llnl.gov>
486
487         * decl.c (match_old_style_init): Add data attribute to symbol.
488
489 2006-07-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
490
491         * iresolve.c (gfc_resolve_cpu_time, gfc_resolve_random_number):
492         Remove ATTRIBUTE_UNUSED for used argument.
493
494 2006-07-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
495
496         * intrinsic.texi: Document new intrinsics.
497
498 2006-07-01  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
499
500         PR fortran/19259
501         * parse.c (next_free): Error out on line starting with semicolon.
502         (next_fixed): Fix formatting.  Error out on line starting with
503         semicolon.
504
505 2006-06-30  Kazu Hirata  <kazu@codesourcery.com>
506
507         * check.c: Fix a comment typo.
508
509 2006-06-25  Paul Thomas  <pault@gcc.gnu.org>
510
511         PR fortran/25056
512         * interface.c (compare_actual_formal): Signal an error if the formal
513         argument is a pure procedure and the actual is not pure.
514
515         PR fortran/27554
516         * resolve.c (resolve_actual_arglist): If the type of procedure
517         passed as an actual argument is not already declared, see if it is
518         an intrinsic.
519
520         PR fortran/25073
521         * resolve.c (resolve_select): Use bits 1 and 2 of a new int to
522         keep track of  the appearance of constant logical case expressions.
523         Signal an error is either value appears more than once.
524
525         PR fortran/20874
526         * resolve.c (resolve_fl_procedure): Signal an error if an elemental
527         function is not scalar valued.
528
529         PR fortran/20867
530         * match.c (recursive_stmt_fcn): Perform implicit typing of variables.
531
532         PR fortran/22038
533         * match.c (match_forall_iterator): Mark new variables as
534         FL_UNKNOWN if the match fails.
535
536         PR fortran/28119
537         * match.c (gfc_match_forall): Remove extraneous call to
538         gfc_match_eos.
539
540         PR fortran/25072
541         * resolve.c (resolve_code, resolve_function): Rework
542         forall_flag scheme so that it is set and has a value of
543         2, when the code->expr (ie. the forall mask) is resolved.
544         This is used to change "block" to "mask" in the non-PURE
545         error message.
546
547 2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
548
549         PR fortran/28081
550         * resolve.c (resolve_substring): Don't issue out-of-bounds
551         error messages when the range has zero size.
552
553 2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
554
555         PR fortran/23862
556         * lang-specs.h (f95-cpp-input): Pass -ffree-form to f951 unless
557         -ffixed-form is explicitly specified.
558
559 2006-06-24  Paul Thomas  <pault@gcc.gnu.org>
560
561         PR fortran/28118
562         * trans-array.c (gfc_conv_expr_descriptor): When building temp,
563         use the substring reference to calculate the length if the
564         expression does not have a charlen.
565
566 2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
567
568         PR fortran/28094
569         * trans-intrinsic.c (gfc_conv_intrinsic_mod): Support cases where
570         there is no integer kind equal to the resulting real kind.
571         * intrinsic.c (add_functions): MODULO is not allowed as an actual
572         argument.
573
574 2006-06-23  Steven G. Kargl  <kargls@comcast.net>
575
576         PR fortran/27981
577         * match.c (gfc_match_if):  Handle errors in assignment in simple if.
578
579 2006-06-22  Asher Langton  <langton2@llnl.gov>
580
581         PR fortran/24748
582         * primary.c (gfc_match_rvalue): Don't call match_substring for
583         implicit non-character types.
584
585 2006-06-22  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
586
587         PR libfortran/26769
588         * iresolve.c (gfc_resolve_reshape): Call reshape_r4 and
589         reshape_r8 instead of reshape_4 and reshape_8.
590         (gfc_resolve_transpose): Likewise for transpose.
591
592 2006-06-21  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
593
594         * trans-expr.c (gfc_conv_missing_dummy, gfc_conv_unary_op,
595         gfc_conv_cst_int_power, gfc_conv_string_tmp,
596         gfc_conv_function_call): Replace calls to convert on constant
597         integer nodes by build_int_cst.
598         * trans-stmt.c (gfc_trans_do): Likewise.
599         * trans-io.c (set_internal_unit, transfer_namelist_element):
600         Likewise.
601         * trans-decl.c (build_entry_thunks): Likewise.
602
603 2006-06-20  Steven G. Kargl  <kargls@comcast.net>
604
605         * simplify.c (gfc_simplify_rrspacing): Initialize and clear mpfr_t
606         variable.
607
608 2006-06-20  Paul Thomas  <pault@gcc.gnu.org>
609
610         PR fortran/25049
611         PR fortran/25050
612         * check.c (non_init_transformational): New function.
613         (find_substring_ref): New function to signal use of disallowed
614         transformational intrinsic in an initialization expression.
615         (gfc_check_all_any): Call previous if initialization expr.
616         (gfc_check_count): The same.
617         (gfc_check_cshift): The same.
618         (gfc_check_dot_product): The same.
619         (gfc_check_eoshift): The same.
620         (gfc_check_minloc_maxloc): The same.
621         (gfc_check_minval_maxval): The same.
622         (gfc_check_gfc_check_product_sum): The same.
623         (gfc_check_pack): The same.
624         (gfc_check_spread): The same.
625         (gfc_check_transpose): The same.
626         (gfc_check_unpack): The same.
627
628         PR fortran/18769
629         *intrinsic.c (add_functions): Add gfc_simplify_transfer.
630         *intrinsic.h : Add prototype for gfc_simplify_transfer.
631         *simplify.c (gfc_simplify_transfer) : New function to act as
632         placeholder for eventual implementation.  Emit error for now.
633
634         PR fortran/16206
635         * expr.c (find_array_element): Eliminate condition on length of
636         offset. Add bounds checking. Rearrange exit. Return try and
637         put gfc_constructor result as an argument.
638         (find_array_section): New function.
639         (find_substring_ref): New function.
640         (simplify_const_ref): Add calls to previous.
641         (simplify_parameter_variable): Return on NULL expr.
642         (gfc_simplify_expr): Only call gfc_expand_constructor for full
643         arrays.
644
645         PR fortran/20876
646         * match.c (gfc_match_forall): Add missing locus to gfc_code.
647
648 2006-06-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
649
650         PR fortran/26801
651         * trans-intrinsic.c (gfc_conv_associated): Use pre and post blocks
652         of the scalarization expression.
653
654 2006-06-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
655
656         PR fortran/19310
657         PR fortran/19904
658         * arith.c (gfc_range_check): Return ARITH_OK if -fno-range-check. Add
659         return of ARITH_NAN, ARITH_UNDERFLOW, and ARITH_OVERFLOW.
660         (gfc_arith_divide): If -fno-range-check allow mpfr to divide by zero.
661         * gfortran.h (gfc_option_t): Add new flag.
662         * invoke.texi: Document new flag.
663         * lang.opt: Add option -frange-check.
664         * options.c (gfc_init_options): Initialize new flag.
665         (gfc_handle_options): Set flag if invoked.
666         * simplify.c (range_check): Add error messages for
667         overflow, underflow, and other errors.
668         * trans-const.c (gfc_conv_mpfr_to_tree): Build NaN and Inf from mpfr
669         result.
670
671 2006-06-17  Karl Berry  <karl@gnu.org>
672
673         * gfortran.texi (@dircategory): Use "Software development"
674         instead of "Programming", following the Free Software Directory.
675
676 2006-06-16  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
677
678         PR fortran/27965
679         * trans-array.c (gfc_conv_ss_startstride): Correct the runtime
680         conditions for bounds-checking. Check for nonzero stride.
681         Don't check the last dimension of assumed-size arrays. Fix the
682         dimension displayed in the error message.
683
684 2006-06-15  Thomas Koenig <Thomas.Koenig@online.de>
685
686         * trans-array.h (gfc_trans_create_temp_array):  Add bool
687         argument.
688         * trans-arrray.c (gfc_trans_create_temp_array): Add extra
689         argument "function" to show if we are translating a function.
690         If we are translating a function, perform checks whether
691         the size along any argument is negative.  In that case,
692         allocate size 0.
693         (gfc_trans_allocate_storage):  Add function argument (as
694         false) to gfc_trans_create_temp_array call.
695         * trans-expr.c (gfc_conv_function_call):  Add function
696         argument (as true) to gfc_trans_create_temp_array call.
697         * trans-stmt.c (gfc_conv_elemental_dependencies): Add
698         function argument (as false) to gfc_trans_create_temp_array
699         call.
700         * trans-intrinsic.c:  Likewise.
701
702 2006-06-10  Paul Thomas  <pault@gcc.gnu.org>
703
704         PR fortran/24558
705         PR fortran/20877
706         PR fortran/25047
707         * decl.c (get_proc_name): Add new argument to flag that a
708         module function entry is being treated. If true, correct
709         error condition, add symtree to module namespace and add
710         a module procedure.
711         (gfc_match_function_decl, gfc_match_entry,
712         gfc_match_subroutine): Use the new argument in calls to
713         get_proc_name.
714         * resolve.c (resolve_entries): ENTRY symbol reference to
715         to master entry namespace if a module function.
716         * trans-decl.c (gfc_create_module_variable): Return if
717         the symbol is an entry.
718         * trans-exp.c (gfc_conv_variable): Check that parent_decl
719         is not NULL.
720
721 2006-06-09  Jakub Jelinek  <jakub@redhat.com>
722
723         PR fortran/27916
724         * trans-openmp.c (gfc_omp_clause_default_ctor): New function.
725         * trans.h (gfc_omp_clause_default_ctor): New prototype.
726         * f95-lang.c (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): Define.
727
728 2006-06-08  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
729
730         PR fortran/27958
731         * trans-expr.c (gfc_conv_substring): If the substring start is
732         greater than its end, the length of the substring is zero, and
733         not negative.
734         (gfc_trans_string_copy): Don't generate a call to
735         _gfortran_copy_string when destination length is zero.
736
737 2006-06-08  Asher Langton  <langton2@llnl.gov>
738         
739         PR fortran/27786
740         * trans-array.c (gfc_conv_array_ref): Eliminate bounds checking
741         for assumed-size Cray pointees.
742
743 2006-06-08  Steven G. Kargl  <kargls@comcat.net>
744
745         * intrinsic.c (add_subroutine):  Make make_noreturn() conditional on
746         the appropriate symbol name.
747         
748 2006-06-07  Paul Thomas  <pault@gcc.gnu.org>
749
750         PR fortran/23091
751         * resolve.c (resolve_fl_variable): Error if an automatic
752         object has the SAVE attribute.
753
754         PR fortran/24168
755         * expr.c (simplify_intrinsic_op): Transfer the rank and
756         the locus to the simplified expression.
757
758         PR fortran/25090
759         PR fortran/25058
760         * gfortran.h : Add int entry_id to gfc_symbol.
761         * resolve.c : Add static variables current_entry_id and
762         specification_expr.
763         (resolve_variable): During code resolution, check if a
764         reference to a dummy variable in an executable expression
765         is preceded by its appearance as a parameter in an entry.
766         Likewise check its specification expressions.
767         (resolve_code): Update current_entry_id on EXEC_ENTRY.
768         (resolve_charlen, resolve_fl_variable): Set and reset
769         specifiaction_expr.
770         (is_non_constant_shape_array): Do not return on detection
771         of a variable but continue to resolve all the expressions.
772         (resolve_codes): set current_entry_id to an out of range
773         value.
774
775 2006-06-06  Mike Stump  <mrs@apple.com>
776
777         * Make-lang.in: Rename to htmldir to build_htmldir to avoid
778         installing during build.
779
780 2006-06-06  Paul Thomas  <pault@gcc.gnu.org>
781
782         PR fortran/27897
783         * match.c (gfc_match_common):  Fix code typo.  Remove
784         sym->name, since sym is NULL, and replace with name.
785
786 2006-06-05  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
787
788         PR libfortran/27895
789         * resolve.c (compute_last_value_for_triplet): New function.
790         (check_dimension): Correctly handle zero-sized array sections.
791         Add checking on last element of array sections.
792
793 2006-06-05  Steven G. Kargl  <kargls@comcast.net>
794
795         * data.c (gfc_assign_data_value):  Fix comment typo.  Remove
796         a spurious return.
797
798 2006-06-05  Paul Thomas  <pault@gcc.gnu.org>
799
800         PR fortran/14067
801         * data.c (create_character_intializer): Add warning message
802         for truncated string.
803
804         PR fortran/16943
805         * symbol.c : Include flags.h.
806         (gfc_add_type): If a procedure and types are the same do not
807         throw an error unless standard is less than gnu or pedantic.
808
809         PR fortran/20839
810         * parse.c (parse_do_block): Error if named block do construct
811         does not have a named enddo.
812
813         PR fortran/27655
814         * check.c (gfc_check_associated): Pick up EXPR_NULL for pointer
815         as well as target and put error return at end of function.
816
817 2006-06-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
818
819         * trans.c (gfc_msg_bounds, gfc_msg_fault, gfc_msg_wrong_return):
820         Add strings for common runtime error messages.
821         (gfc_trans_runtime_check): Add a locus argument, use a string
822         and not a string tree for the message.
823         * trans.h (gfc_trans_runtime_check): Change prototype accordingly.
824         (gfc_msg_bounds, gfc_msg_fault, gfc_msg_wrong_return): Add proto.
825         * trans-const.c (gfc_strconst_bounds, gfc_strconst_fault,
826         gfc_strconst_wrong_return, gfc_strconst_current_filename): Remove.
827         (gfc_init_constants): Likewise.
828         * trans-const.h: Likewise.
829         * trans-decl.c (gfc_build_builtin_function_decls): Call to
830         _gfortran_runtime_error has only one argument, the message string.
831         * trans-array.h (gfc_conv_array_ref): Add a symbol argument and a
832         locus.
833         * trans-array.c (gfc_trans_array_bound_check): Build precise
834         error messages.
835         (gfc_conv_array_ref): Use the new symbol argument and the locus
836         to build more precise error messages.
837         (gfc_conv_ss_startstride): More precise error messages.
838         * trans-expr.c (gfc_conv_variable): Give symbol reference and
839         locus to gfc_conv_array_ref.
840         (gfc_conv_function_call): Use the new prototype for
841         gfc_trans_runtime_check.
842         * trans-stmt.c (gfc_trans_goto): Build more precise error message.
843         * trans-io.c (set_string): Likewise.
844         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use new prototype
845         for gfc_trans_runtime_check.
846
847 2006-06-01  Thomas Koenig  <Thomas.Koenig@online.de>
848
849         PR fortran/27715
850         * arith.c:  Cast the characters from the strings to unsigned
851         char to avoid values less than 0 for extended ASCII.
852
853 2006-06-01  Per Bothner  <bothner@bothner.com>
854
855         * data.c (gfc_assign_data_value): Handle USE_MAPPED_LOCATION.
856         * scanner.c (gfc_gobble_whitespace): Likewise.
857
858 2006-06-01  Paul Thomas  <pault@gcc.gnu.org>
859
860         PR fortran/25098
861         PR fortran/25147
862         * interface.c (compare_parameter): Return 1 if the actual arg
863         is external and the formal is a procedure.
864         (compare_actual_formal): If the actual argument is a variable
865         and the formal a procedure, this an error.  If a gsymbol exists
866         for a procedure of the same name, this is not yet resolved and
867         the error is cleared.
868
869         * trans-intrinsic.c (gfc_conv_associated): Make provision for
870         zero array length or zero string length contingent on presence
871         of target, for consistency with standard.
872
873 2006-05-30  Asher Langton  <langton2@llnl.gov>
874
875         * symbol.c (check_conflict): Allow external, function, and
876         subroutine attributes with Cray pointees.
877         * trans-expr.c (gfc_conv_function_val): Translate Cray pointees
878         that point to procedures.
879         * gfortran.texi: Document new feature.
880
881 2006-05-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
882
883         PR fortran/27634
884         * io.c (check_format): Add error for missing period in format
885         specifier unless -std=legacy.
886         * gfortran.texi: Add description of expanded namelist read and
887         missing period in format extensions.
888
889 2006-05-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
890
891         PR fortran/19777
892         * trans-array.c (gfc_conv_array_ref): Perform out-of-bounds
893         checking for assumed-size arrrays for all but the last dimension.
894
895 2006-05-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
896
897         * invoke.texi: Change -fpackderived into -fpack-derived.
898
899 2006-05-29  Kazu Hirata  <kazu@codesourcery.com>
900
901         * options.c, primary.c, resolve.c, trans-common.c: Fix typos
902         in error messages.
903
904 2006-05-28  Kazu Hirata  <kazu@codesourcery.com>
905
906         * check.c, expr.c, resolve.c, trans-common.c,
907         trans-intrinsic.c, trans-stmt.c, trans-types.c: Fix comment typos.
908
909 2006-05-27  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
910
911         PR fortran/19777
912         * trans-array.c (gfc_conv_array_ref): Don't perform out-of-bounds
913         checking for assumed-size arrrays.
914
915 2006-05-27  Paul Thomas  <pault@gcc.gnu.org>
916
917         * trans-intrinsic.c (gfc_conv_associated): If pointer in first
918         arguments has zero array length of zero string length, return
919         false.
920
921 2006-05-26  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
922
923         PR fortran/27524
924         * trans-array.c (gfc_trans_dummy_array_bias): Don't use stride as
925         a temporary variable when -fbounds-check is enabled, since its
926         value will be needed later.
927
928 2006-05-26  Thomas Koenig  <Thomas.Koenig@online.de>
929
930         PR fortran/23151
931         * io.c (match_io):  print (1,*) is an error.
932
933 2006-05-26  Paul Thomas  <pault@gcc.gnu.org>
934
935         PR fortran/27709
936         * resolve.c (find_array_spec): Add gfc_symbol, derived, and
937         use to track repeated component references.
938
939         PR fortran/27155
940         PR fortran/27449
941         * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Use
942         se->string_length throughout and use memcpy to populate the
943         expression returned to the scalarizer.
944         (gfc_size_in_bytes): New function.
945
946 2006-05-21  Paul Thomas  <pault@gcc.gnu.org>
947
948         PR fortran/27613
949         * primary.c (gfc_match_rvalue): Test if symbol represents a
950         direct recursive function reference.  Error if array valued,
951         go to function0 otherwise.
952
953 2006-05-21  Paul Thomas  <pault@gcc.gnu.org>
954
955         PR fortran/25746
956         * interface.c (gfc_extend_assign): Use new EXEC_ASSIGN_CALL.
957         * gfortran.h : Put EXEC_ASSIGN_CALL in enum.
958         * trans-stmt.c (gfc_conv_elemental_dependencies): New function.
959         (gfc_trans_call): Call it.  Add new boolian argument to flag
960         need for dependency checking. Assert intent OUT and IN for arg1
961         and arg2.
962         (gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL.
963         trans-stmt.h : Modify prototype of gfc_trans_call.
964         trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL.
965         st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL.
966         * dependency.c (gfc_check_fncall_dependency): Don't check other
967         against itself.
968
969         PR fortran/25090
970         * resolve.c : Remove resolving_index_expr.
971         (entry_parameter): Remove.
972         (gfc_resolve_expr, resolve_charlen, resolve_fl_variable): Lift
973         calls to entry_parameter and references to resolving_index_expr.
974
975         PR fortran/27584
976         * check.c (gfc_check_associated): Replace NULL assert with an
977         error message, since it is possible to generate bad code that
978         has us fall through to here..
979
980         PR fortran/19015
981         * iresolve.c (maxloc, minloc): If DIM is not present, pass the
982         rank of ARRAY as the shape of the result.  Otherwise, pass the
983         shape of ARRAY, less the dimension DIM.
984         (maxval, minval): The same, when DIM is present, otherwise no
985         change.
986
987 2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>
988
989         PR fortran/27662
990         * trans-array.c (gfc_conv_expr_descriptor): Don't zero the
991         first stride to indicate a temporary.
992         * trans-expr.c (gfc_conv_function_call): Likewise.
993
994 2006-05-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
995             Feng Wang  <fengwang@nudt.edu.cn>
996
997         PR fortran/27552
998         * dump-parse-tree.c (gfc_show_expr): Deal with Hollerith constants.
999         * data.c (create_character_intializer): Set from_H flag if character is
1000         initialized by Hollerith constant.
1001
1002 2006-05-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1003
1004         PR fortran/26551
1005         * resolve.c (resolve_call, resolve_function): Issue an error
1006         if a function or subroutine call is recursive but the function or
1007         subroutine wasn't declared as such.
1008
1009 2006-05-07  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1010
1011         PR fortran/26551
1012         * gfortran.dg/recursive_check_1.f: New test.
1013
1014
1015 2006-05-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1016
1017         PR fortran/27320
1018         * dump-parse-tree.c (gfc_show_code_node): Try harder to find the
1019         called procedure name.
1020
1021 2006-05-17  Jakub Jelinek  <jakub@redhat.com>
1022
1023         PR middle-end/27415
1024         * trans-openmp.c (gfc_trans_omp_parallel_do,
1025         gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare): Set
1026         OMP_PARALLEL_COMBINED flag.
1027
1028 2006-05-16  H.J. Lu  <hongjiu.lu@intel.com>
1029
1030         PR driver/26885
1031         * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with
1032         $(GCC_OBJS).
1033
1034 2006-05-15  Paul Thomas  <pault@gcc.gnu.org>
1035
1036         PR fortran/25090
1037         * resolve.c: Static resolving_index_expr initialized.
1038         (entry_parameter): New function to emit errors for variables
1039         that are not entry parameters.
1040         (gfc_resolve_expr): Call entry_parameter, when resolving
1041         variables, if the namespace has entries and resolving_index_expr
1042         is set.
1043         (resolve_charlen): Set resolving_index_expr before the call to
1044         resolve_index_expr and reset it afterwards.
1045         (resolve_fl_variable): The same before and after the call to
1046         is_non_constant_shape_array, which ultimately makes a call to
1047         gfc_resolve_expr.
1048
1049         PR fortran/25082
1050         * resolve.c (resolve_code): Add error condition that the return
1051         expression must be scalar.
1052
1053         PR fortran/27411
1054         * matchexp.c (gfc_get_parentheses): New function.
1055         (match_primary): Remove inline code and call above.
1056         * gfortran.h: Provide prototype for gfc_get_parentheses.
1057         * resolve.c (resolve_array_ref): Call the above, when start is a
1058         derived type variable array reference.
1059
1060 2006-05-15  Jakub Jelinek  <jakub@redhat.com>
1061
1062         PR fortran/27446
1063         * trans-openmp.c (gfc_trans_omp_array_reduction): Ensure
1064         OMP_CLAUSE_REDUCTION_{INIT,MERGE} are set to BIND_EXPR.
1065
1066 2006-05-14  H.J. Lu  <hongjiu.lu@intel.com>
1067
1068         * Make-lang.in (fortran/options.o): Depend on $(TARGET_H).
1069
1070 2006-05-11  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1071
1072         PR fortran/27553
1073         * parse.c (next_free): Return instead of calling decode_statement
1074         upon error.
1075
1076 2005-05-10  Thomas Koenig  <Thomas.Koenig@online.de>
1077
1078         PR fortran/27470
1079         * trans-array.c(gfc_array_allocate):  If ref->next exists
1080         that is if there is a statement like ALLOCATE(foo%bar(2)),
1081         F95 rules require that bar should be a pointer.
1082
1083 2006-05-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1084
1085         PR fortran/20460
1086         * resolve.c (gfc_resolve_index): Make REAL array indices a
1087         GFC_STD_LEGACY feature.
1088
1089 2006-05-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1090
1091         PR fortran/24549
1092         * parse.c (reject_statement): Clear gfc_new_block.
1093
1094 2006-05-09  Steven G. Kargl  <kargls@comcast.net>
1095
1096         * invoke.texi: Missed file in previous commit.  Update
1097          description of -fall-intrinsics
1098
1099 2006-05-07  Steven Boscher  <steven@gcc.gnu.org>
1100
1101         PR fortran/27378
1102         * parse.c (next_statement): Add check to avoid an ICE when
1103         gfc_current_locus.lb is not set.
1104
1105 2006-05-07  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
1106
1107         PR fortran/27457
1108         * match.c (match_case_eos): Error out on garbage following
1109         CASE(...).
1110
1111 2006-05-07  Paul Thomas  <pault@gcc.gnu.org>
1112
1113         PR fortran/24813
1114         * trans-array.c (get_array_ctor_strlen): Remove static attribute.
1115         * trans.h: Add prototype for get_array_ctor_strlen.
1116         * trans-intrinsic.c (gfc_conv_intrinsic_len): Switch on EXPR_ARRAY
1117         and call get_array_ctor_strlen.
1118
1119 2006-05-05  Steven G. Kargl  <kargls@comcast.net>
1120
1121         * invoke.texi: Update description of -fall-intrinsics
1122         * options.c (gfc_post_options): Disable -Wnonstd-intrinsics if
1123         -fall-intrinsics is used.
1124         (gfc_handle_option): Permit -Wno-nonstd-intrinsics.
1125
1126 2006-05-04  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
1127
1128         * simplify.c (ascii_table): Fix wrong entry.
1129
1130 2006-05-02  Steven G. Kargl  <kargls@comcast.net>
1131
1132         PR fortran/26896
1133         * lang.opt: Fix -Wtab description
1134
1135         PR fortran/20248  
1136         * lang.opt: New flag -fall-intrinsics.
1137         * invoke.texi:  Document option.
1138         * gfortran.h (options_t):  New member flag_all_intrinsics.
1139         * options.c (gfc_init_options, gfc_handle_option): Set new option.
1140         sort nearby misplaced options.
1141         * intrinsic.c (add_sym, make_generic, make_alias):  Use it.
1142  
1143 2006-05-02 Paul Thomas <pault@gcc.gnu.org>
1144
1145         PR fortran/27269
1146         * module.c: Add static flag in_load_equiv.
1147         (mio_expr_ref): Return if no symtree and in_load_equiv.
1148         (load_equiv): If any of the equivalence members have no symtree, free
1149         the equivalence and the associated expressions.
1150
1151         PR fortran/27324
1152         * trans-common.c (gfc_trans_common): Invert the order of calls to
1153         finish equivalences and gfc_commit_symbols.
1154
1155 2006-04-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
1156
1157         PR fortran/25681
1158         * simplify.c (simplify_len): Character variables with constant
1159         length can be simplified.
1160
1161 2006-04-29  H.J. Lu  <hongjiu.lu@intel.com>
1162
1163         PR fortran/27351
1164         * trans-array.c (gfc_conv_array_transpose): Move gcc_assert
1165         before gfc_conv_expr_descriptor.
1166
1167 2006-04-23  Paul Thomas  <pault@gcc.gnu.org>
1168
1169         PR fortran/25099
1170         * resolve.c (resolve_call): Check conformity of elemental
1171         subroutine actual arguments.
1172
1173 2006-04-22  Jakub Jelinek  <jakub@redhat.com>
1174
1175         PR fortran/26769
1176         * iresolve.c (gfc_resolve_reshape): Use reshape_r16 for real(16).
1177         (gfc_resolve_transpose): Use transpose_r16 for real(16).
1178
1179 2006-04-21 Paul Thomas <pault@gcc.gnu.org>
1180
1181         PR fortran/27122
1182         * resolve.c (resolve_function): Remove general restriction on auto
1183         character length function interfaces.
1184         (gfc_resolve_uops): Check restrictions on defined operator
1185         procedures.
1186         (resolve_types): Call the check for defined operators.
1187
1188         PR fortran/27113
1189         * trans-array.c (gfc_trans_array_constructor_subarray): Remove
1190         redundant gfc_todo_error.
1191         (get_array_ctor_var_strlen): Remove typo in enum.
1192
1193 2006-04-18  Bernhard Fischer  <aldot@gcc.gnu.org>
1194
1195         * parse.c (next_free): Use consistent error string between
1196         free-form and fixed-form for illegal statement label of zero.
1197         (next_fixed): Use consistent warning string between free-form
1198         and fixed-form for statement labels for empty statements.
1199
1200 2006-04-18  Steve Ellcey  <sje@cup.hp.com>
1201
1202         * trans-io.c (gfc_build_io_library_fndecls): Align pad.
1203
1204 2006-04-16  Thomas Koenig  <Thomas.Koenig@online.de>
1205
1206         PR fortran/26017
1207         * trans-array.c(gfc_array_init_size):  Introduce or_expr
1208         which is true if the size along any dimension
1209         is negative.  Create a temporary variable with base
1210         name size.  If or_expr is true, set the temporary to 0,
1211         to the normal size otherwise.
1212
1213 2006-04-16  Paul Thomas  <pault@gcc.gnu.org>
1214
1215         PR fortran/26822
1216         * intrinsic.c (add_functions): Mark LOGICAL as elemental.
1217
1218         PR fortran/26787
1219         * expr.c (gfc_check_assign): Extend scope of error to include
1220         assignments to a procedure in the main program or, from a
1221         module or internal procedure that is not that represented by
1222         the lhs symbol. Use VARIABLE rather than l-value in message.
1223
1224         PR fortran/27096
1225         * trans-array.c (gfc_trans_deferred_array): If the backend_decl
1226         is not a descriptor, dereference and then test and use the type.
1227
1228         PR fortran/25597
1229         * trans-decl.c (gfc_trans_deferred_vars): Check if an array
1230         result, is also automatic character length.  If so, process
1231         the character length.
1232
1233         PR fortran/18003
1234         PR fortran/25669
1235         PR fortran/26834
1236         * trans_intrinsic.c (gfc_walk_intrinsic_bound): Set
1237         data.info.dimen for bound intrinsics.
1238         * trans_array.c (gfc_conv_ss_startstride): Pick out LBOUND and
1239         UBOUND intrinsics and supply their shape information to the ss
1240         and the loop.
1241
1242         PR fortran/27124
1243         * trans_expr.c (gfc_trans_function_call):  Add a new block, post,
1244         in to which all the argument post blocks are put.  Add this block
1245         to se->pre after a byref call or to se->post, otherwise.
1246
1247 2006-04-14  Roger Sayle  <roger@eyesopen.com>
1248
1249         * trans-io.c (set_string): Use fold_build2 and build_int_cst instead
1250         of build2 and convert to construct "x < 0" rather than "x <= -1".
1251
1252 2006-04-13  Richard Henderson  <rth@redhat.com>
1253
1254         * trans-openmp.c (gfc_trans_omp_sections): Adjust for changed
1255         number of operands to OMP_SECTIONS.
1256
1257 2006-04-08  Kazu Hirata  <kazu@codesourcery.com>
1258
1259         * gfortran.texi: Fix typos.  Follow spelling conventions.
1260         * resolve.c, trans-expr.c, trans-stmt.c: Fix comment typos.
1261         Follow spelling conventions.
1262
1263 2006-04-05  Roger Sayle  <roger@eyesopen.com>
1264
1265         * dependency.c (get_no_elements): Delete function.
1266         (get_deps): Delete function.
1267         (transform_sections): Delete function.
1268         (gfc_check_section_vs_section): Significant rewrite.
1269
1270 2006-04-04  H.J. Lu  <hongjiu.lu@intel.com>
1271
1272         PR fortran/25619
1273         * trans-array.c (gfc_conv_expr_descriptor): Only dereference
1274         character pointer when copying temporary.
1275
1276         PR fortran/23634
1277         * trans-array.c (gfc_conv_expr_descriptor): Properly copy
1278         temporary character with non constant size.
1279
1280 2006-04-03  Paul Thomas  <pault@gcc.gnu.org>
1281
1282         PR fortran/26891
1283         * trans.h: Prototype for gfc_conv_missing_dummy.
1284         * trans-expr (gfc_conv_missing_dummy): New function
1285         (gfc_conv_function_call): Call it and tidy up some of the code.
1286         * trans-intrinsic (gfc_conv_intrinsic_function_args): The same.
1287
1288         PR fortran/26976
1289         * array.c (gfc_array_dimen_size): If available, return shape[dimen].
1290         * resolve.c (resolve_function): If available, use the argument
1291         shape for the function expression.
1292         * iresolve.c (gfc_resolve_transfer): Set shape[0] = size.
1293
1294 2006-04-02  Erik Edelmann  <eedelman@gcc.gnu.org>
1295
1296         * trans-array.c (gfc_trans_dealloc_allocated): Take a
1297         tree representation of the array to be deallocated as argument
1298         instead of its gfc_symbol.
1299         (gfc_trans_deferred_array): Update call to
1300         gfc_trans_dealloc_allocated.
1301         * trans-array.h (gfc_trans_dealloc_allocated): Update
1302         prototype.
1303         * trans-expr.c (gfc_conv_function_call): Update call to
1304         gfc_trans_dealloc_allocated, get indirect reference to dummy
1305         arguments.
1306
1307 2006-04-01  Roger Sayle  <roger@eyesopen.com>
1308
1309         PR fortran/25270
1310         * trans-array.c (gfc_trans_allocate_array_storage): In array index
1311         calculations use gfc_index_zero_node and gfc_index_one_node instead
1312         of integer_zero_node and integer_one_node respectively.
1313         (gfc_conv_array_transpose): Likewise.
1314         (gfc_conv_ss_startstride): Likewise.
1315         (gfc_trans_dummy_array_bias): Likewise.
1316
1317 2006-04-01  Roger Sayle  <roger@eyesopen.com>
1318
1319         * dependency.c (gfc_is_inside_range): Delete.
1320         (gfc_check_element_vs_section): Significant rewrite.
1321
1322 2006-04-01  Roger Sayle  <roger@eyesopen.com>
1323
1324         * dependency.c (gfc_dep_compare_expr): Strip parentheses and unary
1325         plus operators when comparing expressions.  Handle comparisons of
1326         the form "X+C vs. X", "X vs. X+C", "X-C vs. X" and "X vs. X-C" where
1327         C is an integer constant.  Handle comparisons of the form "P+Q vs.
1328         R+S" and "P-Q vs. R-S".  Handle comparisons of integral extensions
1329         specially (increasing functions) so extend(A) > extend(B), when A>B.
1330         (gfc_check_element_vs_element): Move test later, so that we ignore
1331         the fact that "A < B" or "A > B" when A or B contains a forall index.
1332
1333 2006-03-31  Asher Langton  <langton2@llnl.gov>
1334
1335         PR fortran/25358
1336         * expr.c (gfc_check_assign): Allow cray pointee to be assumes-size.
1337         
1338 2006-03-30  Paul Thomas <paulthomas2@wanadoo.fr>
1339             Bud Davis  <bdavis9659@sbcglobal.net>
1340
1341         PR 21130
1342         * module.c (load_needed): Traverse entire tree before returning.
1343
1344 2006-03-30  Roger Sayle  <roger@eyesopen.com>
1345
1346         PR middle-end/22375
1347         * trans.c (gfc_trans_runtime_check): Promote the arguments of
1348         __builtin_expect to the correct types, and the result back to
1349         boolean_type_node.
1350
1351 2006-03-29  Carlos O'Donell  <carlos@codesourcery.com>
1352
1353         * Make-lang.in: Rename docdir to gcc_docdir.
1354
1355 2006-03-28  Steven G. Kargl  <kargls@comcast.net>
1356
1357         * intrinsic.texi: s/floor/float in previous commit.
1358
1359 2006-03-28 Paul Thomas <pault@gcc.gnu.org>
1360
1361         PR fortran/26779
1362         * resolve.c (resolve_fl_procedure): Do not check the access of
1363         derived types for internal procedures.
1364
1365 2006-03-27  Jakub Jelinek  <jakub@redhat.com>
1366
1367         * io.c (check_io_constraints): Don't look at
1368         dt->advance->value.charater.string, unless it is a CHARACTER
1369         constant.
1370
1371         * f95-lang.c (gfc_get_alias_set): New function.
1372         (LANG_HOOKS_GET_ALIAS_SET): Define.
1373
1374 2006-03-25  Steven G. Kargl  <kargls@comcast.net>
1375
1376         PR fortran/26816
1377         * intrinsic.c (add_functions): Allow FLOAT to accept all integer kinds.
1378         * intrinsic.texi: Document FLOAT.
1379
1380 2006-03-25  Thomas Koenig  <Thomas.Koenig@online.de>
1381
1382         PR fortran/26769
1383         * iresolve.c (gfc_resolve_reshape):  Remove doubling of
1384         kind for complex. For real(kind=10), call reshape_r10.
1385         (gfc_resolve_transpose):  For real(kind=10), call
1386         transpose_r10.
1387
1388 2006-03-25  Roger Sayle  <roger@eyesopen.com>
1389
1390         * dependency.c (gfc_check_dependency): Improve handling of pointers;
1391         Two variables of different types can't have a dependency, and two
1392         variables with the same symbol are equal, even if pointers.
1393
1394 2006-03-24  Roger Sayle  <roger@eyesopen.com>
1395
1396         * gfortran.h (gfc_symbol): Add a new "forall_index" bit field.
1397         * match.c (match_forall_iterator): Set forall_index field on
1398         the iteration variable's symbol.
1399         * dependency.c (contains_forall_index_p): New function to
1400         traverse a gfc_expr to check whether it contains a variable
1401         with forall_index set in it's symbol.
1402         (gfc_check_element_vs_element): Return GFC_DEP_EQUAL for scalar
1403         constant expressions that don't variables used as FORALL indices.
1404
1405 2006-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1406
1407         PR driver/22600
1408         * error.c (gfc_fatal_error): Return ICE_EXIT_CODE instead of 4.
1409
1410 2006-03-22  Thomas Koenig  <Thomas.Koenig@online.de>
1411
1412         PR fortran/19303
1413         * gfortran.h (gfc_option_t):  Add record_marker.
1414         * lang.opt:  Add -frecord-marker=4 and -frecord-marker=8.
1415         * trans-decl.c:  Add gfor_fndecl_set_record_marker.
1416         (gfc_build_builtin_function_decls): Set
1417         gfor_fndecl_set_record_marker.
1418         (gfc_generate_function_code):  If we are in the main program
1419         and -frecord-marker was provided, call set_record_marker.
1420         * options.c (gfc_handle_option):  Add handling for
1421         -frecord-marker=4 and -frecord-marker=8.
1422         * invoke.texi:  Document -frecord-marker.
1423
1424 2006-03-22  Paul Thomas  <pault@gcc.gnu.org>
1425
1426         PR fortran/17298
1427         * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): New
1428         function to implement array valued TRANSFER intrinsic.
1429         (gfc_conv_intrinsic_function): Call the new function if TRANSFER
1430         and non-null se->ss.
1431         (gfc_walk_intrinsic_function): Treat TRANSFER as one of the
1432         special cases by calling gfc_walk_intrinsic_libfunc directly.
1433
1434 2006-03-21  Toon Moene  <toon@moene.indiv.nluug.nl>
1435
1436         * options.c (gfc_init_options): Initialize
1437         flag_argument_noalias to 3.
1438
1439 2006-03-20  Thomas Koenig  <Thomas.Koenig@online.de>
1440
1441         PR fortran/20935
1442         * iresolve.c (gfc_resolve_maxloc):   If mask is scalar,
1443         prefix the function name with an "s".  If the mask is scalar
1444         or if its kind is smaller than gfc_default_logical_kind,
1445         coerce it to default kind.
1446         (gfc_resolve_maxval):  Likewise.
1447         (gfc_resolve_minloc):  Likewise.
1448         (gfc_resolve_minval):  Likewise.
1449         (gfc_resolve_product):  Likewise.
1450         (gfc_resolve_sum):  Likewise.
1451
1452 2006-03-19  Paul Thomas  <pault@gcc.gnu.org>
1453
1454         PR fortran/26741
1455         *expr.c (external_spec_function): Permit elemental functions.
1456
1457         PR fortran/26716
1458         *interface.c (compare_actual_formal): Detect call for procedure
1459         usage and require rank checking, in this case, for assumed shape
1460         and deferred shape arrays.
1461         (gfc_procedure_use): Revert to pre-PR25070 call to
1462         compare_actual_formal that does not require rank checking..
1463
1464 2006-03-16  Roger Sayle  <roger@eyesopen.com>
1465
1466         * gfortran.h (gfc_equiv_info): Add length field.
1467         * trans-common.c (copy_equiv_list_to_ns): Set the length field.
1468         * dependency.c (gfc_are_equivalenced_arrays): Use both the offset
1469         and length fields to determine whether the two equivalenced symbols
1470         overlap in memory.
1471
1472 2006-03-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1473
1474         PR fortran/19101
1475         * gfortran.h: Add warn_ampersand.
1476         * invoke.texi: Add documentation for new option.
1477         * lang.opt: Add Wampersand.
1478         * options.c (gfc_init_options): Initialize warn_ampersand.
1479         (gfc_post_options): Set the warn if pedantic.
1480         (set_Wall): Set warn_ampersand.
1481         (gfc_handle_option: Add Wampersand for itself, -std=f95, and -std=f2003.
1482         * scanner.c (gfc_next_char_literal): Add test for missing '&' in
1483         continued character constant and give warning if missing.
1484
1485 2006-03-14  Steven G. Kargl  <kargls@comcast.net>
1486
1487         PR 18537
1488         * gfortran.h: Wrap Copyright line.
1489         (gfc_option_t): add warn_tabs member.
1490         * lang.opt: Update Coyright year.  Add the Wtabs.
1491         * invoke.texi: Document -Wtabs.
1492         * scanner.c (gfc_gobble_whitespace): Use warn_tabs.  Add linenum to
1493         suppress multiple warnings.
1494         (load_line): Use warn_tabs.  Add linenum, current_line, seen_comment
1495         to suppress multiple warnings.
1496         * options.c (gfc_init_options): Initialize warn_tabs.
1497         (set_Wall): set warn_tabs for -Wall.
1498         (gfc_post_options): Adjust flag_tabs depending on -pedantic.
1499         (gfc_handle_option):  Process command-line option -W[no-]tabs
1500
1501 2006-03-13  Paul Thomas  <pault@gcc.gnu.org>
1502
1503         PR fortran/25378
1504         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set the initial position to zero and
1505         modify the condition for updating it, to implement the F2003 requirement for all(mask)
1506         is false.
1507
1508 2006-03-13  Jakub Jelinek  <jakub@redhat.com>
1509
1510         * trans-openmp.c (gfc_trans_omp_variable): Handle references
1511         to parent result.
1512         * trans-expr.c (gfc_conv_variable): Remove useless setting
1513         of parent_flag, formatting.
1514
1515         * trans-decl.c (gfc_get_fake_result_decl): Re-add setting of
1516         GFC_DECL_RESULT flag.
1517
1518 2003-03-11  Roger Sayle  <roger@eyesopen.com>
1519
1520         * dependency.c (gfc_dep_compare_expr) <EXPR_OP>: Allow unary and
1521         binary operators to compare equal if their operands are equal.
1522         <EXPR_FUNCTION>: Allow "constant" intrinsic conversion functions
1523         to compare equal, if their operands are equal.
1524
1525 2006-03-11  Erik Edelmann  <eedelman@gcc.gnu.org>
1526
1527         * symbol.c (check_conflict): Allow allocatable function results,
1528         except for elemental functions.
1529         * trans-array.c (gfc_trans_allocate_temp_array): Rename to ...
1530         (gfc_trans_create_temp_array): ... this, and add new argument
1531         callee_alloc.
1532         (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call
1533         to gfc_trans_allocate_temp_array.
1534         * trans-array.h (gfc_trans_allocate_temp_array): Update prototype.
1535         * trans-expr.c (gfc_conv_function_call): Use new arg of
1536         gfc_trans_create_temp_array avoid pre-allocation of temporary
1537         result variables of pointer AND allocatable functions.
1538         (gfc_trans_arrayfunc_assign): Return NULL for allocatable
1539         functions.
1540         * resolve.c (resolve_symbol): Copy value of 'allocatable' attribute
1541         from sym->result to sym.
1542
1543 2006-03-09  Erik Edelmann  <eedelman@gcc.gnu.org>
1544
1545         * trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
1546         attribute from sym to new_sym.  Call build_fold_indirect_ref()
1547         for allocatable arguments.
1548
1549 2006-03-09 Paul Thomas <pault@gcc.gnu.org>
1550
1551         PR fortran/26257
1552         * trans-array.c (gfc_conv_expr_descriptor): Exclude calculation of
1553         the offset and data when se->data_not_needed is set.
1554         * trans.h: Include the data_not_need bit in gfc_se.
1555         * trans-intrinsic.c (gfc_conv_intrinsic_size): Set it for SIZE.
1556
1557 2006-03-06  Paul Thomas  <pault@gcc.gnu.org>
1558             Erik Edelmann  <eedelman@gcc.gnu.org>
1559
1560         * trans-array.c (gfc_trans_dealloc_allocated): New function.
1561         (gfc_trans_deferred_array): Use it, instead of inline code.
1562         * trans-array.h: Prototype for gfc_trans_dealloc_allocated().
1563         * trans-expr.c (gfc_conv_function_call): Deallocate allocated
1564         ALLOCATABLE, INTENT(OUT) arguments upon procedure entry.
1565
1566 2006-03-06  Paul Thomas  <pault@gcc.gnu.org>
1567
1568         PR fortran/26107
1569         * resolve.c (resolve_function): Add name after test for pureness.
1570
1571         PR fortran/19546
1572         * trans-expr.c (gfc_conv_variable): Detect reference to parent result,
1573         store current_function_decl, replace with parent, whilst calls are
1574         made to gfc_get_fake_result_decl, and restore afterwards. Signal this
1575         to gfc_get_fake_result_decl with a new argument, parent_flag.
1576         * trans-stmt.c (gfc_trans_return): gfc_get_fake_result_decl 2nd arg
1577         is set to zero.
1578         * trans.h: Add parent_flag to gfc_get_fake_result_decl prototype.
1579         * trans-decl.c (gfc_get_fake_result_decl): On parent_flag, being set,
1580         add decl to parent function. Replace refs to current_fake_result_decl
1581         with refs to this_result_decl.
1582         (gfc_generate_function_code): Null parent_fake_result_decl before the
1583         translation of code for contained procedures. Set parent_flag to zero
1584         in call to gfc_get_fake_result_decl.
1585         * trans-intrinsic.c (gfc_conv_intrinsic_len): The same.
1586
1587 2006-03-05  Steven G. Kargl  <kargls@comcast.net>
1588
1589         * simplify.c (gfc_simplify_verify):  Fix return when SET=''.
1590
1591 2006-03-05  Erik Edelmann  <eedelman@gcc.gnu.org>
1592
1593         PR fortran/16136
1594         * symbol.c (conf_std): New macro.
1595         (check_conflict): Use it to allow ALLOCATABLE dummy
1596         arguments for F2003.
1597         * trans-expr.c (gfc_conv_function_call): Pass the
1598         address of the array descriptor when dummy argument is
1599         ALLOCATABLE.
1600         * interface.c (compare_allocatable): New function.
1601         (compare_actual_formal): Use it.
1602         * resolve.c (resolve_deallocate_expr,
1603         resolve_allocate_expr): Check that INTENT(IN) variables
1604         aren't (de)allocated.
1605         * gfortran.texi (Fortran 2003 status): List ALLOCATABLE
1606         dummy arguments as supported.
1607
1608 2006-03-03  Roger Sayle  <roger@eyesopen.com>
1609
1610         * dependency.c (gfc_check_element_vs_element): Revert last change.
1611
1612 2006-03-03  Roger Sayle  <roger@eyesopen.com>
1613
1614         * dependency.c (gfc_check_element_vs_element): Consider two
1615         unordered scalar subscripts as (potentially) equal.
1616
1617 2006-03-03  Roger Sayle  <roger@eyesopen.com>
1618
1619         * dependency.c (gfc_check_dependency): Call gfc_dep_resolver to
1620         check whether two array references have a dependency.
1621         (gfc_check_element_vs_element): Assume lref and rref must be
1622         REF_ARRAYs.  If gfc_dep_compare_expr returns -2, assume these
1623         references could potentially overlap.
1624         (gfc_dep_resolver): Whitespace and comment tweaks.  Assume a
1625         dependency if the references have different depths.  Rewrite
1626         final term to clarrify we only have a dependency for overlaps.
1627
1628 2006-03-03  Thomas Koenig  <Thomas.Koenig@online.de>
1629
1630         PR fortran/25031
1631         * trans-array.h:  Adjust gfc_array_allocate prototype.
1632         * trans-array.c (gfc_array_allocate):  Change type of
1633         gfc_array_allocatate to bool.  Function returns true if
1634         it operates on an array.  Change second argument to gfc_expr.
1635         Find last reference in chain.
1636         If the function operates on an allocatable array, emit call to
1637         allocate_array() or allocate64_array().
1638         * trans-stmt.c (gfc_trans_allocate):  Code to follow to last
1639         reference has been moved to gfc_array_allocate.
1640         * trans.h:  Add declaration for gfor_fndecl_allocate_array and
1641         gfor_fndecl_allocate64_array.
1642         (gfc_build_builtin_function_decls):  Add gfor_fndecl_allocate_array
1643         and gfor_fndecl_allocate64_array.
1644
1645 2006-03-01  Roger Sayle  <roger@eyesopen.com>
1646
1647         * trans-stmt.c (generate_loop_for_temp_to_lhs): Add an additional
1648         INVERT argument to invert the sense of the WHEREMASK argument.
1649         Remove unneeded code to AND together a list of masks.
1650         (generate_loop_for_rhs_to_temp): Likewise.
1651         (gfc_trans_assign_need_temp): Likewise.
1652         (gfc_trans_forall_1): Likewise.
1653         (gfc_evaluate_where_mask): Likewise, add a new INVERT argument
1654         to specify the sense of the MASK argument.
1655         (gfc_trans_where_assign): Likewise.
1656         (gfc_trans_where_2): Likewise.  Restructure code that decides
1657         whether we need to allocate zero, one or two temporary masks.
1658         If this is a top-level WHERE (i.e. the incoming MASK is NULL),
1659         we only need to allocate at most one temporary mask, and can
1660         invert it's sense to provide the complementary pending execution
1661         mask.  Only calculate the size of the required temporary arrays
1662         if we need any.
1663         (gfc_trans_where): Update call to gfc_trans_where_2.
1664
1665 2006-03-01  Paul Thomas  <pault@gcc.gnu.org>
1666
1667         * iresolve.c (gfc_resolve_dot_product):  Remove any difference in
1668         treatment of logical types.
1669         * trans-intrinsic.c (gfc_conv_intrinsic_dot_product):  New function. 
1670
1671         PR fortran/26393
1672         * trans-decl.c (gfc_get_symbol_decl): Extend condition that symbols
1673         must be referenced to include unreferenced symbols in an interface
1674         body. 
1675
1676         PR fortran/20938
1677         * trans-array.c (gfc_conv_resolve_dependencies): Add call to
1678         gfc_are_equivalenced_arrays.
1679         * symbol.c (gfc_free_equiv_infos, gfc_free_equiv_lists): New
1680         functions. (gfc_free_namespace): Call them.
1681         * trans-common.c (copy_equiv_list_to_ns): New function.
1682         (add_equivalences): Call it.
1683         * gfortran.h: Add equiv_lists to gfc_namespace and define
1684         gfc_equiv_list and gfc_equiv_info.
1685         * dependency.c (gfc_are_equivalenced_arrays): New function.
1686         (gfc_check_dependency): Call it.
1687         * dependency.h: Prototype for gfc_are_equivalenced_arrays.
1688
1689 2006-03-01  Roger Sayle  <roger@eyesopen.com>
1690
1691         * dependency.c (gfc_is_same_range): Compare the stride, lower and
1692         upper bounds when testing array reference ranges for equality.
1693         (gfc_check_dependency): Fix indentation whitespace.
1694         (gfc_check_element_vs_element): Likewise.
1695         (gfc_dep_resolver): Likewise.
1696
1697 2006-02-28  Thomas Koenig  <Thomas.Koenig@online.de>
1698
1699         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
1700         If the mask expression exists and has rank 0, enclose the
1701         generated loop in an "if (mask)".  Put the default
1702         initialization into the else branch.
1703
1704 2006-02-25  Thomas Koenig  <Thomas.Koenig@online.de>
1705
1706         PR fortran/23092
1707         * trans-intrinsic.c (gfc_conv_intrinsic_arith):  If the
1708         mask expression exists and has rank 0, enclose the generated
1709         loop in an "if (mask)".
1710         * (gfc_conv_intrinsic_minmaxloc):  Likewise.
1711
1712 2006-02-24  Paul Thomas  <pault@gcc.gnu.org>
1713
1714         PR fortran/26409
1715         * resolve.c (resolve_contained_functions, resolve_types,
1716         gfc_resolve): Revert patch of 2006-02-19.
1717
1718 2006-02-24  Paul Thomas  <pault@gcc.gnu.org>
1719
1720         PR fortran/24519
1721         * dependency.c (gfc_is_same_range): Correct typo.
1722         (gfc_check_section_vs_section): Call gfc_is_same_range.
1723
1724         PR fortran/25395
1725         * trans-common.c (add_equivalences): Add a new flag that is set when
1726         an equivalence is seen that prevents more from being reset until the
1727         start of a new traversal of the list, thus ensuring completion of
1728         all the equivalences.
1729
1730 2006-02-23  Erik Edelmann  <eedelman@gcc.gnu.org>
1731
1732         * module.c (read_module): Remove redundant code lines.
1733
1734 2006-02-20 Rafael \81Ávila de Esp\81índola <rafael.espindola@gmail.com>
1735         * Make-lang.in (FORTRAN): Remove
1736         (.PHONY): Remove F95 and f95. Add fortran
1737
1738 2006-02-20  Roger Sayle  <roger@eyesopen.com>
1739
1740         * trans-stmt.c (gfc_trans_where_2): Avoid updating unused current
1741         execution mask for empty WHERE/ELSEWHERE clauses.  Don't allocate
1742         temporary mask arrays if they won't be used.
1743
1744 2006-02-20  Roger Sayle  <roger@eyesopen.com>
1745
1746         * trans-stmt.c (gfc_trans_where_assign): Remove code to handle
1747         traversing a linked list of MASKs.  The MASK is now always a
1748         single element requiring no ANDing during the assignment.
1749
1750 2006-02-19  Thomas Koenig  <Thomas.Koenig@online.de>
1751
1752         * gfortran.texi:  Document environment variables which
1753         influence runtime behavior.
1754
1755 2006-02-19  H.J. Lu  <hongjiu.lu@intel.com>
1756
1757         * resolve.c (resolve_contained_functions): Call resolve_entries
1758         first.
1759         (resolve_types): Remove calls to resolve_entries and
1760         resolve_contained_functions.
1761         (gfc_resolve): Call resolve_contained_functions.
1762
1763 2006-02-19  Erik Edelmann  <eedelman@gcc.gnu.org>
1764
1765         PR fortran/26201
1766         * intrinsic.c (gfc_convert_type_warn): Call
1767         gfc_intrinsic_symbol() on the newly created symbol.
1768
1769 2006-02-19  Paul Thomas  <pault@gcc.gnu.org>
1770
1771         PR fortran/25054
1772         * resolve.c (is_non_constant_shape_array): New function.
1773         (resolve_fl_variable): Remove code for the new function and call it.
1774         (resolve_fl_namelist): New function.  Add test for namelist array
1775         with non-constant shape, using is_non_constant_shape_array.
1776         (resolve_symbol): Remove code for resolve_fl_namelist and call it.
1777
1778         PR fortran/25089
1779         * match.c (match_namelist): Increment the refs field of an accepted
1780         namelist object symbol.
1781         * resolve.c (resolve_fl_namelist): Test namelist objects for a conflict
1782         with contained or module procedures.
1783
1784 2006-02-18  Roger Sayle  <roger@eyesopen.com>
1785
1786         * trans-stmt.c (struct temporary_list): Delete.
1787         (gfc_trans_where_2): Major reorganization.  Remove no longer needed
1788         TEMP argument.  Allocate and deallocate the control mask and
1789         pending control mask locally.
1790         (gfc_trans_forall_1): Delete TEMP local variable, and update
1791         call to gfc_trans_where_2.  No need to deallocate arrays after.
1792         (gfc_evaluate_where_mask): Major reorganization.  Change return
1793         type to void.  Pass in parent execution mask, MASK, and two
1794         already allocated mask arrays CMASK and PMASK.  On return
1795         CMASK := MASK & COND, PMASK := MASK & !COND.  MASK, CMASK and
1796         CMASK may all be NULL, or refer to the same temporary arrays.
1797         (gfc_trans_where): Update call to gfc_trans_where_2.  We no
1798         longer need a TEMP variable or to deallocate temporary arrays
1799         allocated by gfc_trans_where_2.
1800
1801 2006-02-18   Danny Smith  <dannysmith@users.sourceforeg.net>
1802
1803         * gfortran.h (gfc_add_attribute): Change uint to unsigned int.
1804         * symbol.c (gfc_add_attribute): Likewise for definition.
1805         * resolve.c (resolve_global_procedure): Likewise for variable 'type'.
1806
1807 2006-02-17  Richard Sandiford  <richard@codesourcery.com>
1808
1809         * trans-common.c: Include rtl.h earlier.
1810         * trans-decl.c: Likewise.
1811
1812 2006-02-16  Jakub Jelinek  <jakub@redhat.com>
1813
1814         PR fortran/26224
1815         * parse.c (parse_omp_do, parse_omp_structured_block): Call
1816         gfc_commit_symbols and gfc_warning_check.
1817
1818         * openmp.c (resolve_omp_clauses): Add a dummy case label to workaround
1819         PR middle-end/26316.
1820
1821 2006-02-16  Paul Thomas  <pault@gcc.gnu.org>
1822
1823         PR fortran/24557
1824         * trans-expr.c (gfc_add_interface_mapping): Use the actual argument
1825         for character(*) arrays, rather than casting to the type and kind
1826         parameters of the formal argument.
1827
1828 2006-02-15  Toon Moene  <toon@moene.indiv.nluug.nl>
1829
1830         PR fortran/26054
1831         * options.c: Do not warn for Fortran 2003 features by default.
1832
1833 2006-02-15  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
1834
1835         * check.c: Update copyright years.
1836         
1837         * check.c (gfc_check_minloc_maxloc, check_reduction): Don't call
1838         dim_range_check on not-present optional dim argument.
1839
1840 2006-02-15  Jakub Jelinek  <jakub@redhat.com>
1841
1842         PR libgomp/25938
1843         PR libgomp/25984
1844         * Make-lang.in (install-finclude-dir): New goal.
1845         (fortran.install-common): Depend on install-finclude-dir.
1846         * lang-specs.h: If not -nostdinc, add -I finclude.
1847
1848 2006-02-14  Thomas Koenig  <Thomas.Koenig@online.de>
1849
1850         PR fortran/25045
1851         * check.c (dim_check):  Perform all checks if dim is optional.
1852         (gfc_check_minloc_maxloc):  Use dim_check and dim_rank_check
1853         to check dim argument.
1854         (check_reduction):  Likewise.
1855
1856 2006-02-14  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
1857
1858         PR fortran/26277
1859         * io.c (match_ltag): Mark label as referenced.
1860
1861 2006-02-14  Jakub Jelinek  <jakub@redhat.com>
1862             Richard Henderson  <rth@redhat.com>
1863             Diego Novillo  <dnovillo@redhat.com>
1864
1865         * invoke.texi: Document -fopenmp.
1866         * gfortran.texi (Extensions): Document OpenMP.
1867
1868         Backport from gomp-20050608-branch
1869         * trans-openmp.c: Call build_omp_clause instead of
1870         make_node when creating OMP_CLAUSE_* trees.
1871         (gfc_trans_omp_reduction_list): Remove argument 'code'.
1872         Adjust all callers.
1873
1874         * trans.h (build4_v): Define.
1875         * trans-openmp.c: Call build4_v to create OMP_PARALLEL nodes.
1876         Call build3_v to create OMP_SECTIONS nodes.
1877
1878         PR fortran/25162
1879         * openmp.c (gfc_match_omp_variable_list): Call gfc_set_sym_referenced
1880         on all symbols added to the variable list.
1881
1882         * openmp.c (gfc_match_omp_clauses): Fix check for non-INTRINSIC
1883         procedure symbol in REDUCTION.
1884
1885         * trans-openmp.c (gfc_trans_omp_array_reduction): Use gfc_add
1886         for MINUS_EXPR OMP_CLAUSE_REDUCTION_CODE.
1887
1888         * trans-openmp.c (gfc_trans_omp_do): Add PBLOCK argument.  If PBLOCK
1889         is non-NULL, evaluate INIT/COND/INCR and chunk size expressions in
1890         that statement block.
1891         (gfc_trans_omp_parallel_do): Pass non-NULL PBLOCK to gfc_trans_omp_do
1892         for non-ordered non-static combined loops.
1893         (gfc_trans_omp_directive): Pass NULL PBLOCK to gfc_trans_omp_do.
1894
1895         * openmp.c: Include target.h and toplev.h.
1896         (gfc_match_omp_threadprivate): Emit diagnostic if target does
1897         not support TLS.
1898         * Make-lang.in (fortran/openmp.o): Add dependencies on
1899         target.h and toplev.h.
1900
1901         * trans-decl.c (gfc_get_fake_result_decl): Set GFC_DECL_RESULT.
1902         * trans-openmp.c (gfc_omp_privatize_by_reference): Make
1903         DECL_ARTIFICIAL vars predetermined shared except GFC_DECL_RESULT.
1904         (gfc_omp_disregard_value_expr): Handle GFC_DECL_RESULT.
1905         (gfc_trans_omp_variable): New function.
1906         (gfc_trans_omp_variable_list, gfc_trans_omp_reduction_list): Use it.
1907         * trans.h (GFC_DECL_RESULT): Define.
1908
1909         * trans-openmp.c (gfc_omp_firstprivatize_type_sizes): New function.
1910         * f95-lang.c (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
1911         * trans.h (gfc_omp_firstprivatize_type_sizes): New prototype.
1912
1913         * trans-openmp.c (gfc_omp_privatize_by_reference): Return
1914         true if a pointer has GFC_DECL_SAVED_DESCRIPTOR set.
1915         (gfc_trans_omp_array_reduction, gfc_trans_omp_reduction_list): New
1916         functions.
1917         (gfc_trans_omp_clauses): Add WHERE argument.  Call
1918         gfc_trans_omp_reduction_list rather than gfc_trans_omp_variable_list
1919         for reductions.
1920         (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
1921         gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
1922         gfc_trans_omp_sections, gfc_trans_omp_single): Adjust
1923         gfc_trans_omp_clauses callers.
1924
1925         * openmp.c (omp_current_do_code): New var.
1926         (gfc_resolve_omp_do_blocks): New function.
1927         (gfc_resolve_omp_parallel_blocks): Call it.
1928         (gfc_resolve_do_iterator): Add CODE argument.  Don't propagate
1929         predetermination if argument is !$omp do or !$omp parallel do
1930         iteration variable.
1931         * resolve.c (resolve_code): Call gfc_resolve_omp_do_blocks
1932         for EXEC_OMP_DO.  Adjust gfc_resolve_do_iterator caller.
1933         * fortran.h (gfc_resolve_omp_do_blocks): New prototype.
1934         (gfc_resolve_do_iterator): Add CODE argument.
1935
1936         * trans.h (gfc_omp_predetermined_sharing,
1937         gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
1938         prototypes.
1939         (GFC_DECL_COMMON_OR_EQUIV, GFC_DECL_CRAY_POINTEE): Define.
1940         * trans-openmp.c (gfc_omp_predetermined_sharing,
1941         gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause): New
1942         functions.
1943         * trans-common.c (build_equiv_decl, build_common_decl,
1944         create_common): Set GFC_DECL_COMMON_OR_EQUIV flag on the decls.
1945         * trans-decl.c (gfc_finish_cray_pointee): Set GFC_DECL_CRAY_POINTEE
1946         on the decl.
1947         * f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_SHARING,
1948         LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
1949         LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE): Define.
1950
1951         * openmp.c (resolve_omp_clauses): Remove extraneous comma.
1952
1953         * symbol.c (check_conflict): Add conflict between cray_pointee and
1954         threadprivate.
1955         * openmp.c (gfc_match_omp_threadprivate): Fail if
1956         gfc_add_threadprivate returned FAILURE.
1957         (resolve_omp_clauses): Diagnose Cray pointees in SHARED,
1958         {,FIRST,LAST}PRIVATE and REDUCTION clauses and Cray pointers in
1959         {FIRST,LAST}PRIVATE and REDUCTION clauses.
1960
1961         * resolve.c (omp_workshare_flag): New variable.
1962         (resolve_function): Diagnose use of non-ELEMENTAL user defined
1963         function in WORKSHARE construct.
1964         (resolve_code): Cleanup forall_save use.  Make sure omp_workshare_flag
1965         is set to correct value in different contexts.
1966
1967         * openmp.c (resolve_omp_clauses): Replace %s with '%s' when printing
1968         variable name.
1969         (resolve_omp_atomic): Likewise.
1970
1971         PR fortran/24493
1972         * scanner.c (skip_free_comments): Set at_bol at the beginning of the
1973         loop, not before it.
1974         (skip_fixed_comments): Handle ! comments in the middle of line here
1975         as well.
1976         (gfc_skip_comments): Use skip_fixed_comments for FIXED_FORM even if
1977         not at BOL.
1978         (gfc_next_char_literal): Fix expected canonicalized *$omp string.
1979
1980         * trans-openmp.c (gfc_trans_omp_do): Use make_node and explicit
1981         initialization to build OMP_FOR instead of build.
1982
1983         * trans-decl.c (gfc_gimplify_function): Invoke
1984         diagnose_omp_structured_block_errors.
1985
1986         * trans-openmp.c (gfc_trans_omp_master): Use OMP_MASTER.
1987         (gfc_trans_omp_ordered): Use OMP_ORDERED.
1988
1989         * gfortran.h (gfc_resolve_do_iterator, gfc_resolve_blocks,
1990         gfc_resolve_omp_parallel_blocks): New prototypes.
1991         * resolve.c (resolve_blocks): Renamed to...
1992         (gfc_resolve_blocks): ... this.  Remove static.
1993         (gfc_resolve_forall): Adjust caller.
1994         (resolve_code): Only call gfc_resolve_blocks if code->block != 0
1995         and not for EXEC_OMP_PARALLEL* directives.  Call
1996         gfc_resolve_omp_parallel_blocks for EXEC_OMP_PARALLEL* directives.
1997         Call gfc_resolve_do_iterator if resolved successfully EXEC_DO
1998         iterator.
1999         * openmp.c: Include pointer-set.h.
2000         (omp_current_ctx): New variable.
2001         (gfc_resolve_omp_parallel_blocks, gfc_resolve_do_iterator): New
2002         functions.
2003         * Make-lang.in (fortran/openmp.o): Depend on pointer-set.h.
2004
2005         * openmp.c (gfc_match_omp_clauses): For max/min/iand/ior/ieor,
2006         look up symbol if it exists, use its name instead and, if it is not
2007         INTRINSIC, issue diagnostics.
2008
2009         * parse.c (parse_omp_do): Handle implied end do properly.
2010         (parse_executable): If parse_omp_do returned ST_IMPLIED_ENDDO,
2011         return it instead of continuing.
2012
2013         * trans-openmp.c (gfc_trans_omp_critical): Update for changed
2014         operand numbering.
2015         (gfc_trans_omp_do, gfc_trans_omp_parallel, gfc_trans_omp_parallel_do,
2016         gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare,
2017         gfc_trans_omp_sections, gfc_trans_omp_single): Likewise.
2018
2019         * trans.h (gfc_omp_privatize_by_reference): New prototype.
2020         * f95-lang.c (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Redefine
2021         to gfc_omp_privatize_by_reference.
2022         * trans-openmp.c (gfc_omp_privatize_by_reference): New function.
2023
2024         * trans-stmt.h (gfc_trans_omp_directive): Add comment.
2025
2026         * openmp.c (gfc_match_omp_variable_list): Add ALLOW_COMMON argument.
2027         Disallow COMMON matching if it is set.
2028         (gfc_match_omp_clauses, gfc_match_omp_flush): Adjust all callers.
2029         (resolve_omp_clauses): Show locus in error messages.  Check that
2030         variable types in reduction clauses are appropriate for reduction
2031         operators.
2032
2033         * resolve.c (resolve_symbol): Don't error if a threadprivate module
2034         variable isn't SAVEd.
2035
2036         * trans-openmp.c (gfc_trans_omp_do): Put count into BLOCK, not BODY.
2037         Fix typo in condition.  Fix DOVAR initialization.
2038
2039         * openmp.c (gfc_match_omp_clauses): Match min/iand/ior/ieor
2040         rather than .min. etc.
2041
2042         * trans-openmpc.c (omp_not_yet): Remove.
2043         (gfc_trans_omp_parallel_do): Keep listprivate clause on parallel.
2044         Force creation of BIND_EXPR around the workshare construct.
2045         (gfc_trans_omp_parallel_sections): Likewise.
2046         (gfc_trans_omp_parallel_workshare): Likewise.
2047
2048         * types.def (BT_I16, BT_FN_I16_VPTR_I16,
2049         BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
2050
2051         * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_DEFAULT.
2052         (gfc_trans_omp_code): New function.
2053         (gfc_trans_omp_do): Use it, remove omp_not_yet uses.
2054         (gfc_trans_omp_parallel, gfc_trans_omp_single): Likewise.
2055         (gfc_trans_omp_sections): Likewise.  Only treat empty last section
2056         specially if lastprivate clause is present.
2057         * f95-lang.c (gfc_init_builtin_functions): Create BUILT_IN_TRAP
2058         builtin.
2059
2060         * trans-openmp.c (gfc_trans_omp_variable_list): Update for
2061         OMP_CLAUSE_DECL name change.
2062         (gfc_trans_omp_do): Likewise.
2063
2064         * trans-openmp.c (gfc_trans_omp_clauses): Create OMP_CLAUSE_REDUCTION
2065         clauses.
2066         (gfc_trans_omp_atomic): Build OMP_ATOMIC instead of expanding
2067         sync builtins directly.
2068         (gfc_trans_omp_single): Build OMP_SINGLE statement.
2069
2070         * trans-openmp.c (gfc_trans_add_clause): New.
2071         (gfc_trans_omp_variable_list): Take a tree code and build the clause
2072         node here.  Link it to the head of a list.
2073         (gfc_trans_omp_clauses): Update to match.
2074         (gfc_trans_omp_do): Use gfc_trans_add_clause.
2075
2076         * trans-openmp.c (gfc_trans_omp_clauses): Change second argument to
2077         gfc_omp_clauses *.  Use gfc_evaluate_now instead of creating
2078         temporaries by hand.
2079         (gfc_trans_omp_atomic, gfc_trans_omp_critical): Use buildN_v macros.
2080         (gfc_trans_omp_do): New function.
2081         (gfc_trans_omp_master): Dont' check for gfc_trans_code returning NULL.
2082         (gfc_trans_omp_parallel): Adjust gfc_trans_omp_clauses caller.
2083         Use buildN_v macros.
2084         (gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_sections,
2085         gfc_trans_omp_parallel_workshare, gfc_trans_omp_sections,
2086         gfc_trans_omp_single, gfc_trans_omp_workshare): New functions.
2087         (gfc_trans_omp_directive): Use them.
2088         * parse.c (parse_omp_do): Allow new_st.op == EXEC_NOP.
2089         * openmp.c (resolve_omp_clauses): Check for list items present
2090         in multiple clauses.
2091         (resolve_omp_do): Check that iteration variable is not THREADPRIVATE
2092         and is not present in any clause variable lists other than PRIVATE
2093         or LASTPRIVATE.
2094
2095         * gfortran.h (symbol_attribute): Add threadprivate bit.
2096         (gfc_common_head): Add threadprivate member, change use_assoc
2097         and saved into char to save space.
2098         (gfc_add_threadprivate): New prototype.
2099         * symbol.c (check_conflict): Handle threadprivate.
2100         (gfc_add_threadprivate): New function.
2101         (gfc_copy_attr): Copy threadprivate.
2102         * trans-openmp.c (gfc_trans_omp_clauses): Avoid creating a temporary
2103         if IF or NUM_THREADS is constant.  Create OMP_CLAUSE_SCHEDULE and
2104         OMP_CLAUSE_ORDERED.
2105         * resolve.c (resolve_symbol): Complain if a THREADPRIVATE symbol
2106         outside a module and not in COMMON has is not SAVEd.
2107         (resolve_equivalence): Ensure THREADPRIVATE objects don't get
2108         EQUIVALENCEd.
2109         * trans-common.c: Include target.h and rtl.h.
2110         (build_common_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
2111         * trans-decl.c: Include rtl.h.
2112         (gfc_finish_var_decl): Set DECL_TLS_MODEL if THREADPRIVATE.
2113         * dump-parse-tree.c (gfc_show_attr): Handle THREADPRIVATE.
2114         * Make-lang.in (fortran/trans-decl.o): Depend on $(RTL_H).
2115         (fortran/trans-common.o): Depend on $(RTL_H) and $(TARGET_H).
2116         * openmp.c (gfc_match_omp_variable_list): Ensure COMMON block
2117         is from current namespace.
2118         (gfc_match_omp_threadprivate): Rewrite.
2119         (resolve_omp_clauses): Check some clause restrictions.
2120         * module.c (ab_attribute): Add AB_THREADPRIVATE.
2121         (attr_bits): Add THREADPRIVATE.
2122         (mio_symbol_attribute, mio_symbol_attribute): Handle threadprivate.
2123         (load_commons, write_common, write_blank_common): Adjust for type
2124         change of saved, store/load threadprivate bit from the integer
2125         as well.
2126
2127         * types.def (BT_FN_UINT_UINT): New.
2128         (BT_FN_VOID_UINT_UINT): Remove.
2129
2130         * trans-openmp.c (gfc_trans_omp_clauses, gfc_trans_omp_barrier,
2131         gfc_trans_omp_critical, gfc_trans_omp_flush, gfc_trans_omp_master,
2132         gfc_trans_omp_ordered, gfc_trans_omp_parallel): New functions.
2133         (gfc_trans_omp_directive): Use them.
2134
2135         * openmp.c (expr_references_sym): Add SE argument, don't look
2136         into SE tree.
2137         (is_conversion): New function.
2138         (resolve_omp_atomic): Adjust expr_references_sym callers.  Handle
2139         promoted expressions.
2140         * trans-openmp.c (gfc_trans_omp_atomic): New function.
2141         (gfc_trans_omp_directive): Call it.
2142
2143         * f95-lang.c (builtin_type_for_size): New function.
2144         (gfc_init_builtin_functions): Initialize synchronization and
2145         OpenMP builtins.
2146         * types.def: New file.
2147         * Make-lang.in (f95-lang.o): Depend on $(BUILTINS_DEF) and
2148         fortran/types.def.
2149
2150         * trans-openmp.c: Rename GOMP_* tree codes into OMP_*.
2151
2152         * dump-parse-tree.c (show_symtree): Don't crash if ns->proc_name
2153         is NULL.
2154
2155         * dump-parse-tree.c (gfc_show_namelist, gfc_show_omp_node): New
2156         functions.
2157         (gfc_show_code_node): Call gfc_show_omp_node for EXEC_OMP_* nodes.
2158
2159         * parse.c (parse_omp_do): Call pop_state before next_statement.
2160         * openmp.c (expr_references_sym, resolve_omp_atomic, resolve_omp_do):
2161         New functions.
2162         (gfc_resolve_omp_directive): Call them.
2163         * match.c (match_exit_cycle): Issue error if EXIT or CYCLE statement
2164         leaves an OpenMP structured block or if EXIT terminates !$omp do
2165         loop.
2166
2167         * Make-lang.in (F95_PARSER_OBJS): Add fortran/openmp.o.
2168         (F95_OBJS): Add fortran/trans-openmp.o.
2169         (fortran/trans-openmp.o): Depend on $(GFORTRAN_TRANS_DEPS).
2170         * lang.opt: Add -fopenmp option.
2171         * options.c (gfc_init_options): Initialize it.
2172         (gfc_handle_option): Handle it.
2173         * gfortran.h (ST_OMP_ATOMIC, ST_OMP_BARRIER, ST_OMP_CRITICAL,
2174         ST_OMP_END_CRITICAL, ST_OMP_END_DO, ST_OMP_END_MASTER,
2175         ST_OMP_END_ORDERED, ST_OMP_END_PARALLEL, ST_OMP_END_PARALLEL_DO,
2176         ST_OMP_END_PARALLEL_SECTIONS, ST_OMP_END_PARALLEL_WORKSHARE,
2177         ST_OMP_END_SECTIONS, ST_OMP_END_SINGLE, ST_OMP_END_WORKSHARE,
2178         ST_OMP_DO, ST_OMP_FLUSH, ST_OMP_MASTER, ST_OMP_ORDERED,
2179         ST_OMP_PARALLEL, ST_OMP_PARALLEL_DO, ST_OMP_PARALLEL_SECTIONS,
2180         ST_OMP_PARALLEL_WORKSHARE, ST_OMP_SECTIONS, ST_OMP_SECTION,
2181         ST_OMP_SINGLE, ST_OMP_THREADPRIVATE, ST_OMP_WORKSHARE): New
2182         statement codes.
2183         (OMP_LIST_PRIVATE, OMP_LIST_FIRSTPRIVATE, OMP_LIST_LASTPRIVATE,
2184         OMP_LIST_COPYPRIVATE, OMP_LIST_SHARED, OMP_LIST_COPYIN,
2185         OMP_LIST_PLUS, OMP_LIST_REDUCTION_FIRST, OMP_LIST_MULT,
2186         OMP_LIST_SUB, OMP_LIST_AND, OMP_LIST_OR, OMP_LIST_EQV,
2187         OMP_LIST_NEQV, OMP_LIST_MAX, OMP_LIST_MIN, OMP_LIST_IAND,
2188         OMP_LIST_IOR, OMP_LIST_IEOR, OMP_LIST_REDUCTION_LAST, OMP_LIST_NUM):
2189         New OpenMP variable list types.
2190         (gfc_omp_clauses): New typedef.
2191         (gfc_get_omp_clauses): Define.
2192         (EXEC_OMP_CRITICAL, EXEC_OMP_DO, EXEC_OMP_FLUSH, EXEC_OMP_MASTER,
2193         EXEC_OMP_ORDERED, EXEC_OMP_PARALLEL, EXEC_OMP_PARALLEL_DO,
2194         EXEC_OMP_PARALLEL_SECTIONS, EXEC_OMP_PARALLEL_WORKSHARE,
2195         EXEC_OMP_SECTIONS, EXEC_OMP_SINGLE, EXEC_OMP_WORKSHARE,
2196         EXEC_OMP_ATOMIC, EXEC_OMP_BARRIER, EXEC_OMP_END_NOWAIT,
2197         EXEC_OMP_END_SINGLE): New OpenMP gfc_exec_op codes.
2198         (struct gfc_code): Add omp_clauses, omp_name, omp_namelist
2199         and omp_bool fields to ext union.
2200         (flag_openmp): Declare.
2201         (gfc_free_omp_clauses, gfc_resolve_omp_directive): New prototypes.
2202         * scanner.c (openmp_flag, openmp_locus): New variables.
2203         (skip_free_comments, skip_fixed_comments, gfc_next_char_literal):
2204         Handle OpenMP directive lines and conditional compilation magic
2205         comments.
2206         * parse.h (COMP_OMP_STRUCTURED_BLOCK): New compile state.
2207         * parse.c (decode_omp_directive, parse_omp_do, parse_omp_atomic,
2208         parse_omp_structured_block): New functions.
2209         (next_free, next_fixed): Parse OpenMP directives.
2210         (case_executable, case_exec_markers, case_decl): Add ST_OMP_*
2211         codes.
2212         (gfc_ascii_statement): Handle ST_OMP_* codes.
2213         (parse_executable): Rearrange the loop slightly, so that
2214         parse_omp_do can return next_statement.
2215         * match.h (gfc_match_omp_eos, gfc_match_omp_atomic,
2216         gfc_match_omp_barrier, gfc_match_omp_critical, gfc_match_omp_do,
2217         gfc_match_omp_flush, gfc_match_omp_master, gfc_match_omp_ordered,
2218         gfc_match_omp_parallel, gfc_match_omp_parallel_do,
2219         gfc_match_omp_parallel_sections, gfc_match_omp_parallel_workshare,
2220         gfc_match_omp_sections, gfc_match_omp_single,
2221         gfc_match_omp_threadprivate, gfc_match_omp_workshare,
2222         gfc_match_omp_end_nowait, gfc_match_omp_end_single): New prototypes.
2223         * resolve.c (resolve_blocks): Ignore EXEC_OMP_* block directives.
2224         (resolve_code): Call gfc_resolve_omp_directive on EXEC_OMP_*
2225         directives.
2226         * trans.c (gfc_trans_code): Call gfc_trans_omp_directive for
2227         EXEC_OMP_* directives.
2228         * st.c (gfc_free_statement): Handle EXEC_OMP_* statement freeing.
2229         * trans-stmt.h (gfc_trans_omp_directive): New prototype.
2230         * openmp.c: New file.
2231         * trans-openmp.c: New file.
2232
2233 2006-02-13  Andrew Pinski  <pinskia@physics.uc.edu>
2234             Jakub Jelinek  <jakub@redhat.com>
2235
2236         PR fortran/26246
2237         * trans-decl.c (gfc_get_symbol_decl, gfc_get_fake_result_decl): Use
2238         gfc_add_decl_to_function rather than gfc_finish_var_decl on length.
2239
2240 2006-02-13  Paul Thomas  <pault@gcc.gnu.org>
2241
2242         PR fortran/26074
2243         PR fortran/25103
2244         * resolve.c (resolve_symbol): Extend the requirement that module
2245         arrays have constant bounds to those in the main program.  At the
2246         same time simplify the array bounds, to avoiding trapping parameter
2247         array references, and exclude automatic character length from main
2248         and modules. Rearrange resolve_symbol and resolve_derived to put as
2249         each flavor together, as much as is possible and move all specific
2250         code for flavors FL_VARIABLE, FL_PROCEDURE and FL_PARAMETER into new
2251         functions.
2252         (resolve_fl_var_and_proc, resolve_fl_variable, resolve_fl_procedure):
2253         New functions to do work of resolve_symbol.
2254         (resolve_index_expr): New function that is called from resolved_symbol
2255         and is extracted from resolve_charlen.
2256         (resolve_charlen): Call this new function.
2257         (resolve_fl_derived): Renamed resolve_derived to be consistent with
2258         the naming of the new functions for the other flavours.  Change the
2259         charlen checking so that the style is consistent with other similar
2260         checks. Add the generation of the gfc_dt_list, removed from resolve_
2261         symbol.
2262
2263         PR fortran/20861
2264         * resolve.c (resolve_actual_arglist): Prevent internal procedures
2265         from being dummy arguments.
2266
2267         PR fortran/20871
2268         * resolve.c (resolve_actual_arglist): Prevent pure but non-intrinsic
2269         procedures from being dummy arguments.
2270
2271         PR fortran/25083
2272         * resolve.c (check_data_variable): Add test that data variable is in
2273         COMMON.
2274
2275         PR fortran/25088
2276         * resolve.c (resolve_call): Add test that the subroutine does not
2277         have a type.
2278
2279 2006-02-12  Erik Edelmann  <eedelman@gcc.gnu.org>
2280
2281         PR fortran/25806
2282         * trans-array.c (gfc_trans_allocate_array_storage): New argument
2283         dealloc; free the temporary only if dealloc is true.
2284         (gfc_trans_allocate_temp_array): New argument bool dealloc, to be
2285         passed onwards to gfc_trans_allocate_array_storage.
2286         (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
2287         gfc_trans_allocate_temp_array.
2288         * trans-array.h (gfc_trans_allocate_temp_array): Update function
2289         prototype.
2290         * trans-expr.c (gfc_conv_function_call): Set new argument 'dealloc'
2291         to gfc_trans_allocate_temp_array to false in case of functions
2292         returning pointers.
2293         (gfc_trans_arrayfunc_assign): Return NULL for functions returning
2294         pointers.
2295
2296 2006-02-10  Steven G. Kargl  <kargls@comcast.net>
2297
2298         PR fortran/20858
2299         *decl.c (variable_decl): Improve error message.  Remove initialization
2300         typespec.  Wrap long line.
2301         *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type,
2302         and rank.
2303         *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank
2304         are set.
2305
2306
2307 2006-02-10  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
2308
2309         PR fortran/14771
2310         * arith.c (eval_intrinsic): Accept INTRINSIC_PARENTHESES.
2311         * expr.c (check_intrinsic_op): Likewise.
2312         * module.c (mio_expr): Likewise.
2313
2314 2006-02-09  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
2315
2316         * dump-parse-tree.c: Update copyright years.
2317         * matchexp.c: Likewise.
2318         * module.c: Likewise.
2319
2320         PR fortran/14771
2321         * gfortran.h (gfc_intrinsic_op): Add INTRINSIC_PARENTHESES.
2322         * dump-parse-tree (gfc_show_expr): Handle INTRINSIC_PARENTHESES.
2323         * expr.c (simplify_intrinsic_op): Treat INTRINSIC_PARENTHESES as
2324         if it were INTRINSIC_UPLUS.
2325         * resolve.c (resolve_operator): Handle INTRINSIC_PARENTHESES.
2326         * match.c (intrinsic_operators): Add INTRINSIC_PARENTHESES.
2327         * matchexp.c (match_primary): Record parentheses surrounding
2328         numeric expressions.
2329         * module.c (intrinsics): Add INTRINSIC_PARENTHESES for module
2330         dumping.
2331         * trans-expr.c (gfc_conv_expr_op): Handle INTRINSIC_PARENTHESES.
2332
2333 2006-02-09  Paul Thomas  <pault@gcc.gnu.org>
2334
2335         PR fortran/26038
2336         * trans-stmt.c (gfc_trans_allocate): Provide assumed character length
2337         scalar with missing backend_decl for the hidden dummy charlen.
2338
2339         PR fortran/25059
2340         * interface.c (gfc_extend_assign): Remove detection of non-PURE
2341         subroutine in assignment interface, with gfc_error, and put it in
2342         * resolve.c (resolve_code).
2343
2344         PR fortran/25070
2345         * interface.c (gfc_procedure_use): Flag rank checking for non-
2346         elemental, contained or interface procedures in call to
2347         (compare_actual_formal), where ranks are checked for assumed
2348         shape arrays..
2349
2350 2006-02-08  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
2351
2352         PR libfortran/25425
2353         * trans-decl.c (gfc_generate_function_code): Add new argument,
2354         pedantic, to set_std call.
2355
2356 2006-02-06  Thomas Koenig  <Thomas.Koenig@online.de>
2357
2358         PR libfortran/23815
2359         * gfortran.texi: Document the GFORTRAN_CONVERT_UNIT environment
2360         variable.
2361         * invoke.texi:  Mention the "Runtime" chapter.
2362         Document the -fconvert= option.
2363         * gfortran.h:  Add options_convert.
2364         * lang.opt:  Add fconvert=little-endian, fconvert=big-endian,
2365         fconvert=native and fconvert=swap.
2366         * trans-decl.c (top level):  Add gfor_fndecl_set_convert.
2367         (gfc_build_builtin_function_decls):  Set gfor_fndecl_set_convert.
2368         (gfc_generate_function_code):  If -fconvert was specified,
2369         and this is the main program, add a call to set_convert().
2370         * options.c:  Handle the -fconvert options.
2371
2372 2006-02-06  Roger Sayle  <roger@eyesopen.com>
2373
2374         * trans-stmt.c (gfc_evaluate_where_mask): Allow the NMASK argument
2375         to be NULL to indicate that the not mask isn't required.
2376         (gfc_trans_where_2): Remove PMASK argument.  Avoid calculating the
2377         pending mask for the last clause of a WHERE chain.  Update recursive
2378         call.
2379         (gfc_trans_forall_1): Update call to gfc_trans_where_2.
2380         (gfc_trans_where): Likewise.
2381
2382 2006-02-06  Jakub Jelinek  <jakub@redhat.com>
2383
2384         Backport from gomp-20050608-branch
2385         * trans-decl.c (create_function_arglist): Handle dummy functions.
2386
2387         * trans-decl.c (gfc_get_symbol_decl): Revert explicit setting of
2388         TYPE_SIZE_UNIT.
2389         (gfc_trans_vla_type_sizes): Also "gimplify"
2390         GFC_TYPE_ARRAY_DATAPTR_TYPE for GFC_DESCRIPTOR_TYPE_P types.
2391         * trans-array.c (gfc_trans_deferred_array): Call
2392         gfc_trans_vla_type_sizes.
2393
2394         * trans-decl.c (saved_function_decls, saved_parent_function_decls):
2395         Remove unnecessary initialization.
2396         (create_function_arglist): Make sure __result has complete type.
2397         (gfc_get_fake_result_decl): Change current_fake_result_decl into
2398         a tree chain.  For entry master, create a separate variable
2399         for each result name.  For BT_CHARACTER results, call
2400         gfc_finish_var_decl on length even if it has been already created,
2401         but not pushdecl'ed.
2402         (gfc_trans_vla_type_sizes): For function/entry result, adjust
2403         result value type, not the FUNCTION_TYPE.
2404         (gfc_generate_function_code): Adjust for current_fake_result_decl
2405         changes.
2406         (gfc_trans_deferred_vars): Likewise.  Call gfc_trans_vla_type_sizes
2407         even on result if it is assumed-length character.
2408
2409         * trans-decl.c (gfc_trans_dummy_character): Add SYM argument.
2410         Call gfc_trans_vla_type_sizes.
2411         (gfc_trans_auto_character_variable): Call gfc_trans_vla_type_sizes.
2412         (gfc_trans_vla_one_sizepos, gfc_trans_vla_type_sizes_1,
2413         gfc_trans_vla_type_sizes): New functions.
2414         (gfc_trans_deferred_vars): Adjust gfc_trans_dummy_character
2415         callers.  Call gfc_trans_vla_type_sizes on assumed-length
2416         character parameters.
2417         * trans-array.c (gfc_trans_array_bounds,
2418         gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias): Call
2419         gfc_trans_vla_type_sizes.
2420         * trans.h (gfc_trans_vla_type_sizes): New prototype.
2421
2422         * trans-decl.c (gfc_build_qualified_array): For non-assumed-size
2423         arrays without constant size, create also an index var for
2424         GFC_TYPE_ARRAY_SIZE (type).  If the type is incomplete, complete
2425         it as 0..size-1.
2426         (gfc_create_string_length): Don't call gfc_defer_symbol_init
2427         if just creating DECL_ARGUMENTS.
2428         (gfc_get_symbol_decl): Call gfc_finish_var_decl and
2429         gfc_defer_symbol_init even if ts.cl->backend_decl is already
2430         set to a VAR_DECL that doesn't have DECL_CONTEXT yet.
2431         (create_function_arglist): Rework, so that hidden length
2432         arguments for CHARACTER parameters are created together with
2433         the parameters.  Resolve ts.cl->backend_decl for CHARACTER
2434         parameters.  If the argument is a non-constant length array
2435         or CHARACTER, ensure PARM_DECL has different type than
2436         its DECL_ARG_TYPE.
2437         (generate_local_decl): Call gfc_get_symbol_decl even
2438         for non-referenced non-constant length CHARACTER parameters
2439         after optionally issuing warnings.
2440         * trans-array.c (gfc_trans_array_bounds): Set last stride
2441         to GFC_TYPE_ARRAY_SIZE (type) to initialize it as well.
2442         (gfc_trans_dummy_array_bias): Initialize GFC_TYPE_ARRAY_SIZE (type)
2443         variable as well.
2444
2445         * trans-expr.c (gfc_conv_expr_val): Fix comment typo.
2446
2447         * trans-stmt.c (gfc_trans_simple_do): Fix comment.
2448
2449 2006-02-04  Roger Sayle  <roger@eyesopen.com>
2450
2451         * dependency.c (gfc_check_dependency): Remove unused vars and nvars
2452         arguments.  Replace with an "identical" argument.  A full array
2453         reference to the same symbol is a dependency if identical is true.
2454         * dependency.h (gfc_check_dependency): Update prototype.
2455         * trans-array.h (gfc_check_dependency): Delete duplicate prototype.
2456         * trans-stmt.c: #include dependency.h for gfc_check_dependency.
2457         (gfc_trans_forall_1): Update calls to gfc_check_dependency.
2458         (gfc_trans_where_2): Likewise.  Remove unneeded variables.
2459         (gfc_trans_where_3): New function for simple non-dependent WHEREs.
2460         (gfc_trans_where): Call gfc_trans_where_3 to translate simple
2461         F90-style WHERE statements without internal dependencies.
2462         * Make-lang.in (trans-stmt.o): Depend upon dependency.h.
2463
2464 2006-02-05  H.J. Lu  <hongjiu.lu@intel.com>
2465
2466         PR fortran/26041
2467         PR fortran/26064
2468         * resolve.c (resolve_types): New function.
2469         (resolve_codes): Likewise.
2470         (gfc_resolve): Use them.
2471
2472 2006-02-05  Roger Sayle  <roger@eyesopen.com>
2473
2474         * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE
2475         masks instead of LOGICAL*4.
2476
2477 2006-02-05  Jakub Jelinek  <jakub@redhat.com>
2478
2479         * resolve.c (resolve_symbol): Initialize constructor_expr to NULL.
2480
2481 2006-02-04  Thomas Koenig  <Thomas.Koenig@online.de>
2482
2483         PR fortran/25075
2484         check.c (identical_dimen_shape):  New function.
2485         (check_dot_product):  Use identical_dimen_shape() to check sizes
2486         for dot_product.
2487         (gfc_check_matmul):  Likewise.
2488         (gfc_check_merge):  Check conformance between tsource and fsource
2489         and between tsource and mask.
2490         (gfc_check_pack):  Check conformance between array and mask.
2491
2492 2006-02-03  Steven G. Kargl  <kargls@comcast>
2493             Paul Thomas  <pault@gcc.gnu.org>
2494
2495         PR fortran/20845
2496         * resolve.c (resolve_symbol): Default initialization of derived type
2497         component reguires the SAVE attribute.
2498
2499 2006-02-02  Steven G. Kargl  <kargls@comcast>
2500
2501         PR fortran/24958
2502         match.c (gfc_match_nullify):  Free the list from head not tail.
2503
2504         PR fortran/25072
2505         * match.c (match_forall_header): Fix internal error caused by bogus
2506         gfc_epxr pointers.
2507
2508
2509 2006-01-31  Thomas Koenig  <Thomas.Koenig@online.de>
2510
2511         PR fortran/26039
2512         expr.c (gfc_check_conformance):  Reorder error message
2513         to avoid plural.
2514         check.c(gfc_check_minloc_maxloc):  Call gfc_check_conformance
2515         for checking arguments array and mask.
2516         (check_reduction):  Likewise.
2517
2518 2006-01-30  Erik Edelmann  <eedelman@gcc.gnu.org>
2519
2520         PR fortran/24266
2521         * trans-io.c (set_internal_unit): Check the rank of the
2522         expression node itself instead of its symbol.
2523
2524 2006-01-29  Paul Thomas  <pault@gcc.gnu.org>
2525
2526         PR fortran/18578
2527         PR fortran/18579
2528         PR fortran/20857
2529         PR fortran/20885
2530         * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
2531         if actual argument is not a variable.
2532
2533 2006-01-28  Paul Thomas  <pault@gcc.gnu.org>
2534
2535         PR fortran/17911
2536         * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
2537         the lvalue is a use associated procedure.
2538
2539         PR fortran/20895
2540         PR fortran/25030
2541         * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
2542         character lengths are not the same.  Use gfc_dep_compare_expr for the
2543         comparison.
2544         * gfortran.h: Add prototype for gfc_dep_compare_expr.
2545         * dependency.h: Remove prototype for gfc_dep_compare_expr.
2546
2547 2006-01-27  Paul Thomas  <pault@gcc.gnu.org>
2548
2549         PR fortran/25964
2550         * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
2551         generic_ids exempted from assumed size checking.
2552
2553 2006-01-27  Jakub Jelinek  <jakub@redhat.com>
2554
2555         PR fortran/25324
2556         * Make-lang.in (fortran/scanner.o): Depend on toplev.h.
2557         * lang.opt (fpreprocessed): New option.
2558         * scanner.c: Include toplev.h.
2559         (gfc_src_file, gfc_src_preprocessor_lines): New variables.
2560         (preprocessor_line): Unescape filename if there were any
2561         backslashes.
2562         (load_file): If initial and gfc_src_file is not NULL,
2563         use it rather than opening the file.  If gfc_src_preprocessor_lines
2564         has non-NULL elements, pass it to preprocessor_line.
2565         (unescape_filename, gfc_read_orig_filename): New functions.
2566         * gfortran.h (gfc_option_t): Add flag_preprocessed.
2567         (gfc_read_orig_filename): New prototype.
2568         * options.c (gfc_init_options): Clear flag_preprocessed.
2569         (gfc_post_options): If flag_preprocessed, call
2570         gfc_read_orig_filename.
2571         (gfc_handle_option): Handle OPT_fpreprocessed.
2572         * lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
2573         sources.
2574
2575 2006-01-27  Erik Edelmann  <eedelman@gcc.gnu.org>
2576
2577         * symbol.c (free_old_symbol): Fix confusing comment, and add code
2578           to free old_symbol->formal.
2579
2580 2006-01-26  Paul Thomas  <pault@gcc.gnu.org>
2581
2582         PR fortran/25964
2583         * resolve.c (resolve_function): Exclude statement functions from
2584         global reference checking.
2585
2586         PR fortran/25084
2587         PR fortran/20852
2588         PR fortran/25085
2589         PR fortran/25086
2590         * resolve.c (resolve_function): Declare a gfc_symbol to replace the
2591         references through the symtree to the symbol associated with the
2592         function expresion. Give error on reference to an assumed character
2593         length function is defined in an interface or an external function
2594         that is not a dummy argument.
2595         (resolve_symbol): Give error if an assumed character length function
2596         is array-valued, pointer-valued, pure or recursive. Emit warning
2597         that character(*) value functions are obsolescent in F95.
2598
2599         PR fortran/25416
2600         * trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
2601         prevents any assumed character length function call from getting here
2602         except intrinsics such as SPREAD. In this case, ensure that no
2603         segfault occurs from referencing non-existent charlen->length->
2604         expr_type and provide a backend_decl for the charlen from the charlen
2605         of the first actual argument.
2606
2607         Cure temp name confusion.
2608         * trans-expr.c (gfc_get_interface_mapping_array): Change name of
2609         temporary from "parm" to "ifm" to avoid clash with temp coming from
2610         trans-array.c.
2611
2612 2006-01-25  Erik Edelmann  <eedelman@gcc.gnu.org>
2613
2614         PR fortran/25716
2615         * symbol.c (free_old_symbol): New function.
2616         (gfc_commit_symbols): Use it.
2617         (gfc_commit_symbol): New function.
2618         (gfc_use_derived): Use it.
2619         * gfortran.h: Add prototype for gfc_commit_symbol.
2620         * intrinsic.c (gfc_find_function): Search in 'conversion'
2621         if not found in 'functions'.
2622         (gfc_convert_type_warn): Add a symtree to the new
2623         expression node, and commit the new symtree->n.sym.
2624         * resolve.c (gfc_resolve_index): Make sure typespec is
2625         properly initialized.
2626
2627 2006-01-23  Paul Thomas  <pault@gcc.gnu.org>
2628
2629         PR fortran/25901
2630         * decl.c (get_proc_name): Replace subroutine and function attributes
2631         in "already defined" test by the formal arglist pointer being non-NULL.
2632
2633         Fix regression in testing of admissability of attributes.
2634         * symbol.c (gfc_add_attribute): If the current_attr has non-zero
2635         intent, do not do the check for a dummy being used.
2636         * decl.c (attr_decl1): Add current_attr.intent as the third argument
2637         in the call to gfc_add_attribute.
2638         * gfortran.h: Add the third argument to the prototype for
2639         gfc_add_attribute.
2640
2641 2006-01-21  Joseph S. Myers  <joseph@codesourcery.com>
2642
2643         * gfortranspec.c (lang_specific_driver): Update copyright notice
2644         date.
2645
2646 2006-01-21  Paul Thomas  <pault@gcc.gnu.org>
2647
2648         PR fortran/25124
2649         PR fortran/25625
2650         * decl.c (get_proc_name): If there is an existing
2651         symbol in the encompassing namespace, call errors
2652         if it is a procedure of the same name or the kind
2653         field is set, indicating a type declaration.
2654
2655         PR fortran/20881
2656         PR fortran/23308
2657         PR fortran/25538
2658         PR fortran/25710
2659         * decl.c (add_global_entry): New function to check
2660         for existing global symbol with this name and to
2661         create new one if none exists.
2662         (gfc_match_entry): Call add_global_entry before
2663         matching argument lists for subroutine and function
2664         entries.
2665         * gfortran.h: Prototype for existing function,
2666         global_used.
2667         * resolve.c (resolve_global_procedure): New function
2668         to check global symbols for procedures.
2669         (resolve_call, resolve_function): Calls to this
2670         new function for non-contained and non-module
2671         procedures.
2672         * match.c (match_common): Add check for existing
2673         global symbol, creat one if none exists and emit
2674         error if there is a clash.
2675         * parse.c (global_used): Remove static and use the
2676         gsymbol name rather than the new_block name, so that
2677         the function can be called from resolve.c.
2678         (parse_block_data, parse_module, add_global_procedure):
2679         Improve checks for existing gsymbols.  Emit error if
2680         already defined or if references were to another type.
2681         Set defined flag.
2682
2683         PR fortran/PR24276
2684         * trans-expr.c (gfc_conv_aliased_arg): New function called by 
2685         gfc_conv_function_call that coverts an expression for an aliased
2686         component reference to a derived type array into a temporary array
2687         of the same type as the component.  The temporary is passed as an
2688         actual argument for the procedure call and is copied back to the
2689         derived type after the call.
2690         (is_aliased_array): New function that detects an array reference
2691         that is followed by a component reference.
2692         (gfc_conv_function_call): Detect an aliased actual argument with
2693         is_aliased_array and convert it to a temporary and back again
2694         using gfc_conv_aliased_arg.
2695
2696 2006-01-19  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
2697
2698         * gfortranspec.c: Update copyright years.
2699         * trans.c: Likewise.
2700         * trans-array.c: Likewise.
2701         * trans-array.h: Likewise.
2702         * trans-decl.c: Likewise.
2703         * trans-stmt.c: Likewise.
2704         * trans-stmt.h: Likewise.
2705         * trans-types.c: Likewise.
2706
2707 2006-01-18  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
2708
2709         PR fortran/18540
2710         PR fortran/18937
2711         * gfortran.h (BBT_HEADER): Move definition up.
2712         (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'.
2713         * io.c (format_asterisk): Adapt initializer.
2714         * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
2715         as extension.
2716         (warn_unused_label): Take gfc_st_label label as argument, adapt to
2717         new data structure.
2718         (gfc_resolve): Adapt call to warn_unused_label.
2719         * symbol.c (compare_st_labels): New function.
2720         (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to
2721         using balanced binary tree.
2722         * decl.c (match_char_length, gfc_match_old_kind_spec): Do away
2723         with 'cnt'.
2724         (warn_unused_label): Adapt to binary tree.
2725         * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL.
2726         * primary.c (match_kind_param): Do away with cnt.
2727
2728 2006-01-18  Paul Thomas  <pault@gcc.gnu.org>
2729
2730         PR fortran/20869
2731         PR fortran/20875
2732         PR fortran/25024
2733         * symbol.c (check_conflict): Add pointer valued elemental
2734         functions and internal procedures with the external attribute
2735         to the list of conflicts.
2736         (gfc_add_attribute): New catch-all function to perform the
2737         checking of symbol attributes for attribute declaration
2738         statements.
2739         * decl.c (attr_decl1): Call gfc_add_attribute for each of -
2740         (gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
2741         gfc_match_pointer, gfc_match_dimension, gfc_match_target):
2742         Remove spurious calls to checks in symbol.c.  Set the
2743         attribute directly and use the call to attr_decl() for
2744         checking.
2745         * gfortran.h:  Add prototype for gfc_add_attribute.
2746
2747         PR fortran/25785
2748         * resolve.c (resolve_function): Exclude PRESENT from assumed size
2749         argument checking. Replace strcmp's with comparisons with generic
2750         codes.
2751
2752 2006-01-16  Rafael \81Ávila de Esp\81índola  <rafael.espindola@gmail.com>
2753
2754         * gfortranspec.c (lang_specific_spec_functions): Remove.
2755
2756 2006-01-16  Richard Guenther  <rguenther@suse.de>
2757
2758         * trans-stmt.c (gfc_trans_if_1): Use fold_buildN and build_int_cst.
2759         (gfc_trans_arithmetic_if): Likewise.
2760         (gfc_trans_simple_do): Likewise.
2761         (gfc_trans_do): Likewise.
2762         (gfc_trans_do_while): Likewise.
2763         (gfc_trans_logical_select): Likewise.
2764         (gfc_trans_forall_loop): Likewise.
2765         (generate_loop_for_temp_to_lhs): Likewise.
2766         (generate_loop_for_rhs_to_temp): Likewise.
2767         (gfc_trans_allocate): Likewise.
2768         * trans.c (gfc_add_expr_to_block): Do not fold expr again.
2769
2770 2006-01-16  Richard Guenther  <rguenther@suse.de>
2771
2772         * trans-expr.c (gfc_conv_function_call): Use fold_build2.
2773         * trans-stmt.c (gfc_trans_goto): Likewise.  Use build_int_cst.
2774         * trans.c (gfc_trans_runtime_check): Don't fold the condition
2775         again.
2776
2777 2006-01-13  Steven G. Kargl  <kargls@comcast.net>
2778
2779         PR fortran/25756
2780         * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove
2781         unneeded parenthesis. Fix-up the head of the list (2 lines gleaned
2782         from g95).
2783
2784 2006-01-13  Diego Novillo  <dnovillo@redhat.com>
2785
2786         * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement
2787         nodes.
2788
2789 2006-01-11  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
2790
2791         * parse.c (next_fixed): Remove superfluous string concatenation.
2792
2793 2006-01-11  Bernhard Fischer  <rep.nop@aon.at>
2794
2795         PR fortran/25486
2796         * scanner.c (load_line): use maxlen to determine the line-length used
2797         for padding lines in fixed form.
2798
2799 2006-01-11  Paul Thomas  <pault@gcc.gnu.org>
2800
2801         PR fortran/25730
2802         * trans-types.c (copy_dt_decls_ifequal): Copy backend decl for
2803         character lengths.
2804
2805 2006-01-09  Andrew Pinski  <pinskia@physics.uc.edu>
2806
2807         fortran/24936
2808         * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
2809         to avoid type mismatch.
2810
2811 2006-01-09  Andrew Pinski  <pinskia@physics.uc.edu>
2812
2813         PR fortran/21977
2814         * trans-decl.c (gfc_generate_function_code): Move the NULLing of
2815         current_fake_result_decl down to below generate_local_vars.
2816
2817 2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>
2818
2819         PR fortran/12456
2820         * trans-expr.c (gfc_to_single_character): New function that converts
2821         string to single character if its length is 1.
2822         (gfc_build_compare_string):New function that compare string and handle
2823         single character specially.
2824         (gfc_conv_expr_op): Use gfc_build_compare_string.
2825         (gfc_trans_string_copy): Use gfc_to_single_character.
2826         * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
2827         gfc_build_compare_string.
2828         * trans.h (gfc_build_compare_string): Add prototype.
2829
2830 2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>
2831
2832         * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
2833         constant.
2834         (gfc_simplify_ichar): Get the result from unsinged char and in the
2835         range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
2836
2837 2006-01-08  Erik Edelmann  <eedelman@gcc.gnu.org>
2838
2839         PR fortran/25093
2840         * resolve.c (resolve_fntype): Check that PUBLIC functions
2841         aren't of PRIVATE type.
2842
2843 2006-01-07  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
2844
2845         * decl.c (gfc_match_function_decl): Correctly error out in case of
2846         omitted function argument list.
2847
2848 2006-01-07  Paul Thomas  <pault@gcc.gnu.org>
2849
2850         PR fortran/22146
2851         * trans-array.c (gfc_reverse_ss): Remove static attribute.
2852         (gfc_walk_elemental_function_args): Replace gfc_expr * argument for
2853         the function call with the corresponding gfc_actual_arglist*.  Change
2854         code accordingly.
2855         (gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
2856         now requires the actual argument list instead of the expression for
2857         the function call.
2858         * trans-array.h: Modify the prototype for gfc_walk_elemental_function_args
2859         and provide a prototype for gfc_reverse_ss.
2860         * trans-stmt.h (gfc_trans_call): Add the scalarization code for the case
2861         where an elemental subroutine has array valued actual arguments.
2862
2863         PR fortran/25029
2864         PR fortran/21256
2865         PR fortran/20868
2866         PR fortran/20870
2867         * resolve.c (check_assumed_size_reference): New function to check for upper
2868         bound in assumed size array references.
2869         (resolve_assumed_size_actual): New function to do a very restricted scan
2870         of actual argument expressions of those procedures for which incomplete
2871         assumed size array references are not allowed.
2872         (resolve_function, resolve_call): Switch off assumed size checking of
2873         actual arguments, except for elemental procedures and intrinsic
2874         inquiry functions, in some circumstances.
2875         (resolve_variable): Call check_assumed_size_reference.
2876
2877 2006-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2878
2879         PR fortran/24268
2880         * io.c (next_char_not_space): New function that returns the next
2881         character that is not white space.
2882         (format_lex): Use the new function to skip whitespace within
2883         a format string.
2884
2885 2006-01-05  Erik Edelmann  <eedelman@gcc.gnu.org>
2886
2887         PR fortran/23675
2888         * expr.c (gfc_expr_set_symbols_referenced): New function.
2889         * gfortran.h: Add a function prototype for it.
2890         * resolve.c (resolve_function): Use it for
2891         use associated character functions lengths.
2892         * expr.c, gfortran.h, resolve.c: Updated copyright years.
2893
2894 2006-01-03  Steven G. Kargl  <kargls@comcast.net>
2895
2896         PR fortran/25101
2897         * resolve.c (resolve_forall_iterators):  Check for scalar variables;
2898         Check stride is nonzero.
2899
2900 2006-01-02  Steven G. Kargl  <kargls@comcast.net>
2901
2902         PR fortran/24640
2903         * parse.c (next_free): Check for whitespace after the label.
2904         * match.c (gfc_match_small_literal_int): Initialize cnt variable.
2905
2906 2006-01-01  Steven G. Kargl  <kargls@comcast.net>
2907
2908         * ChangeLog: Split previous years into ...
2909         * ChangeLog-2002: here.
2910         * ChangeLog-2003: here.
2911         * ChangeLog-2004: here.
2912         * ChangeLog-2005: here.