OSDN Git Service

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