OSDN Git Service

3cd8c1aae478ff0b2cc1ee86c7aa1bbb38e524ce
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2008-12-17  Daniel Kraft  <d@domob.eu>
2
3         PR fortran/38137
4         * trans-intrinsic.c (conv_same_strlen_check): New method.
5         (gfc_conv_intrinsic_merge): Call it here to actually do the check.
6
7 2008-12-15  Mikael Morin  <mikael.morin@tele2.fr>
8
9         PR fortran/38487
10         * dependency.c (gfc_is_data_pointer): New function.
11         (gfc_check_argument_var_dependency): Disable the warning
12         in the pointer case.
13         (gfc_check_dependency): Use gfc_is_data_pointer.
14
15 2008-12-15  Mikael Morin  <mikael.morin@tele2.fr>
16
17         PR fortran/38113
18         * error.c (show_locus): Start counting columns at 0.
19         * primary.c (match_actual_arg): Eat spaces
20         before copying the current locus.
21         (match_variable): Copy the locus before matching.
22
23 2008-12-14  Paul Thomas  <pault@gcc.gnu.org>
24
25         PR fortran/35937
26         * trans-expr.c (gfc_finish_interface_mapping): Fold convert the
27         character length to gfc_charlen_type_node.
28
29 2008-12-12  Daniel Franke  <franke.daniel@gmail.com>
30
31         PR fortran/36355
32         * check.c (gfc_check_matmul): Fixed error message for invalid
33         types to correctly identify the offending argument, added check
34         for mismatching types.
35
36 2008-12-11  Richard Guenther  <rguenther@suse.de>
37
38         * Make-lang.in (install-finclude-dir): Use correct mode argument
39         for mkinstalldirs.
40
41 2008-12-09  Daniel Franke  <franke.daniel@gmail.com>
42
43         PR fortran/36376
44         PR fortran/37468
45         * lang-specs.h: Pass on -i* options to f951 to (probably) report
46         them as unknown. Duplicate gcc.c (cpp_options), but omit
47         -fpch-preprocess on -save-temps.
48
49 2008-12-09  Daniel Franke  <franke.daniel@gmail.com>
50
51         PR fortran/36457
52         * lang.opt: Added option idirafter.
53         * cpp.h (gfc_cpp_add_include_path_after): New prototype.
54         * cpp.c (gfc_cpp_handle_option): Recognize and handle OPT_dirafter.
55         (gfc_cpp_add_include_path_after): New, adds user-defined search path
56         after any other paths.
57         * invoke.texi (idirafter): New.
58         (no-range-check): Fixed entry in option-index.
59
60 2008-12-09  Mikael Morin  <mikael.morin@tele2.fr>
61
62         PR fortran/37469
63         * expr.c (find_array_element): Simplify array bounds.
64         Assert that both bounds are constant expressions.
65
66 2008-12-09  Mikael Morin  <mikael.morin@tele2.fr>
67
68         PR fortran/35983
69         * trans-expr.c (gfc_trans_subcomponent_assign):
70         Add se's pre and post blocks to current block.
71         (gfc_trans_structure_assign): Remove specific handling
72         of C_NULL_PTR and C_NULL_FUNPTR.
73
74 2008-12-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
75
76         PR fortran/38425
77         * io.c (check_io_constraints): Check constraints on REC=, POS=, and
78         internal unit with POS=. Fix punctuation on a few error messages.
79
80 2008-12-06  Janus Weil  <janus@gcc.gnu.org>
81
82         PR fortran/38415
83         * expr.c (gfc_check_pointer_assign): Added a check for abstract
84         interfaces in procedure pointer assignments, removed check involving
85         gfc_compare_interfaces until PR38290 is fixed completely.
86
87 2008-12-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
88
89         PR fortran/38291
90         * io.c (match_dt_element): Use dt->pos in matcher.
91         (gfc_free_dt): Free dt->pos after use.
92         (gfc_resolve_dt): Use dt->pos in resolution of stream position tag.
93
94 2008-12-05  Sebastian Pop  <sebastian.pop@amd.com>
95
96         PR bootstrap/38262
97         * Make-lang.in (f951): Add BACKENDLIBS, remove GMPLIBS.
98
99 2008-12-02  Jakub Jelinek  <jakub@redhat.com>
100             Diego Novillo  <dnovillo@google.com>
101
102         * Make-lang.in (install-finclude-dir): Use mkinstalldirs
103         and don't remove the finclude directory beforehand.
104
105 2008-12-02  Janus Weil  <janus@gcc.gnu.org>
106
107         PR fortran/36704
108         PR fortran/38290
109         * decl.c (match_result): Result may be a standard variable or a
110         procedure pointer.
111         * expr.c (gfc_check_pointer_assign): Additional checks for procedure
112         pointer assignments.
113         * primary.c (gfc_match_rvalue): Bugfix for procedure pointer
114         assignments.
115         * resolve.c (resolve_function): Check for attr.subroutine.
116         * symbol.c (check_conflict): Addtional checks for RESULT statements.
117         * trans-types.c (gfc_sym_type,gfc_get_function_type): Support procedure
118         pointers as function result.
119
120 2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>
121
122         PR fortran/38252
123         * parse.c (parse_spec): Skip statement order check in case
124         of a CONTAINS statement.
125
126 2008-11-30  Daniel Kraft  <d@domob.eu>
127
128         PR fortran/37779
129         * gfortran.h (struct gfc_entry_list): Fixed typo in comment.
130         * resolve.c (is_illegal_recursion): New method.
131         (resolve_procedure_expression): Use new is_illegal_recursion instead of
132         direct check and handle function symbols correctly.
133         (resolve_actual_arglist): Removed useless recursion check.
134         (resolve_function): Use is_illegal_recursion instead of direct check.
135         (resolve_call): Ditto.
136
137 2008-11-29  Eric Botcazou  <ebotcazou@adacore.com>
138
139         * trans-array.c (gfc_conv_array_parameter): Guard union access.
140
141 2008-11-29  Janus Weil  <janus@gcc.gnu.org>
142             Mikael Morin <mikael@gcc.gnu.org>
143
144         PR fortran/38289
145         PR fortran/38290
146         * decl.c (match_procedure_decl): Handle whitespaces.
147         * resolve.c (resolve_specific_s0): Bugfix in check for intrinsic
148         interface.
149
150 2008-11-25  H.J. Lu  <hongjiu.lu@intel.com>
151
152         * module.c (gfc_dump_module): Report error on unlink only if
153         errno != ENOENT.
154
155 2008-11-25  Mikael Morin  <mikael.morin@tele2.fr>
156
157         PR fortran/36463
158         * expr.c (replace_symbol): Don't replace the symtree
159         if the expresion is an intrinsic function. Don't create
160         non-existent symtrees.  Use symbol's name instead of symtree's,
161         different in case of module procedure dummy arguments.
162
163 2008-11-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
164
165         PR fortran/38248
166         * module.c (gfc_dump_module): Check rename/unlink syscalls errors.
167
168 2008-11-25  Eric Botcazou  <ebotcazou@adacore.com>
169
170         PR fortran/37319
171         * parse.c (match_deferred_characteristics): Make sure 'name' is
172         initialized before reading it.
173
174 2008-11-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
175
176         PR fortran/37803
177         * arith.c (gfc_check_real_range): Add mpfr_check_range.
178         * simplify.c (gfc_simplify_nearest): Add mpfr_check_range.
179
180 2008-11-24  Mikael Morin  <mikael.morin@tele2.fr>
181
182         PR fortran/38184
183         * simplify.c (is_constant_array_expr): Return true instead of false
184         if the array constructor is empty.
185
186 2008-11-24  Daniel Kraft  <d@domob.eu>
187
188         PR fortran/37779
189         * resolve.c (resolve_procedure_expression): New method.
190         (resolve_variable): Call it.
191         (resolve_actual_arglist): Call gfc_resolve_expr for procedure arguments.
192
193 2008-11-24  Paul Thomas  <pault@gcc.gnu.org>
194
195         PR fortran/34820
196         * trans-expr.c (gfc_conv_function_call): Remove all code to
197         deallocate intent out derived types with allocatable
198         components.
199         (gfc_trans_assignment_1): An assignment from a scalar to an
200         array of derived types with allocatable components, requires
201         a deep copy to each array element and deallocation of the
202         converted rhs expression afterwards.
203         * trans-array.c : Minor whitespace.
204         * trans-decl.c (init_intent_out_dt): Add code to deallocate
205         allocatable components of derived types with intent out.
206         (generate_local_decl): If these types are unused, set them
207         referenced anyway but allow the uninitialized warning.
208
209         PR fortran/34143
210         * trans-expr.c (gfc_trans_subcomponent_assign): If a conversion
211         expression has a null data pointer argument, nullify the
212         allocatable component.
213
214         PR fortran/32795
215         * trans-expr.c (gfc_trans_subcomponent_assign): Only nullify
216         the data pointer if the source is not a variable.
217
218 2008-11-23  Paul Thomas  <pault@gcc.gnu.org>
219
220         PR fortran/37735
221         * trans-array.c (structure_alloc_comps): Do not duplicate the
222         descriptor if this is a descriptorless array!
223
224 2008-11-12  Tobias Burnus  <burnus@net-b.de>
225
226         PR fortran/38160
227         * trans-types.c (gfc_validate_c_kind): Remove function.
228         * decl.c (gfc_match_kind_spec): Add C kind parameter check.
229         (verify_bind_c_derived_type): Remove gfc_validate_c_kind call.
230         (verify_c_interop_param): Update call.
231         * gfortran.h (verify_bind_c_derived_type): Update prototype.
232         (gfc_validate_c_kind): Remove.
233         * symbol.c (verify_bind_c_derived_type): Update verify_c_interop call.
234         * resolve.c (gfc_iso_c_func_interface): Ditto.
235
236 2008-11-22  Jakub Jelinek  <jakub@redhat.com>
237
238         PR libfortran/37839
239         * trans-io.c (gfc_build_io_library_fndecls): Decrease pad size back
240         to 16 pointers plus 32 integers.  Don't use max integer kind
241         alignment, only gfc_intio_kind's alignment.
242         (gfc_trans_inquire): Only set flags2 if mask2 is non-zero.
243         * ioparm.def: Fix order, bitmasks and types of inquire round, sign
244         and pending fields.  Move u in dt before id.
245         * io.c (gfc_free_inquire): Free decimal and size exprs.
246         (match_inquire_element): Match size instead of matching blank twice.
247         (gfc_resolve_inquire): Resolve size.
248
249 2008-11-20  Jakub Jelinek  <jakub@redhat.com>
250
251         PR middle-end/29215
252         * trans-array.c (trans_array_constructor_value,
253         gfc_build_constant_array_constructor): Fill in TREE_PURPOSE.
254
255         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Use
256         gfc_index_one_node.
257         (gfc_conv_intrinsic_size): Use gfc_index_{zero,one}_node.
258
259         PR fortran/38181
260         * trans-intrinsic.c (gfc_conv_intrinsic_size): Inline 2 argument
261         size if the second argument is not optional and one argument size
262         for rank 1 arrays.
263
264 2008-11-19  Paul Thomas  <pault@gcc.gnu.org>
265
266         PR fortran/38171
267         * module.c (load_equiv): Regression fix; check that equivalence
268         members come from the same module only.
269
270 2008-11-16  Mikael Morin <mikael.morin@tele2.fr>
271
272         PR fortran/35681
273         * dependency.c (gfc_check_argument_var_dependency): Add
274         elemental check flag. Issue a warning if we find a dependency
275         but don't generate a temporary. Add the case of an elemental
276         function call as actual argument to an elemental procedure.
277         Add the case of an operator expression as actual argument
278         to an elemental procedure.
279         (gfc_check_argument_dependency): Add elemental check flag.
280         Update calls to gfc_check_argument_var_dependency.
281         (gfc_check_fncall_dependency): Add elemental check flag.
282         Update call to gfc_check_argument_dependency.
283         * trans-stmt.c (gfc_trans_call): Make call to
284         gfc_conv_elemental_dependency unconditional, but with a flag
285         whether we should check dependencies between variables.
286         (gfc_conv_elemental_dependency): Add elemental check flag.
287         Update call to gfc_check_fncall_dependency.
288         * trans-expr.c (gfc_trans_arrayfunc_assign): Update call to
289         gfc_check_fncall_dependency.
290         * resolve.c (find_noncopying_intrinsics): Update call to
291         gfc_check_fncall_dependency.
292         * dependency.h (enum gfc_dep_check): New enum.
293         (gfc_check_fncall_dependency): Update prototype.
294
295 2008-11-16  Mikael Morin  <mikael.morin@tele2.fr>
296
297         PR fortran/37992
298         * gfortran.h (gfc_namespace): Added member old_cl_list, 
299         backup of cl_list.
300         (gfc_free_charlen): Added prototype.
301         * symbol.c (gfc_free_charlen): New function.
302         (gfc_free_namespace): Use gfc_free_charlen.
303         * parse.c (next_statement): Backup gfc_current_ns->cl_list.
304         (reject_statement): Restore gfc_current_ns->cl_list.
305         Free cl_list's elements before dropping them.
306
307 2008-11-16  Tobias Burnus  <burnus@net-b.de>
308
309         PR fortran/38095
310         * trans-expr.c (gfc_map_intrinsic_function): Fix pointer access.
311
312 2008-11-16  Paul Thomas  <pault@gcc.gnu.org>
313
314         PR fortran/38119
315         * trans-array.c (gfc_trans_create_temp_array): Set the
316         loop->from to zero and the renormalisation of loop->to for all
317         dimensions.
318
319 2008-11-16  Paul Thomas  <pault@gcc.gnu.org>
320
321         PR fortran/37926
322         * trans-expr.c (gfc_free_interface_mapping): Null sym->formal
323         (gfc_add_interface_mapping): Copy the pointer to the formal
324         arglist, rather than using copy_formal_args - fixes regression.
325
326 2008-11-15  Paul Thomas  <pault@gcc.gnu.org>
327
328         PR fortran/37926
329         * trans-expr.c (gfc_add_interface_mapping): Transfer the formal
330         arglist and the always_explicit attribute if the dummy arg is a
331         procedure.
332
333 2008-11-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
334
335         PR fortran/37988
336         * io.c (enum format_token): For readability replace FMT_POS with FMT_T,
337         FMT_TL, and FMT_TR.  (format_lex): Use new enumerators. (check_format):
338         Add check for missing positive integer.
339
340 2008-10-14  Paul Thomas  <pault@gcc.gnu.org>
341
342         PR fortran/38033
343         * trans-array.c (gfc_trans_create_temp_array): Stabilize the
344         'to' expression.
345         (gfc_conv_loop_setup): Use the end expression for the loop 'to'
346         if it is available.
347
348 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
349
350         PR target/35366
351         PR fortran/33759
352         * trans-const.c (gfc_conv_constant_to_tree): Warn when
353         converting an integer outside of LOGICAL's range to
354         LOGICAL.
355         * trans-intrinsic.c (gfc_conv_intrinsic_function,
356         gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer):
357         Use INTEGER_TYPE instead of BOOLEAN_TYPE for TRANSFER as
358         argument of another TRANSFER.
359
360 2008-11-12  Tobias Burnus  <burnus@net-b.de>
361
362         PR fortran/38065
363         * resolve.c (resolve_fntype): Fix private derived type checking.
364
365 2008-11-09  Paul Thomas  <pault@gcc.gnu.org>
366
367         PR fortran/37836
368         * intrinsic.c (add_functions): Reference gfc_simplify._minval
369         and gfc_simplify_maxval.
370         * intrinsic.h : Add prototypes for gfc_simplify._minval and
371         gfc_simplify_maxval.
372         * simplify.c (min_max_choose): New function extracted from
373         simplify_min_max.
374         (simplify_min_max): Call it.
375         (simplify_minval_maxval, gfc_simplify_minval,
376         gfc_simplify_maxval): New functions.
377
378 2008-11-04  Paul Thomas  <pault@gcc.gnu.org>
379
380         PR fortran/37597
381         * parse.c (gfc_fixup_sibling_symbols ): Fixup contained, even
382         when symbol not found.
383
384 2008-11-03  Tobias Burnus  <burnus@net-b.de>
385
386         PR fortran/37821
387         * cpp.c (gfc_cpp_add_include_path): Use BRACKET.
388         * scanner.c (add_path_to_list): Argument to add at head.
389         (gfc_add_include_path): Add new argument.
390         (gfc_add_intrinsic_modules_path) Update call.
391         (load_file): Print filename/line in the error message.
392         * gfortran.h (gfc_add_include_path): Update prototype.
393         * options.c (gfc_post_options,gfc_handle_module_path_options,
394         gfc_handle_option): Update call.
395         * lang-spec.h (F951_OPTIONS): Don't insert include path twice.
396
397         * arith.c (arith_error): Add -fno-range-error to the message.
398
399 2008-11-03  Paul Thomas  <pault@gcc.gnu.org>
400
401         PR fortran/37445
402         * resolve.c (resolve_actual_arglist ): Correct comparison of
403         FL_VARIABLE with e->expr_type.
404         (resolve_call): Check that host association is correct.
405         (resolve_actual_arglist ): Remove return is old_sym is use
406         associated.  Only reparse expression if old and new symbols
407         have different types.
408
409         PR fortran/PR35769
410         * resolve.c (gfc_resolve_assign_in_forall): Change error to a
411         warning.
412
413 2008-11-01  Janus Weil  <janus@gcc.gnu.org>
414
415         PR fortran/36426
416         * expr.c (replace_symbol): Replace all symbols which lie in the
417         formal namespace of the interface and copy their attributes.
418         * resolve.c (resolve_symbol): Add charlen to namespace.
419
420 2008-11-01  Steven G. Kargl  <kargls@comcast.net>
421
422         PR fortran/19925
423         * trans-array.c (gfc_trans_array_constructor_value): Fix comment.
424         (gfc_conv_array_initializer): Convert internal_error() to gfc_error_now.
425         * array.c: Remove GFC_MAX_AC_EXPAND macro.
426         (gfc_expand_constructor): Use gfc_option.flag_max_array_constructor.
427         * gfortran.h (gfc_option): Add flag_max_array_constructor member.
428         * lang.opt: Add -fmax-array-constructor option.
429         * expr.c (gfc_match_init_expr): Fix error message to mention new option.
430         * invoke.texi: Document new option.
431         * options.c (gfc_init_options): Set default value for new option.
432         (gfc_handle_option): Deal with commandline.
433
434 2008-11-01  Daniel Kraft  <d@domob.eu>
435
436         PR fortran/35681
437         * gfortran.h (struct gfc_code): New field `resolved_isym'.
438         * trans.h (gfc_build_memcpy_call): Made public.
439         * trans-array.h (gfc_trans_create_temp_array): New argument `initial'.
440         * intrinsic.c (gfc_intrinsic_sub_interface): Set resolved_isym.
441         * iresolve.c (create_formal_for_intents): New helper method.
442         (gfc_resolve_mvbits): Put dummy formal arglist on resolved_sym.
443         * resolve.c (resolve_call): Initialize resolved_isym to NULL.
444         * trans-array.c (gfc_trans_allocate_array_storage): New argument
445         `initial' to allow initializing the allocated storage to some initial
446         value copied from another array.
447         (gfc_trans_create_temp_array): Allow initialization of the temporary
448         with a copy of some other array by using the new extension.
449         (gfc_trans_array_constructor): Pass NULL_TREE for initial argument.
450         (gfc_conv_loop_setup): Ditto.
451         * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Ditto.
452         * trans-expr.c (gfc_conv_function_call): Ditto.
453         (gfc_build_memcpy_call): Made public.
454         * trans-stmt.c (gfc_conv_elemental_dependencies): Initialize created
455         temporary for INTENT(INOUT) arguments to the value of the mirrored
456         array and clean up the temporary as very last intructions in the created
457         block.
458         * trans.c (gfc_trans_code): For EXEC_CALL, see if we have a MVBITS call
459         and enable elemental dependency checking if we have.
460
461 2008-11-01  Janus Weil  <janus@gcc.gnu.org>
462
463         PR fortran/36322
464         PR fortran/36463
465         * gfortran.h: New function gfc_expr_replace_symbols.
466         * decl.c (match_procedure_decl): Increase reference count for interface.
467         * expr.c: New functions replace_symbol and gfc_expr_replace_symbols.
468         * resolve.c (resolve_symbol): Correctly copy array spec and char len
469         of PROCEDURE declarations from their interface.
470         * symbol.c (gfc_get_default_type): Enhanced error message.
471         (copy_formal_args): Call copy_formal_args recursively for arguments.
472         * trans-expr.c (gfc_conv_function_call): Bugfix.
473
474 2008-11-01  Dennis Wassel  <dennis.wassel@gmail.com>
475
476         PR fortran/37159
477         * fortran/check.c (gfc_check_random_seed): Check PUT size
478         at compile time.
479
480 2008-10-31  Mikael Morin  <mikael.morin@tele2.fr>
481
482         PR fortran/35840
483         * expr.c (gfc_reduce_init_expr): New function, containing checking code
484         from gfc_match_init_expr, so that checking can be deferred. 
485         (gfc_match_init_expr): Use gfc_reduce_init_expr.
486         * io.c (check_io_constraints): Use gfc_reduce_init_expr instead of 
487         checking that the expression is a constant. 
488         * match.h (gfc_reduce_init_expr): Prototype added. 
489
490 2008-10-31  Mikael Morin  <mikael.morin@tele2.fr>
491
492         PR fortran/35820
493         * resolve.c (gfc_count_forall_iterators): New function.
494         (gfc_resolve_forall): Use gfc_count_forall_iterators to evaluate 
495         the needed memory amount to allocate. Don't forget to free allocated 
496         memory.  Add an assertion to check for memory leaks. 
497
498 2008-10-30  Steven G. Kargl  <kargls@comcast.net>
499
500         PR fortran/37930
501         * fortran/arith.c (gfc_mpfr_to_mpz):  Test for NaN and Inf values.
502         Remove stale comment and kludge code for MPFR 2.0.1 and older.
503         (gfc_real2int): Error on conversion of NaN or Inf.
504         (gfc_complex2int): Ditto.
505         * fortran/arith.h: Update mpfr_to_mpz prototype.
506         * fortran/simplify.c (gfc_simplify_ceiling, gfc_simplify_floor,
507         gfc_simplify_ifix, gfc_simplify_idint, simplify_nint): Update function
508         calls to include locus.
509
510 2008-10-30  Mikael Morin  <mikael.morin@tele2.fr>
511
512         PR fortran/37903
513         * trans-array.c (gfc_trans_create_temp_array): If n is less
514         than the temporary dimension, assert that loop->from is
515         zero (reverts to earlier versions). If there is at least one
516         null loop->to[n], it is a callee allocated array so set the
517         size to NULL and break.
518         (gfc_trans_constant_array_constructor): Set the offset to zero.
519         (gfc_trans_array_constructor): Remove loop shifting around the
520         temporary creation.
521         (gfc_conv_loop_setup): Prefer zero-based descriptors if
522         possible.  Calculate the translation from loop variables to
523         array indices if an array constructor.
524
525 2008-10-30  Mikael Morin  <mikael.morin@tele2.fr>
526
527         PR fortran/37749
528         * trans-array.c (gfc_trans_create_temp_array): If size is NULL
529         use the array bounds for loop->to.
530
531 2008-10-28  Tobias Burnus  <burnus@net-b.de>
532
533         * intrinsic.texi: Update OpenMP section for OMPv3.
534
535 2008-10-24  Jakub Jelinek  <jakub@redhat.com>
536
537         * Make-lang.in (check-f95-subtargets, check-fortran-subtargets): New
538         aliases for check-gfortran-subtargets.
539         (lang_checks_parallelized): Add check-gfortran.
540         (check_gfortran_parallelize): New variable.
541
542 2008-10-19  Paul Thomas  <pault@gcc.gnu.org>
543
544         PR fortran/37723
545         * dependency.c (gfc_dep_resolver ): If we find equal array
546         element references, go on to the next reference.
547
548 2008-10-16  Daniel Kraft  <d@domob.eu>
549
550         * resolve.c (resolve_elemental_actual): Handle calls to intrinsic
551         subroutines correctly.
552
553 2008-10-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
554
555         * simplify.c: Remove MPFR_VERSION_NUM(2,3,0) conditionals.
556
557 2008-10-12  Daniel Kraft  <d@domob.eu>
558
559         PR fortran/37688
560         * expr.c (gfc_expr_check_typed): Extend permission of untyped
561         expressions to both top-level variable and basic arithmetic expressions.
562
563 2008-10-12  Paul Thomas  <pault@gcc.gnu.org>
564
565         PR fortran/37787
566         * dependency.c (gfc_are_equivalenced_arrays): Look in symbol
567         namespace rather than current namespace, if it is available.
568
569 2008-10-12  Steven G. Kargl  <kargls@comcast.net>
570
571         PR fortran/37792
572         * fortran/resolve.c (resolve_fl_variable): Simplify the
573         initializer if there is one.
574
575 2008-10-11  Paul Thomas  <pault@gcc.gnu.org>
576
577         PR fortran/37794
578         * module.c (check_for_ambiguous): Remove redundant code.
579
580 2008-10-09  Daniel Kraft  <d@domob.eu>
581
582         PR fortran/35723
583         * gfortran.h (gfc_suppress_error): Removed from header.
584         (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
585         * array.c (gfc_array_size): Use new gfc_push/pop_suppress_errors
586         instead of directly changing gfc_suppress_error.
587         * intrinsic.c (gfc_intrinsic_func_interface): Ditto.
588         (gfc_intrinsic_sub_interface): Ditto.
589         * error.c (suppress_errors): Made static from `gfc_suppress_error'.
590         (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
591         (gfc_notify_std), (gfc_error): Use new static name of global.
592         * expr.c (check_arglist), (check_references): New methods.
593         (check_restricted): Check arglists and references of EXPR_FUNCTIONs
594         and EXPR_VARAIBALEs, respectively.  Allow PARAMETER symbols.
595
596 2008-10-07  Jakub Jelinek  <jakub@redhat.com>
597
598         * f95-lang.c (poplevel): Don't clear BLOCK_VARS if functionbody.
599         * trans-decl.c (gfc_build_qualified_array): Build accurate debug type
600         even if nest.
601         (build_entry_thunks, gfc_generate_function_code,
602         gfc_generate_constructors): Ensure DECL_SAVED_TREE is a BIND_EXPR
603         with DECL_INITIAL as its BLOCK.
604
605 2008-10-05  Paul Thomas  <pault@gcc.gnu.org>
606
607         PR fortran/35680
608         * gfortran.h : Add 'error' bit field to gfc_expr structure.
609         * expr.c (check_inquiry): When checking a restricted expression
610         check that arguments are either variables or restricted.
611         (check_restricted): Do not emit error if the expression has
612         'error' set.  Clean up detection of host-associated variable.
613
614 2008-10-05  Daniel Kraft  <d@domob.eu>
615
616         PR fortran/37638
617         * gfortran.h (struct gfc_typebound_proc): New flag `error'.
618         * resolve.c (update_arglist_pass): Added assertion.
619         (update_compcall_arglist): Fail early for erraneous procedures to avoid
620         confusion later.
621         (resolve_typebound_generic_call): Ignore erraneous specific targets
622         and added assertions.
623         (resolve_typebound_procedure): Set new `error' flag.
624
625 2008-10-04  Paul Thomas  <pault@gcc.gnu.org>
626
627         PR fortran/37706
628         * module.c (load_equiv): Check the module before negating the
629         unused flag.
630
631 2008-10-02  Steven Bosscher  <steven@gcc.gnu.org>
632
633         PR fortran/37635
634         * intrinsic.c (add_functions): Add LEADZ and TRAILZ as generics.
635         * intrinsic.h (gfc_simplify_leadz, gfc_simplify_trailz): New protos.
636         * gfortran.h <enum gfc_isym_id>: (GFC_ISYM_LEADZ, GFC_ISYM_TRAILZ): New.
637         * f95-lang (gfc_init_builtin_functions): Add BUILT_IN_CLZ,
638         BUILT_IN_CLZL, BUILT_IN_CLZLL, BUILT_IN_CTZ, BUILT_IN_CTZL, and
639         BUILT_IN_CTZLL.
640         * trans-intrinsic.c (gfc_conv_intrinsic_leadz,
641         gfc_conv_intrinsic_trails): New code-generation functions for LEADZ
642         and TRAILZ intrinsics.
643         (gfc_conv_intrinsic_function): Use them
644         * intrinsic.texi: Add documentation for LEADZ and TRAILZ.
645         * simplify.c (gfc_simplify_leadz, gfc_simplify_trailz): New functions.
646
647 2008-09-30  Janus Weil  <janus@gcc.gnu.org>
648
649         PR fortran/36592
650         * symbol.c (check_conflict): If a symbol in a COMMON block is a
651         procedure, it must be a procedure pointer.
652         (gfc_add_in_common): Symbols in COMMON blocks may be variables or
653         procedure pointers.
654         * trans-types.c (gfc_sym_type): Make procedure pointers in COMMON
655         blocks work.
656
657 2008-09-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org
658
659         PR fortran/37498
660         * trans-io.c (build_dt): Revert previous patch..
661         * ioparm.def: Delete IOPARM_dt_f2003.
662
663 2008-09-25  Tobias Burnus  <burnus@net-b.de>
664
665         PR fortran/37504
666         * expr.c (gfc_check_pointer_assign): Allow assignment of
667         protected pointers.
668         * match.c (gfc_match_assignment,gfc_match_pointer_assignment):
669         Remove unreachable code.
670
671 2008-09-24  Tobias Burnus  <burnus@net-b.de>
672
673         * options.c (set_default_std_flags,gfc_init_options):
674         Add comment: keep in sync with libgfortran.
675
676 2008-09-24  Tobias Burnus  <burnus@net-b.de>
677
678         PR fortran/37626
679         * trans-array.c (gfc_trans_deferred_array): Don't auto-deallocate
680         result variables.
681
682 2008-09-23  Daniel Kraft  <d@domob.eu>
683
684         PR fortran/37588
685         * gfortran.h (gfc_compare_actual_formal): Removed, made private.
686         (gfc_arglist_matches_symbol): New method.
687         * interface.c (compare_actual_formal): Made static.
688         (gfc_procedure_use): Use new name of compare_actual_formal.
689         (gfc_arglist_matches_symbol): New method.
690         (gfc_search_interface): Moved code partially to new
691         gfc_arglist_matches_symbol.
692         * resolve.c (resolve_typebound_generic_call): Resolve actual arglist
693         before checking against formal and use new gfc_arglist_matches_symbol
694         for checking.
695         (resolve_compcall): Set type-spec of generated expression.
696
697 2008-09-23  Tobias Burnus  <burnus@net-b.de>
698
699         PR fortran/37580
700         * expr.c (gfc_check_pointer_assign): Add checks for pointer
701         remapping.
702
703 2008-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org
704
705         PR fortran/37498
706         * trans-io.c (gfc_build_io_library_fndecls): Bump pad size.
707         (build_dt): Set mask bit for IOPARM_dt_f2003.
708         * ioparm.def: Add IOPARM_dt_f2003.
709
710 2008-09-22  Janus Weil  <janus@gcc.gnu.org>
711
712         PR fortran/37486
713         * gfortran.h (gfc_option_t): New members flag_align_commons and
714         warn_align_commons. 
715         * lang.opt: New options falign-commons and Walign-commons.
716         * invoke.texi: Documentation for new options.
717         * options.c (gfc_init_options): Initialize new options.
718         (gfc_handle_options): Handle new options.
719         * trans-common.c (translate_common): Implement new options.
720         (gfc_trans_common): Set correct locus.
721
722 2008-09-21  Paul Thomas  <pault@gcc.gnu.org>
723
724         PR fortran/37583
725         * decl.c (scalarize_intrinsic_call): Both subroutines and
726         functions can give a true for get_proc_mame's last argument so
727         remove the &&gfc_current_ns->proc_name->attr.function.
728         resolve.c (resolve_actual_arglist): Add check for recursion by
729         reference to procedure as actual argument.
730
731 2008-09-21  Daniel Kraft  <d@domob.eu>
732
733         PR fortran/35846
734         * trans.h (gfc_conv_string_length): New argument `expr'.
735         * trans-expr.c (flatten_array_ctors_without_strlen): New method.
736         (gfc_conv_string_length): New argument `expr' that is used in a new
737         special case handling if cl->length is NULL.
738         (gfc_conv_subref_array_arg): Pass expr to gfc_conv_string_length.
739         * trans-array.c (gfc_conv_expr_descriptor): Ditto.
740         (gfc_trans_auto_array_allocation): Pass NULL as new expr.
741         (gfc_trans_g77_array), (gfc_trans_dummy_array_bias): Ditto.
742         (gfc_trans_deferred_array): Ditto.
743         (gfc_trans_array_constructor): Save and restore old values of globals
744         used for bounds checking.
745         * trans-decl.c (gfc_trans_dummy_character): Ditto.
746         (gfc_trans_auto_character_variable): Ditto.
747
748 2008-09-21  Daniel Kraft  <d@domob.eu>
749
750         * decl.c (match_procedure_in_type): Changed misleading error message
751         for not yet implemented PROCEDURE(interface) syntax.
752
753 2008-09-18  Paul Thomas  <pault@gcc.gnu.org>
754
755        PR fortran/35945
756        * resolve.c (resolve_fl_variable_derived):  Remove derived type
757        comparison for use associated derived types.  Host association
758        of a derived type will not arise if there is a local derived type
759        whose use name is the same.
760
761        PR fortran/36700
762        * match.c (gfc_match_call):  Use the existing symbol even if
763        it is a function.
764
765 2008-09-18  Daniel Kraft  <d@domob.eu>
766
767         PR fortran/37507
768         * trans.h (gfc_trans_runtime_error): New method.
769         (gfc_trans_runtime_error_vararg): New method.
770         (gfc_allocate_array_with_status): New argument `expr' for locus/varname.
771         (gfc_deallocate_array_with_status): Ditto.
772         * trans-array.h (gfc_array_deallocate): Ditto.
773         * trans.c (gfc_trans_runtime_error): New method.
774         (gfc_trans_runtime_error_vararg): New method, moved parts of the code
775         from gfc_trans_runtime_check here.
776         (gfc_trans_runtime_error_check): Moved code partly to new method.
777         (gfc_call_malloc): Fix tab-indentation.
778         (gfc_allocate_array_with_status): New argument `expr' and call
779         gfc_trans_runtime_error for error reporting to include locus.
780         (gfc_deallocate_with_status): Ditto.
781         * trans-stmt.c (gfc_trans_deallocate): Pass expr as new argument.
782         * trans-array.c (gfc_array_allocate): Ditto.
783         (gfc_array_deallocate): New argument `expr', passed on.
784         (gfc_trans_dealloc_allocated): Pass NULL for expr.
785         * trans-openmp.c (gfc_omp_clause_default): Ditto.
786
787 2008-09-18  Paul Thomas  <pault@gcc.gnu.org>
788
789         PR fortran/37274
790         PR fortran/36374
791         * module.c (check_for_ambiguous): New function to test loaded
792         symbol for ambiguity with fixup symbol.
793         (read_module): Call check_for_ambiguous.
794         (write_symtree): Do not write the symtree for symbols coming
795         from an interface body.
796
797         PR fortran/36374
798         * resolve.c (count_specific_procs ): New function to count the
799         number of specific procedures with the same name as the generic
800         and emit appropriate errors for and actual argument reference.
801         (resolve_assumed_size_actual): Add new argument no_formal_args.
802         Correct logic around passing generic procedures as arguments.
803         Call count_specific_procs from two locations.
804         (resolve_function): Evaluate and pass no_formal_args.
805         (resolve call): The same and clean up a bit by using csym more
806         widely.
807
808         PR fortran/36454
809         * symbol.c (gfc_add_access): Access can be updated if use
810         associated and not private.
811
812 2008-09-17  Jakub Jelinek  <jakub@redhat.com>
813
814         PR fortran/37536
815         * trans-stmt.c (gfc_trans_do): Optimize integer type non-simple
816         do loop initialization.
817
818 2008-09-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
819             Tobias Burnus  <burnus@net.b.de>
820
821         PR fortran/35840
822         * io.c (match_vtag): Add tag name to error message.
823         (match_out_tag): Cleanup whitespace.
824         (gfc_resolve_dt): Resolve id and async tags. 
825
826 2008-09-13  Daniel Kraft  <d@domob.eu>
827
828         PR fortran/35770
829         * primary.c (gfc_match_varspec): Added missing type-spec clearing
830         after wrong implicit character typing.
831
832 2008-09-12  Richard Guenther  <rguenther@suse.de>
833
834         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Use
835         build_fold_addr_expr to properly mark the argument
836         addressable.
837
838 2008-09-11  Daniel Kraft  <d@domob.eu>
839
840         PR fortran/36214
841         * simplify.c (simplify_cmplx): Added linebreak to long line.
842         * target-memory.c (gfc_convert_boz): Fix indentation.
843         (gfc_interpret_float): Set mpfr precision to right value before
844         calling mpfr_init.
845
846 2008-09-10  H.J. Lu  <hongjiu.lu@intel.com>
847
848         * expr.c (find_array_element): Reformat comment.
849
850 2008-09-10  H.J. Lu  <hongjiu.lu@intel.com>
851
852         * expr.c (find_array_element): Reformat.
853
854 2008-09-10  Tobias Burnus  <burnus@net-b.de>
855
856         PR fortran/37420
857         * trans-decl.c (get_proc_pointer_decl): Fix -Wunused-variable.
858
859 2008-09-09  Daniel Kraft  <d@domob.eu>
860
861         PR fortran/37429
862         * resolve.c (expression_rank): Added assertion to guard against
863         EXPR_COMPCALL expressions.
864         (resolve_compcall): Set expression's rank from the target procedure's.
865
866 2008-09-09  Daniel Kraft  <d@domob.eu>
867
868         PR fortran/37411
869         * trans-array.c (gfc_conv_array_parameter): Added assertion that the
870         symbol has an array spec.
871
872 2008-09-08  Daniel Kraft  <d@domob.eu>
873
874         PR fortran/37199
875         * trans-expr.c (gfc_add_interface_mapping): Set new_sym->as.
876         (gfc_map_intrinsic_function): Added checks against NULL bounds in
877         array specs.
878
879 2008-09-08  Tobias Burnus  <burnus@net.b.de>
880
881         PR fortran/37400
882         * symbol.c (gfc_set_default_type): Copy char len.
883
884 2008-09-06  Steven G. Kargl  <kargls@comcast.net>
885
886         PR fortran/36153
887         * fortran/resolve.c (resolve_function): Shortcircuit for SIZE and
888         UBOUND if 2nd argument is KIND.
889
890 2008-09-06  Steven G. Kargl  <kargls@comcast.net>
891
892         PR fortran/33229
893         * resolve.c (resolve_function): An intrinsic subroutine should not be
894         called as a function.
895
896 2008-09-05  Daniel Kraft  <d@domob.eu>
897
898         PR fortran/35837
899         * resolve.c (resolve_types): Restore gfc_current_ns on exit.
900         * symbol.c (gfc_save_all): Removed blank line.
901
902 2008-09-05  Daniel Kraft  <d@domob.eu>
903
904         PR fortran/36746
905         * primary.c (gfc_match_rvalue): Removed logic to handle implicit
906         typing to a derived-type if a component reference is found.
907         (gfc_match_varspec): Moved it here.
908
909 2008-09-04  Richard Guenther  <rguenther@suse.de>
910
911         * trans-array.c (gfc_conv_array_parameter): Use correct types
912         in building COND_EXPRs.
913         * trans-expr.c (gfc_conv_missing_dummy): Likewise.
914         * trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise.
915
916 2008-09-04  Daniel Kraft  <d@domob.eu>
917
918         * PR fortran/37099
919         * expr.c (simplify_const_ref): Update expression's character length
920         when pulling out a substring reference.
921
922 2008-09-04  Ian Lance Taylor  <iant@google.com>
923
924         * symbol.c (generate_isocbinding_symbol): Compare
925         gfc_notification_std with ERROR rather than FAILURE.
926         * resolve.c (check_assumed_size_reference): Compare array type
927         with AR_FULL rather than DIMEN_ELEMENT.
928         (resolve_actual_arglist): Compare with EXPR_VARIABLE rather than
929         FL_VARIABLE.
930
931 2008-09-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
932
933         PR fortran/37228
934         * io.c (check_format): Allow specifying precision with g0 format.
935
936 2008-09-02  Daniel Kraft  <d@domob.eu>
937
938         * gfortran.h (struct gfc_namespace): New member `implicit_loc'.
939         (gfc_add_abstract): New method.
940         * decl.c (gfc_get_type_attr_spec): Match ABSTRACT attribute.
941         (gfc_match_derived_decl): Copy abstract attribute in derived symbol.
942         * dump-parse-tree.c (show_attr): Show ABSTRACT attribute as `ABSTRACT'
943         only to allow for ABSTRACT types.
944         * parse.c (parse_interface): Use new gfc_add_abstract.
945         * primary.c (gfc_match_structure_constructor): Check that no ABSTRACT
946         type is constructed.
947         * resolve.c (resolve_typespec_used): New method.
948         (resolve_fl_derived): Check type in respect to ABSTRACT attribute and
949         check that no component is of an ABSTRACT type.
950         (resolve_symbol): Check that no symbol is of an ABSTRACT type.
951         (resolve_types): Check IMPLICIT declarations for ABSTRACT types.
952         * symbol.c (gfc_merge_new_implicit): Remember loci of IMPLICIT's.
953         (gfc_add_abstract): New method.
954
955 2008-09-01  Daniel Kraft  <d@domob.eu>
956
957         PR fortran/37193
958         * module.c (read_module): Initialize use_only flag on used symbols.
959
960 2008-09-01  Daniel Kraft  <d@domob.eu>
961
962         * gfc-internals.texi (F2003 OOP), (Type-bound Procedures): New chapter
963         and section to document the internals of type-bound procedures.
964         (gfc_expr): Document EXPR_COMPCALL.
965         * gfortran.h (struct gfc_expr): Remove unused `derived' from compcall.
966         * dump-parse-tree.c (show_compcall): New method.
967         (show_expr): Call it for EXPR_COMPCALL.
968         (show_typebound), (show_f2k_derived): New methods.
969         (show_symbol): Call show_f2k_derived.
970         (show_code_node): Handle EXEC_COMPCALL.
971         * primary.c (gfc_match_varspec): Don't initialize removed `derived' in
972         primary->value.compcall.
973
974 2008-08-31  Richard Guenther  <rguenther@suse.de>
975
976         * trans-expr.c (gfc_trans_string_copy): Use the correct types
977         to compute slen and dlen.
978
979 2008-08-31  Daniel Kraft  <d@domob.eu>
980
981         * gfortran.h (enum gfc_statement): New entry `ST_GENERIC'.
982         (struct gfc_tbp_generic): New type.
983         (struct gfc_typebound_proc): Removed `target' and added union with
984         `specific' and `generic' members; new members `overridden',
985         `subroutine', `function' and `is_generic'.
986         (struct gfc_expr): New members `derived' and `name' in compcall union
987         member and changed type of `tbp' to gfc_typebound_proc.
988         (gfc_compare_interfaces), (gfc_compare_actual_formal): Made public.
989         * match.h (gfc_typebound_default_access): New global.
990         (gfc_match_generic): New method.
991         * decl.c (gfc_match_generic): New method.
992         (match_binding_attributes): New argument `generic' and handle it.
993         (match_procedure_in_type): Mark matched binding as non-generic.
994         * interface.c (gfc_compare_interfaces): Made public.
995         (gfc_compare_actual_formal): Ditto.
996         (check_interface_1), (compare_parameter): Use new public names.
997         (gfc_procedure_use), (gfc_search_interface): Ditto.
998         * match.c (match_typebound_call): Set base-symbol referenced.
999         * module.c (binding_generic): New global array.
1000         (current_f2k_derived): New global.
1001         (mio_typebound_proc): Handle IO of GENERIC bindings.
1002         (mio_f2k_derived): Record current f2k-namespace in current_f2k_derived.
1003         * parse.c (decode_statement): Handle GENERIC statement.
1004         (gfc_ascii_statement): Ditto.
1005         (typebound_default_access), (set_typebound_default_access): Removed.
1006         (gfc_typebound_default_access): New global.
1007         (parse_derived_contains): New default-access implementation and handle
1008         GENERIC statements encountered.
1009         * primary.c (gfc_match_varspec): Adapted to new gfc_typebound_proc
1010         structure and removed check for SUBROUTINE/FUNCTION from here.
1011         * resolve.c (extract_compcall_passed_object): New method.
1012         (update_compcall_arglist): Use it.
1013         (resolve_typebound_static): Adapted to new gfc_typebound_proc structure.
1014         (resolve_typebound_generic_call): New method.
1015         (resolve_typebound_call): Check target is a SUBROUTINE and handle calls
1016         to GENERIC bindings.
1017         (resolve_compcall): Ditto (check for target being FUNCTION).
1018         (check_typebound_override): Handle GENERIC bindings.
1019         (check_generic_tbp_ambiguity), (resolve_typebound_generic): New methods.
1020         (resolve_typebound_procedure): Handle GENERIC bindings and set new
1021         attributes subroutine, function and overridden in gfc_typebound_proc.
1022         (resolve_fl_derived): Ensure extended type is resolved before the
1023         extending one is.
1024         * st.c (gfc_free_statement): Fix bug with free'ing EXEC_COMPCALL's.
1025         * symbol.c (gfc_find_typebound_proc): Adapt for GENERIC changes.
1026
1027 2008-08-29  Jan Hubicka  <jh@suse.cz>
1028         
1029         * parse.c (parse_interface): Silence uninitialized var warning.
1030
1031 2008-08-29  Jakub Jelinek  <jakub@redhat.com>
1032
1033         * trans.h (struct lang_type): Add span.
1034         (GFC_TYPE_ARRAY_SPAN): Define.
1035         * trans-decl.c (gfc_get_symbol_decl): For subref array pointers,
1036         copy TREE_STATIC from decl to span instead of setting it
1037         unconditionally, set DECL_ARTIFICIAL, fix type of initializer
1038         and set GFC_TYPE_ARRAY_SPAN on decl's type.
1039         * trans-types.c (gfc_get_array_descr_info): If
1040         GFC_TYPE_ARRAY_SPAN is non-NULL, use it as element size.
1041
1042         * trans-decl.c (check_constant_initializer,
1043         gfc_emit_parameter_debug_info): New functions.
1044         (gfc_generate_module_vars, gfc_generate_function_code): Emit
1045         PARAMETERs and unreferenced variables with initializers into
1046         debug info.
1047
1048         * gfortran.h (gfc_use_list): Add where field.
1049         * module.c (use_locus): New static variable.
1050         (gfc_match_use): Set it.
1051         (gfc_use_module): Copy it to gfc_use_list's where field.
1052         * trans-decl.c (gfc_generate_module_vars): Call gfc_trans_use_stmts.
1053         (gfc_trans_use_stmts): Set backend locus before calling the debug
1054         hook.  Allow non-VAR_DECLs to be created even for non-external
1055         module.  Don't emit anything so far for renames from different
1056         modules.
1057
1058         PR fortran/24790
1059         * trans-decl.c (create_function_arglist): Set DECL_BY_REFERENCE on
1060         PARM_DECLs with pointer or reference type.
1061
1062         * trans-decl.c (gfc_build_qualified_array): Build non-flat
1063         array type for debug info purposes.
1064
1065         PR fortran/29635
1066         PR fortran/23057
1067         * f95-lang.c (gfc_init_ts): New function.
1068         (LANG_HOOKS_INIT_TS): Define.
1069         * gfortran.h (gfc_use_rename): New type, moved from module.c.
1070         (gfc_get_use_rename): New macro, moved from module.c.
1071         (gfc_use_list): New type.
1072         (gfc_get_use_list): New macro.
1073         (gfc_namespace): Add use_stmts field.
1074         (gfc_free_use_stmts): New prototype.
1075         * Make-lang.in (fortran/trans-decl.o): Depend on debug.h.
1076         * module.c (gfc_use_rename, gfc_get_use_rename): Moved to
1077         gfortran.h.
1078         (gfc_use_module): Chain the USE statement info to
1079         ns->use_stmts.
1080         (gfc_free_use_stmts): New function.
1081         * symbol.c (gfc_free_namespace): Call gfc_free_use_stmts.
1082         * trans.h (struct module_htab_entry): New type.
1083         (gfc_find_module, gfc_module_add_decl): New functions.
1084         * trans.c (gfc_generate_module_code): Create NAMESPACE_DECL for
1085         the module, adjust DECL_CONTEXTs of module procedures and
1086         call gfc_module_add_decl for them.
1087         * trans-common.c (build_common_decl): Set DECL_IGNORED_P
1088         on the common variable.
1089         (create_common): Set DECL_IGNORED_P for use associated vars.
1090         * trans-decl.c: Include debug.h.
1091         (gfc_get_symbol_decl): Set DECL_IGNORED_P on use_assoc vars from
1092         modules.
1093         (build_function_decl): Allow current_function_decl's context
1094         to be a NAMESPACE_DECL.
1095         (module_htab, cur_module): New variables.
1096         (module_htab_do_hash, module_htab_eq, module_htab_decls_hash,
1097         module_htab_decls_eq, gfc_find_module, gfc_module_add_decl): New
1098         functions.
1099         (gfc_create_module_variable): Adjust DECL_CONTEXTs of module
1100         variables and types and call gfc_module_add_decl for them.
1101         (gfc_generate_module_vars): Temporarily set cur_module.
1102         (gfc_trans_use_stmts): New function.
1103         (gfc_generate_function_code): Call it.
1104         (gfc_generate_block_data): Set DECL_IGNORED_P on decl.
1105         * trans-types.c (gfc_get_derived_type): Adjust DECL_CONTEXT
1106         and TYPE_CONTEXT of module derived types.
1107
1108 2008-08-28  Daniel Kraft  <d@domob.eu>
1109
1110         * gfortran.h (enum expr_t): New value `EXPR_COMPCALL'.
1111         (gfc_get_typebound_proc): New macro.
1112         (struct gfc_expr): New union-member `compcall' for EXPR_COMPCALL.
1113         (enum gfc_exec_op): New value `EXEC_COMPCALL'.
1114         (gfc_find_typebound_proc): New argument.
1115         (gfc_copy_ref), (gfc_match_varspec): Made public.
1116         * decl.c (match_procedure_in_type): Use gfc_get_typebound_proc.
1117         * expr.c (free_expr0), (gfc_copy_expr): Handle EXPR_COMPCALL.
1118         (gfc_copy_ref): Made public and use new name.
1119         (simplify_const_ref): Use new name of gfc_copy_ref.
1120         (simplify_parameter_variable): Ditto.
1121         (gfc_simplify_expr): gcc_unreachable for EXPR_COMPCALL.
1122         * match.c (match_typebound_call): New method.
1123         (gfc_match_call): Allow for CALL's to typebound procedures.
1124         * module.c (binding_passing), (binding_overriding): New variables.
1125         (expr_types): Add EXPR_COMPCALL.
1126         (mio_expr): gcc_unreachable for EXPR_COMPCALL.
1127         (mio_typebound_proc), (mio_typebound_symtree): New methods.
1128         (mio_f2k_derived): Handle type-bound procedures.
1129         * primary.c (gfc_match_varspec): Made public and parse trailing
1130         references to type-bound procedures; new argument `sub_flag'.
1131         (gfc_match_rvalue): New name and argument of gfc_match_varspec.
1132         (match_variable): Ditto.
1133         * resolve.c (update_arglist_pass): New method.
1134         (update_compcall_arglist), (resolve_typebound_static): New methods.
1135         (resolve_typebound_call), (resolve_compcall): New methods.
1136         (gfc_resolve_expr): Handle EXPR_COMPCALL.
1137         (resolve_code): Handle EXEC_COMPCALL.
1138         (resolve_fl_derived): New argument to gfc_find_typebound_proc.
1139         (resolve_typebound_procedure): Ditto and removed not-implemented error.
1140         * st.c (gfc_free_statement): Handle EXEC_COMPCALL.
1141         * symbol.c (gfc_find_typebound_proc): New argument `noaccess' and
1142         implement access-checking.
1143         * trans-expr.c (gfc_apply_interface_mapping_to_expr): gcc_unreachable
1144         on EXPR_COMPCALL.
1145         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Add missing break.
1146         * trans-openmp.c (gfc_trans_omp_array_reduction): Add missing
1147         intialization of ref->type.
1148
1149 2008-08-28  Janus Weil  <janus@gcc.gnu.org>
1150
1151         PR fortran/37253
1152         * module.c (ab_attribute,attr_bits,mio_symbol_attribute): Take care of
1153         saving attr.procedure and attr.proc_ptr to the module file.
1154
1155 2008-08-25  Daniel Kraft  <d@domob.eu>
1156
1157         * gfortran.h (gfc_find_component): Add new arguments.
1158         * parse.c (parse_derived_contains): Check if the derived-type containing
1159         the CONTAINS section is SEQUENCE/BIND(C).
1160         * resolve.c (resolve_typebound_procedure): Check for name collision with
1161         components.
1162         (resolve_fl_derived): Check for name collision with inherited
1163         type-bound procedures.
1164         * symbol.c (gfc_find_component): New arguments `noaccess' and `silent'.
1165         (gfc_add_component): Adapt for new arguments.
1166         * primary.c (match_varspec), (gfc_match_structure_constructor): Ditto.
1167
1168 2008-08-24  Tobias Burnus  <burnus@net-b.de>
1169
1170         PR fortran/37201
1171         * decl.c (verify_bind_c_sym): Reject array/string returning
1172         functions.
1173
1174 2008-08-24  Tobias Burnus  <burnus@net-b.de>
1175
1176         PR fortran/37201
1177         * trans-expr.c (gfc_conv_function_call): Add string_length
1178         for character-returning bind(C) functions.
1179
1180 2008-08-24  Daniel Kraft  <d@domob.eu>
1181
1182         * gfortran.h (gfc_typebound_proc):  New struct.
1183         (gfc_symtree):  New member typebound.
1184         (gfc_find_typebound_proc):  Prototype for new method.
1185         (gfc_get_derived_super_type):  Prototype for new method.
1186         * parse.h (gfc_compile_state):  New state COMP_DERIVED_CONTAINS.
1187         * decl.c (gfc_match_procedure):  Handle PROCEDURE inside derived-type
1188         CONTAINS section.
1189         (gfc_match_end):  Handle new context COMP_DERIVED_CONTAINS.
1190         (gfc_match_private):  Ditto.
1191         (match_binding_attributes), (match_procedure_in_type):  New methods.
1192         (gfc_match_final_decl):  Rewrote to make use of new
1193         COMP_DERIVED_CONTAINS parser state.
1194         * parse.c (typebound_default_access):  New global helper variable.
1195         (set_typebound_default_access):  New callback method.
1196         (parse_derived_contains):  New method.
1197         (parse_derived):  Extracted handling of CONTAINS to new parser state
1198         and parse_derived_contains.
1199         * resolve.c (resolve_bindings_derived), (resolve_bindings_result):  New.
1200         (check_typebound_override), (resolve_typebound_procedure):  New methods.
1201         (resolve_typebound_procedures):  New method.
1202         (resolve_fl_derived):  Call new resolving method for typebound procs.
1203         * symbol.c (gfc_new_symtree):  Initialize new member typebound to NULL.
1204         (gfc_find_typebound_proc):  New method.
1205         (gfc_get_derived_super_type):  New method.
1206
1207 2008-08-23  Janus Weil  <janus@gcc.gnu.org>
1208
1209         * gfortran.h (gfc_component): Add field "symbol_attribute attr", remove
1210         fields "pointer", "allocatable", "dimension", "access".
1211         Remove functions "gfc_set_component_attr" and "gfc_get_component_attr".
1212         * interface.c (gfc_compare_derived_types): Ditto.
1213         * trans-array.c (gfc_array_allocate,structure_alloc_comps): Ditto.
1214         * trans-expr.c (gfc_conv_component_ref,gfc_trans_subcomponent_assign,
1215         gfc_conv_structure): Ditto.
1216         * symbol.c (gfc_find_component,free_components,gfc_set_component_attr,
1217         gfc_get_component_attr,verify_bind_c_derived_type,
1218         generate_isocbinding_symbol): Ditto.
1219         * decl.c (build_struct): Ditto.
1220         * dump-parse-tree.c (show_components): Ditto.
1221         * trans-stmt.c (gfc_trans_deallocate): Ditto.
1222         * expr.c (gfc_check_assign,gfc_check_pointer_assign,
1223         gfc_default_initializer): Ditto.
1224         * module.c (mio_component): Ditto.
1225         * trans-types.c (copy_dt_decls_ifequal,gfc_get_derived_type): Ditto.
1226         * resolve.c (has_default_initializer,resolve_structure_cons,
1227         gfc_iso_c_func_interface,find_array_spec,resolve_ref,
1228         resolve_deallocate_expr,resolve_allocate_expr,resolve_fl_derived,
1229         resolve_equivalence_derived): Ditto.
1230         * trans-io.c (transfer_expr): Ditto.
1231         * parse.c (parse_derived): Ditto.
1232         * dependency.c (gfc_check_dependency): Ditto.
1233         * primary.c (gfc_variable_attr): Ditto.
1234
1235 2008-08-23  Tobias Burnus  <burnus@net-b.de>
1236
1237         PR fortran/37076
1238         * arith.c (gfc_arith_concat): Fix concat of kind=4 strings.
1239
1240 2008-08-23  Tobias Burnus  <burnus@net-b.de>
1241
1242         PR fortran/37025
1243         * target-memory.c (gfc_interpret_character): Support
1244         kind=4 characters.
1245
1246 2008-08-22  Daniel Kraft  <d@domob.eu>
1247
1248         PR fortran/30239
1249         * symbol.c (gfc_add_type): Warn on -Wsurprising if a function-result
1250         type is re-declared but neither -pedantic nor -std=f* is given and so
1251         this is no error.
1252         * invoke.texi (-Wsurprising): Document this new behaviour.
1253
1254 2008-08-22  Daniel Kraft  <d@domob.eu>
1255
1256         * gfortran.h (in_prefix): Removed from this header.
1257         * match.h (gfc_matching_prefix): Moved and renamed from `in_prefix'.
1258         * decl.c (in_prefix): Removed from here.
1259         (gfc_match_prefix): Use new name of `gfc_matching_prefix'.
1260         * symbol.c (gfc_check_symbol_typed): Ditto.
1261         * expr.c (check_typed_ns): New helper variable.
1262         (expr_check_typed_help): New helper method.
1263         (gfc_expr_check_typed): Rewrote to use gfc_traverse_expr to do the
1264         work, fixing a minor problem.
1265         * match.c (gfc_matching_prefix): New variable.
1266
1267 2008-08-22  Daniel Kraft  <d@domob.eu>
1268
1269         PR fortran/32095
1270         PR fortran/34228
1271         * gfortran.h (in_prefix): New global.
1272         (gfc_check_symbol_typed), (gfc_check_expr_typed): New methods.
1273         * array.c (match_array_element_spec): Check that bounds-expressions
1274         don't have symbols not-yet-typed in them.
1275         * decl.c (var_element): Check that variable used is already typed.
1276         (char_len_param_value): Check that expression does not contain
1277         not-yet-typed symbols.
1278         (in_prefix): New global.
1279         (gfc_match_prefix): Record using `in_prefix' if we're at the moment
1280         parsing a prefix or not.
1281         * expr.c (gfc_expr_check_typed): New method.
1282         * parse.c (verify_st_order): New argument to disable error output.
1283         (check_function_result_typed): New helper method.
1284         (parse_spec): Check that the function-result declaration, if given in
1285         a prefix, contains no not-yet-typed symbols when the IMPLICIT rules are
1286         parsed.
1287         * symbol.c (gfc_check_symbol_typed): Check that a symbol already has
1288         a type associated to it, otherwise use the IMPLICIT rules or signal
1289         an error.
1290
1291 2008-08-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1292
1293         * f95-lang.c: Update all calls to pedwarn.
1294
1295 2008-08-18  Daniel Franke  <franke.daniel@gmail.com>
1296
1297         PR fortran/37032
1298         * gfortran.texi: Document decision on include file handling in
1299         preprocessed files.
1300
1301 2008-08-16  Tobias Burnus  <burnus@net-b.de>
1302
1303         PR fortran/36825
1304         * libgfortran.h: Reduce GFC_MAX_DIMENSIONS to 7.
1305
1306 2008-08-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1307
1308         PR fortran/35863
1309         * io.c (gfc_match_open): Enable UTF-8 in checks.
1310         * simplify.c (gfc_simplify_selected_char_kind): Enable iso_10646.
1311
1312 2008-08-14  Janus Weil  <janus@gcc.gnu.org>
1313
1314         PR fortran/36705
1315         * symbol.c (check_conflict): Move conflict checks for (procedure,save)
1316         and (procedure,intent) to resolve_fl_procedure.
1317         * resolve.c (resolve_fl_procedure): Ditto.
1318
1319 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1320
1321         PR 36901
1322         * f95-lang.c (gfc_mark_addressable): Use "pedwarn (0," instead of
1323         'pedwarn0'.
1324
1325 2008-08-09  Paul Thomas  <pault@gcc.gnu.org>
1326
1327         PR fortran/37011
1328         * symbol.c (gfc_add_extension): New function.
1329         * decl.c (gfc_get_type_attr_spec): Call it.
1330         (gfc_match_derived_decl): Set symbol extension attribute from
1331         attr.extension.
1332         * gfortran.h : Add prototype for gfc_add_extension.
1333
1334 2008-08-08  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1335
1336         PR 28875
1337         * options.c (set_Wall): Replace set_Wunused by warn_unused.
1338
1339 2008-08-08  Daniel Kraft  <d@domob.eu>
1340
1341         * gfortran.h (gfc_finalizer):  Replaced member `procedure' by two
1342         new members `proc_sym' and `proc_tree' to store the symtree after
1343         resolution.
1344         (gfc_find_sym_in_symtree):  Made public.
1345         * decl.c (gfc_match_final_decl):  Adapted for new member name.
1346         * interface.c (gfc_find_sym_in_symtree):  Made public.
1347         (gfc_extend_expr), (gfc_extend_assign):  Changed call accordingly.
1348         * module.c (mio_finalizer), (mio_f2k_derived), (mio_full_f2k_derived):
1349         New methods for module-file IO of f2k_derived.
1350         (mio_symbol):  Do IO of f2k_derived namespace.
1351         * resolve.c (gfc_resolve_finalizers):  Adapted for new member name and
1352         finding the symtree for the symbol here.
1353         * symbol.c (gfc_free_finalizer):  Adapted for new members.
1354
1355 2008-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1356
1357         * gfc-internals.texi: Update to GFDL 1.2.  Do not list GPL as
1358         Invariant Section.
1359         * gfortran.texi: Likewise.
1360         * intrinsic.texi: Do not list GPL as Invariant Section.
1361         * invoke.texi: Likewise.  Update copyright years.
1362
1363 2008-07-29  Paul Thomas  <pault@gcc.gnu.org>
1364
1365         * trans-expr.c (conv_parent_component_references): New function
1366         to build missing parent references.
1367         (gfc_conv_variable): Call it
1368         * symbol.c (gfc_add_component): Check that component name in a
1369         derived type extension does not appear in parent.
1370         (gfc_find_component): For a derived type extension, check if
1371         the component appears in the parent derived type by calling
1372         self. Separate errors for private components and private types.
1373         * decl.c (match_data_constant): Add extra arg to call to
1374         gfc_match_structure_constructor.
1375         (check_extended_derived_type): New function to check that a
1376         parent derived type exists and that it is OK for exension.
1377         (gfc_get_type_attr_spec): Add extra argument 'name' and return
1378         it if extends is specified.
1379         (gfc_match_derived_decl): Match derived type extension and
1380         build a first component of the parent derived type if OK. Add
1381         the f2k namespace if not present.
1382         * gfortran.h : Add the extension attribute.
1383         * module.c : Handle attribute 'extension'.
1384         * match.h : Modify prototypes for gfc_get_type_attr_spec and
1385         gfc_match_structure_constructor.
1386         * primary.c (build_actual_constructor): New function extracted
1387         from gfc_match_structure_constructor and modified to call self
1388         iteratively to build derived type extensions, when f2k named
1389         components are used.
1390         (gfc_match_structure_constructor): Do not throw error for too
1391         many components if a parent type is being handled. Use
1392         gfc_find_component to generate errors for non-existent or
1393         private components.  Iteratively call self for derived type
1394         extensions so that parent constructor is built.  If extension
1395         and components left over, throw error.
1396         (gfc_match_rvalue): Add extra arg to call to
1397         gfc_match_structure_constructor.
1398
1399         * trans-array.c (gfc_conv_resolve_dependencies): If lhs and rhs
1400         are the same symbol, aliassing does not matter.
1401
1402 2008-07-29  Jan Hubicka  <jh@suse.cz>
1403
1404         * options.c (gfc_post_options): Do not set flag_no_inline.
1405
1406 2008-07-29  Daniel Kraft  <d@domob.eu>
1407
1408         PR fortran/36403
1409         * trans-intrinsic.c (conv_generic_with_optional_char_arg):  New method
1410         to append a string-length even if the string argument is missing, e.g.
1411         for EOSHIFT.
1412         (gfc_conv_intrinsic_function):  Call the new method for EOSHIFT, PACK
1413         and RESHAPE.
1414
1415 2008-07-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1416
1417         * gfortran.h (try): Remove macro.  Replace try with gfc_try
1418         throughout.
1419         * array.c: Likewise.
1420         * check.c: Likewise.
1421         * cpp.c: Likewise.
1422         * cpp.h: Likewise.
1423         * data.c: Likewise.
1424         * data.h: Likewise.
1425         * decl.c: Likewise.
1426         * error.c: Likewise.
1427         * expr.c: Likewise.
1428         * interface.c: Likewise.
1429         * intrinsic.c: Likewise.
1430         * intrinsic.h: Likewise.
1431         * io.c: Likewise.
1432         * match.h: Likewise.
1433         * parse.c: Likewise.
1434         * parse.h: Likewise.
1435         * resolve.c: Likewise.
1436         * scanner.c: Likewise.
1437         * simplify.c: Likewise.
1438         * symbol.c: Likewise.
1439         * trans-openmp.c: Likewise.
1440         * trans-types.c: Likewise.
1441
1442 2008-07-28  Tobias Burnus  <burnus@net-b.de>
1443
1444         * Make-lang.in: Remove -Wno-* from fortran-warn.
1445
1446 2008-07-28  Richard Guenther  <rguenther@suse.de>
1447
1448         Merge from gimple-tuples-branch.
1449
1450         2008-07-18  Aldy Hernandez  <aldyh@redhat.com>
1451
1452         * trans-expr.c: Include gimple.h instead of tree-gimple.h.
1453         * trans-array.c: Same.
1454         * trans-openmp.c: Same.
1455         * trans-stmt.c: Same.
1456         * f95-lang.c: Same.
1457         * trans-io.c: Same.
1458         * trans-decl.c: Same.
1459         * trans-intrinsic.c: Same.
1460         * trans.c: Same.  Include tree-iterator.h.
1461         * Make-lang.in (trans.o): Depend on tree-iterator.h
1462
1463         2008-07-14  Aldy Hernandez  <aldyh@redhat.com>
1464
1465         * trans-array.h (gfc_conv_descriptor_data_set_internal):
1466         Rename to gfc_conv_descriptor_data_set.
1467         (gfc_conv_descriptor_data_set_tuples): Remove.
1468         * trans-array.c (gfc_conv_descriptor_data_get): Rename
1469         from gfc_conv_descriptor_data_set_internal.
1470         Remove last argument to gfc_add_modify.
1471         (gfc_trans_allocate_array_storage): Rename gfc_add_modify_expr to
1472         gfc_add_modify.
1473         (gfc_trans_create_temp_array): Same.
1474         (gfc_conv_array_transpose): Same.
1475         (gfc_grow_array): Same.
1476         (gfc_put_offset_into_var): Same.
1477         (gfc_trans_array_ctor_element): Same.
1478         (gfc_trans_array_constructor_subarray): Same.
1479         (gfc_trans_array_constructor_value): Same.
1480         (gfc_trans_scalarized_loop_end): Same.
1481         (gfc_array_init_size): Same.
1482         (gfc_array_allocate): Same.
1483         (gfc_trans_array_bounds): Same.
1484         (gfc_trans_auto_array_allocation): Same.
1485         (gfc_trans_g77_array): Same.
1486         (gfc_trans_dummy_array_bias): Same.
1487         (gfc_conv_expr_descriptor): Same.
1488         (structure_alloc_comps): Same.
1489         * trans-expr.c: Same.
1490         * trans-openmp.c (gfc_omp_clause_default_ctor): Same.
1491         Rename gfc_conv_descriptor_data_set_tuples to
1492         gfc_conv_descriptor_data_set.
1493         (gfc_omp_clause_copy_ctor): Change build_gimple_modify_stmt to
1494         build2_v.
1495         (gfc_omp_clause_assign_op): Same.
1496         (gfc_trans_omp_array_reduction): Rename gfc_add_modify_expr to
1497         gfc_add_modify.
1498         (gfc_trans_omp_atomic): Same.
1499         (gfc_trans_omp_do): Same.  Change GIMPLE_MODIFY_STMT to MODIFY_EXPR.
1500         Rename gfc_add_modify_stmt to gfc_add_modify.
1501         * trans-stmt.c: Rename gfc_add_modify_expr to
1502         gfc_add_modify.
1503         * trans.c: Rename gfc_add_modify_expr to
1504         gfc_add_modify.
1505         (gfc_add_modify): Remove last argument.
1506         Rename GIMPLE_MODIFY_STMT to MODIFY_EXPR.
1507         * trans.h: Remove gfc_add_modify_expr, gfc_add_modify_stmt.
1508         Add prototype for gfc_add_modify.
1509         * f95-lang.c (union lang_tree_node): Rename GENERIC_NEXT to TREE_CHAIN.
1510         * trans-decl.c: Rename gfc_add_modify_stmt to gfc_add_modify.
1511         * trans-io.c: Same.
1512         * trans-intrinsic.c: Same.
1513
1514         2008-02-25  Aldy Hernandez  <aldyh@redhat.com>
1515
1516         * Make-lang.in (fortran-warn): Add -Wno-format.
1517
1518         2008-02-19  Diego Novillo  <dnovillo@google.com>
1519
1520         http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
1521
1522         * fortran/Make-lang.in (fortran-warn): Remove.
1523
1524         2007-11-22  Aldy Hernandez  <aldyh@redhat.com>
1525
1526         * trans-expr.c (gfc_trans_string_copy): Use "void *" when building a
1527         memset.
1528
1529         2007-11-10  Aldy Hernandez  <aldyh@redhat.com>
1530
1531         * Make-lang.in (fortran-warn): Set to -Wno-format.
1532         * trans.c (gfc_trans_code): Update comment to say GENERIC.
1533         Call tree_annotate_all_with_locus instead of annotate_all_with_locus.
1534
1535 2008-07-27  Tobias Burnus  <burnus@net-b.de>
1536
1537         PR fortran/36132
1538         PR fortran/29952
1539         PR fortran/36909
1540         * trans.c (gfc_trans_runtime_check): Allow run-time warning besides
1541         run-time error.
1542         * trans.h (gfc_trans_runtime_check): Update declaration.
1543         * trans-array.c (gfc_trans_array_ctor_element,gfc_trans_array_bound_check,
1544         gfc_conv_array_ref,gfc_conv_ss_startstride,gfc_trans_dummy_array_bias):
1545         Updated gfc_trans_runtime_check calls.
1546         (gfc_conv_array_parameter): Implement flag_check_array_temporaries,
1547         fix packing/unpacking for nonpresent optional actuals to optional
1548         formals.
1549         * trans-array.h (gfc_conv_array_parameter): Update declaration.
1550         * trans-expr.c (gfc_conv_substring,gfc_trans_arrayfunc_assign,
1551         gfc_conv_function_call): Updated gfc_trans_runtime_check calls.
1552         (gfc_conv_function_call): Update gfc_conv_array_parameter calls.
1553         * trans-expr.c (gfc_trans_goto): Updated gfc_trans_runtime_check
1554         calls.
1555         * trans-io.c (set_string,gfc_conv_intrinsic_repeat): Ditto.
1556         (gfc_conv_intrinsic_transfer,gfc_conv_intrinsic_loc): Same for
1557         gfc_conv_array_parameter.
1558         * trans-intrinsics.c (gfc_conv_intrinsic_bound): Ditto.
1559         * trans-decl.c (gfc_build_builtin_function_decls): Add
1560         gfor_fndecl_runtime_warning_at.
1561         * lang.opt: New option fcheck-array-temporaries.
1562         * gfortran.h (gfc_options): New flag_check_array_temporaries.
1563         * options.c (gfc_init_options, gfc_handle_option): Handle flag.
1564         * invoke.texi: New option fcheck-array-temporaries.
1565
1566 2008-07-24  Jan Hubicka  <jh@suse.cz>
1567
1568         * fortran/options.c (gfc_post_options): Remove flag_unline_trees code.
1569
1570 2008-07-24  Daniel Kraft  <d@domob.eu>
1571
1572         PR fortran/33141
1573         * lang.opt (Wnonstd-intrinsics):  Removed option.
1574         (Wintrinsics-std), (Wintrinsic-shadow):  New options.
1575         * invoke.texi (Option Summary):  Removed -Wnonstd-intrinsics
1576         from the list and added -Wintrinsics-std and -Wintrinsic-shadow.
1577         (Error and Warning Options):  Documented the new options and removed
1578         the documentation for -Wnonstd-intrinsics.
1579         * gfortran.h (gfc_option_t):  New members warn_intrinsic_shadow and
1580         warn_intrinsics_std, removed warn_nonstd_intrinsics.
1581         (gfc_is_intrinsic):  Renamed from gfc_intrinsic_name.
1582         (gfc_warn_intrinsic_shadow), (gfc_check_intrinsic_standard):  New.
1583         * decl.c (match_procedure_decl):  Replaced gfc_intrinsic_name by
1584         the new name gfc_is_intrinsic.
1585         (warn_intrinsic_shadow):  New helper method.
1586         (gfc_match_function_decl), (gfc_match_subroutine):  Call the new method
1587         warn_intrinsic_shadow to check the just-parsed procedure.
1588         * expr.c (check_init_expr):  Call new gfc_is_intrinsic to check whether
1589         the function called is really an intrinsic in the selected standard.
1590         * intrinsic.c (gfc_is_intrinsic):  Renamed from gfc_intrinsic_name and
1591         extended to take into account the selected standard settings when trying
1592         to find out whether a symbol is an intrinsic or not.
1593         (gfc_check_intrinsic_standard):  Made public and extended.
1594         (gfc_intrinsic_func_interface), (gfc_intrinsic_sub_interface):  Removed
1595         the calls to check_intrinsic_standard, this check now happens inside
1596         gfc_is_intrinsic.
1597         (gfc_warn_intrinsic_shadow):  New method defined.
1598         * options.c (gfc_init_options):  Initialize new warning flags to false
1599         and removed intialization of Wnonstd-intrinsics flag.
1600         (gfc_post_options):  Removed logic for Wnonstd-intrinsics flag.
1601         (set_Wall):  Set new warning flags and removed Wnonstd-intrinsics flag.
1602         (gfc_handle_option):  Handle the new flags and removed handling of the
1603         old Wnonstd-intrinsics flag.
1604         * primary.c (gfc_match_rvalue):  Replaced call to gfc_intrinsic_name by
1605         the new name gfc_is_intrinsic.
1606         * resolve.c (resolve_actual_arglist):  Ditto.
1607         (resolve_generic_f), (resolve_unknown_f):  Ditto.
1608         (is_external_proc):  Ditto.
1609         (resolve_generic_s), (resolve_unknown_s):  Ditto.
1610         (resolve_symbol):  Ditto and ensure for symbols declared INTRINSIC that
1611         they are really available in the selected standard setting.
1612
1613 2008-07-24  Daniel Kraft  <d@domob.eu>
1614
1615         * match.c (gfc_match):  Add assertion to catch wrong calls trying to
1616         match upper-case characters.
1617
1618 2008-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
1619
1620         PR fortran/29952
1621         * gfortran.h:  Add "warn_array_temp" to gfc_option_t.
1622         * lang.opt:  Add -Warray-temporaries.
1623         * invoke.texi:  Document -Warray-temporaries
1624         * trans-array.h (gfc_trans_create_temp_array):  Add argument of
1625         type *locus.
1626         (gfc_conv_loop_setup):  Likewise.
1627         * trans-array.c (gfc_trans_create_temp_array):  If
1628         -Warray-temporaries is given and locus is present, warn about
1629         creation of array temporaries.
1630         (gfc_trans_array_constructor_subarray):  Add locus to call
1631         of gfc_conv_loop_setup.
1632         (gfc_trans_array_constructor):  Add where argument.  Pass where
1633         argument to call of gfc_trans_create_temp_array.
1634         (gfc_add_loop_ss_code):  Add where argument.  Pass where argument
1635         to recursive call of gfc_add_loop_ss_code and to call of
1636         gfc_trans_array_constructor.
1637         (gfc_conv_loop_setup):  Add where argument.  Pass where argument
1638         to calls to gfc_add_loop_ss_code and to gfc_trans_create_temp_array.
1639         (gfc_conv_expr_descriptor):  Pass location to call of
1640         gfc_conv_loop_setup.
1641         (gfc_conv_array_parameter):  If -Warray-temporaries is given,
1642         warn about creation of temporary arrays.
1643         * trans-expr.c (gfc_conv_subref_array_arg):  Add where argument
1644         to call to gfc_conv_loop_setup.
1645         (gfc_conv_function_call):  Add where argument to call to
1646         gfc_trans_creat_temp_array.
1647         (gfc_trans_subarray_assign):  Likewise.
1648         (gfc_trans_assignment_1):  Add where argument to call to
1649         gfc_conv_loop_setup.
1650         * trans-stmt.c (gfc_conv_elemental_dependencies):  Add where
1651         argument to call to gfc_trans_create_temp_array.
1652         (gfc_trans_call):  Add where argument to call to gfc_conv_loop_setup.
1653         (generate_loop_for_temp_to_lhs):  Likewise.
1654         (generate_loop_for_rhs_to_temp):  Likewise.
1655         (compute_inner_temp_size):  Likewise.
1656         (gfc_trans-pointer_assign_need_temp):  Likewise.
1657         (gfc_evaluate_where_mask):  Likewise.
1658         (gfc_trans_where_assign):  Likewise.
1659         (gfc_trans_where_3):  Likewise.
1660         * trans-io.c (transfer_srray_component):  Add where argument
1661         to function. Add where argument to call to gfc_conv_loop_setup.
1662         (transfer_expr):  Add where argument to call to
1663         transfer_array_component.
1664         (gfc_trans_transfer):  Add where expression to call to
1665         gfc_conv_loop_setup.
1666         * trans-intrinsic.c (gfc_conv_intrinsic_anyall):  Add
1667         where argument to call to gfc_conv_loop_setup.
1668         (gfc_conv_intrinsic_count):  Likewise.
1669         (gfc_conv_intrinsic_arith):  Likewise.
1670         (gfc_conv_intrinsic_dot_product):  Likewise.
1671         (gfc_conv_intrinsic_minmaxloc):  Likewise.
1672         (gfc_conv_intrinsic_minmaxval):  Likewise.
1673         (gfc_conv_intrinsic_array_transfer):  Warn about
1674         creation of temporary array.
1675         Add where argument to call to gfc_trans_create_temp_array.
1676         * options.c (gfc_init_options):  Initialize gfc_option.warn_array_temp.
1677         (gfc_handle_option):  Set gfc_option.warn_array_temp.
1678
1679 2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1680
1681         PR 35058
1682         * f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
1683
1684 2008-07-22  Daniel Kraft  <d@domob.eu>
1685
1686         PR fortran/29835
1687         * io.c (error_element), (format_locus):  New static globals.
1688         (unexpected_element):  Spelled out this message fully.
1689         (next_char):  Keep track of locus when not MODE_STRING.
1690         (next_char_not_space):  Remember last parsed element in error_element.
1691         (format_lex):  Fix two indentation errors.
1692         (check_format):  Use format_locus and possibly error_element for a
1693         slightly better error message on invalid format.
1694         (check_format_string):  Set format_locus to start of the string
1695         expression used as format.
1696
1697 2008-07-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1698
1699         * expr.c (gfc_check_pointer_assign): Fix typo in string.
1700         * io.c (check_format): Fix typo in string.  Fix comment typos.
1701         * parse.c (gfc_global_used): Likewise.
1702         * resolve.c (resolve_allocate_expr): Likewise.
1703         * symbol.c (gfc_set_default_type): Likewise.
1704         * arith.c: Fix typos in comments.
1705         * array.c: Likewise.
1706         * data.c: Likewise.
1707         * decl.c: Likewise.
1708         * dependency.c: Likewise.
1709         * f95-lang.c: Likewise.
1710         * gfortran.h: Likewise.
1711         * matchexp.c: Likewise.
1712         * module.c: Likewise.
1713         * primary.c: Likewise.
1714         * scanner.c: Likewise.
1715         * trans-array.c: Likewise.
1716         * trans-common.c: Likewise.
1717         * trans-decl.c: Likewise.
1718         * trans-expr.c: Likewise.
1719         * trans-intrinsic.c: Likewise.
1720         * trans-types.c: Likewise.
1721         * trans.c: Likewise.
1722         * trans.h: Likewise.
1723
1724 2008-07-19  Tobias Burnus  <burnus@net-b.de>
1725
1726         PR fortran/36795
1727         * matchexp.c (gfc_get_parentheses): Remove obsolete workaround,
1728         which caused the generation of wrong code.
1729
1730 2008-07-19  Tobias Burnus  <burnus@net-b.de>
1731
1732         PR fortran/36342
1733         * scanner.c (load_file): Add argument to destinguish between
1734         true filename and displayed filename.
1735         (include_line,gfc_new_file): Adapt accordingly.
1736
1737 2008-07-19  Tobias Burnus  <burnus@net-b.de>
1738
1739         * check.c (gfc_check_cshift,gfc_check_eoshift,gfc_check_unpack): Add rank
1740         checks for cshift's shift and eoshift's shift and boundary args.
1741         (gfc_check_unpack): Add rank and shape tests for unpack.
1742
1743 2008-07-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1744
1745         * gfortran.h (new): Remove macro.
1746         * array.c (gfc_append_constructor, match_array_list,
1747         gfc_match_array_constructor): Likewise.
1748         * bbt.c (insert, gfc_insert_bbt): Likewise.
1749         * decl.c (var_element, top_var_list, top_val_list, gfc_match_data,
1750         get_proc_name): Likewise.
1751         * expr.c (gfc_copy_actual_arglist): Likewise.
1752         * interface.c (compare_actual_formal, check_new_interface,
1753         gfc_add_interface): Likewise.
1754         * intrinsic.c gfc_convert_type_warn, gfc_convert_chartype):
1755         Likewise.
1756         * io.c (match_io_iterator, match_io_list): Likewise.
1757         * match.c (match_forall_header): Likewise.
1758         * matchexp.c (build_node): Likewise.
1759         * module.c (gfc_match_use): Likewise.
1760         * scanner.c (load_file): Likewise.
1761         * st.c (gfc_append_code): Likewise.
1762         * symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
1763         gfc_commit_symbols): Likewise.
1764         * trans-common.c (build_field): Likewise.
1765         * trans-decl.c (gfc_finish_var_decl): Likewise.
1766         * trans-expr.c (gfc_free_interface_mapping,
1767         gfc_get_interface_mapping_charlen, gfc_add_interface_mapping,
1768         gfc_finish_interface_mapping,
1769         gfc_apply_interface_mapping_to_expr): Likewise.
1770         * trans.h (gfc_interface_sym_mapping): Likewise.
1771
1772 2008-07-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1773
1774         * gfortran.h (operator): Remove macro.
1775         (gfc_namespace, gfc_expr): Avoid C++ keywords.
1776         * arith.c (eval_intrinsic, eval_intrinsic_f2, eval_intrinsic_f3):
1777         Likewise.
1778         * decl.c (access_attr_decl): Likewise.
1779         * dependency.c (gfc_dep_compare_expr): Likewise.
1780         * dump-parse-tree.c (show_expr, show_uop, show_namespace):
1781         Likewise.
1782         * expr.c (gfc_copy_expr, gfc_type_convert_binary,
1783         simplify_intrinsic_op, check_intrinsic_op): Likewise.
1784         * interface.c (fold_unary, gfc_match_generic_spec,
1785         gfc_match_interface, gfc_match_end_interface,
1786         check_operator_interface, check_uop_interfaces,
1787         gfc_check_interfaces, gfc_extend_expr, gfc_extend_assign,
1788         gfc_add_interface, gfc_current_interface_head,
1789         gfc_set_current_interface_head): Likewise.
1790         * iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul):
1791         Likewise.
1792         * matchexp.c (gfc_get_parentheses, build_node): Likewise.
1793         * module.c (gfc_use_rename, gfc_match_use, find_use_name_n,
1794         number_use_names, mio_expr, load_operator_interfaces, read_module,
1795         write_operator, write_module): Likewise.
1796         * openmp.c (resolve_omp_atomic): Likewise.
1797         * resolve.c (resolve_operator, gfc_resolve_character_operator,
1798         gfc_resolve_uops): Likewise.
1799         * symbol.c (free_uop_tree, gfc_free_namespace): Likewise.
1800         * trans-expr.c (gfc_conv_expr_op): Likewise.
1801         * trans-openmp.c (gfc_trans_omp_atomic): Likewise.
1802
1803 2008-07-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1804
1805         * gfortran.h (protected): Remove macro.
1806         * dump-parse-tree.c (show_attr): Avoid C++ keywords.
1807         * expr.c (gfc_check_pointer_assign): Likewise.
1808         * interface.c (compare_parameter_protected): Likewise.
1809         * intrinsic.c (enum class, add_sym, add_sym_0, add_sym_1,
1810         add_sym_1s, add_sym_1m, add_sym_2, add_sym_2s, add_sym_3,
1811         add_sym_3ml, add_sym_3red, add_sym_3s, add_sym_4, add_sym_4s,
1812         add_sym_5s): Likewise.
1813         * match.c (gfc_match_assignment, gfc_match_pointer_assignment):
1814         Likewise.
1815         * module.c (mio_symbol_attribute): Likewise.
1816         * primary.c (match_variable): Likewise.
1817         * resolve.c (resolve_equivalence): Likewise.
1818         * symbol.c (check_conflict, gfc_add_protected, gfc_copy_attr):
1819         Likewise.
1820         * trans-types.c (gfc_get_array_type_bounds): Likewise.
1821
1822 2008-07-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1823
1824         * arith.c (eval_type_intrinsic0): Avoid C++ keywords.
1825         * gfortran.h (try, protected, operator, new): Likewise.
1826
1827 2008-07-17  Tobias Burnus  <burnus@net-b.de>
1828
1829         PR fortran/36825
1830         PR fortran/36824
1831         * array.c (gfc_match_array_spec): Fix array-rank check.
1832         * resolve.c (resolve_fl_derived): Fix constentness check
1833         for the array dimensions.
1834
1835 2008-07-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1836
1837         * Make-lang.in (gfortranspec.o): Fix dependencies.
1838
1839 2008-07-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1840
1841         PR fortran/36725
1842         * io.c: Add error check for g0 edit descriptor followed by '.'.
1843
1844 2008-07-12  Daniel Kraft  <d@domob.eu>
1845
1846         * resolve.c (resolve_fl_derived):  Allow pointer components to empty
1847         derived types fixing a missing part of PR fortran/33221.
1848
1849 2008-07-10  Daniel Kraft  <d@domob.eu>
1850
1851         * gfc-internals.texi (section gfc_expr):  Created documentation about
1852         the gfc_expr internal data structure.
1853
1854 2008-07-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
1855
1856         PR fortran/36670
1857         * iresolve.c (gfc_resolve_product):  Set shape of return
1858         value from array.
1859         (gfc_resolve_sum):  Likewise.
1860
1861 2008-07-07  Jakub Jelinek  <jakub@redhat.com>
1862
1863         PR middle-end/36726
1864         * f95-lang.c (poplevel): Don't ever add subblocks to
1865         global_binding_level.
1866
1867 2008-07-02  Janus Weil  <janus@gcc.gnu.org>
1868             Tobias Burnus  <burnus@net-b.de>
1869             Paul Thomas  <pault@gcc.gnu.org>
1870
1871         PR fortran/32580
1872         * gfortran.h (struct gfc_symbol): New member "proc_pointer".
1873         * check.c (gfc_check_associated,gfc_check_null): Implement
1874         procedure pointers.
1875         * decl.c (match_procedure_decl): Ditto.
1876         * expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto.
1877         * interface.c (compare_actual_formal): Ditto.
1878         * match.h: Ditto.
1879         * match.c (gfc_match_pointer_assignment): Ditto.
1880         * parse.c (parse_interface): Ditto.
1881         * primary.c (gfc_match_rvalue,match_variable): Ditto.
1882         * resolve.c (resolve_fl_procedure): Ditto.
1883         * symbol.c (check_conflict,gfc_add_external,gfc_add_pointer,
1884         gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto.
1885         * trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl,
1886         create_function_arglist): Ditto.
1887         * trans-expr.c (gfc_conv_variable,gfc_conv_function_val,
1888         gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto.
1889
1890 2008-07-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
1891
1892         PR fortran/36590
1893         PR fortran/36681
1894         * iresolve.c (resolve_mask_arg):  Don't convert mask to
1895         kind=1 logical if it is of that type already.
1896
1897 2008-06-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
1898
1899         PR fortran/36341
1900         * iresolve.c (gfc_resolve_matmul): Copy shapes
1901         from arguments.
1902
1903 2008-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1904
1905         * invoke.texi: Add documentation for runtime behavior of
1906         -fno-range-check.
1907
1908 2008-06-28  Daniel Kraft  <d@domob.eu>
1909
1910         * gfc-internals.texi (section gfc_code):  Extended documentation about
1911         gfc_code in the internal datastructures chapter including details about
1912         how IF, DO and SELECT blocks look like and an example for how the
1913         block-chaining works.
1914
1915 2008-06-25  Paul Thomas  <pault@gcc.gnu.org>
1916
1917         PR fortran/36526
1918         * interface.c (check_intents):  Correct error where the actual
1919         arg was checked for a pointer argument, rather than the formal.
1920
1921 2008-06-24  Paul Thomas  <pault@gcc.gnu.org>
1922
1923         PR fortran/34371
1924         * expr.c (gfc_check_assign):  Change message and locus for
1925         error when conform == 0.
1926
1927 2008-06-23  Jakub Jelinek  <jakub@redhat.com>
1928
1929         PR fortran/36597
1930         * cpp.c (cpp_define_builtins): Change _OPENMP value to 200805.
1931
1932 2008-06-20  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
1933             Tobias Burnus  <burnus@net-b.de>
1934
1935         PR fortran/34908
1936         PR fortran/36276
1937         * scanner.c (preprocessor_line): do not call gfc_free for
1938         current_file->filename if it differs from filename.
1939
1940 2008-06-20  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1941
1942         * arith.c (hollerith2representation): Fix for -Wc++-compat.
1943         * array.c (gfc_get_constructor): Likewise.
1944         * decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data,
1945         create_enum_history, gfc_match_final_decl): Likewise.
1946         * error.c (error_char): Likewise.
1947         * expr.c (gfc_get_expr, gfc_copy_expr): Likewise.
1948         * gfortran.h (gfc_get_charlen, gfc_get_array_spec,
1949         gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist,
1950         gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface,
1951         gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref,
1952         gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator,
1953         gfc_get_alloc, gfc_get_wide_string): Likewise.
1954         * interface.c (count_types_test): Likewise.
1955         * intrinsic.c (add_char_conversions, gfc_intrinsic_init_1):
1956         Likewise.
1957         * io.c (gfc_match_open, gfc_match_close, match_filepos, match_io,
1958         gfc_match_inquire, gfc_match_wait): Likewise.
1959         * match.c (gfc_match, match_forall_iterator): Likewise.
1960         * module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup,
1961         add_true_name, parse_string, write_atom, quote_string,
1962         mio_symtree_ref, mio_gmp_real, write_common_0): Likewise.
1963         * options.c (gfc_post_options): Likewise.
1964         * primary.c (match_integer_constant, match_hollerith_constant,
1965         match_boz_constant, match_real_constant,
1966         gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise.
1967         * scanner.c (gfc_widechar_to_char, add_path_to_list,
1968         add_file_change, load_line, get_file, preprocessor_line,
1969         load_file, unescape_filename, gfc_read_orig_filename): Likewise.
1970         * simplify.c (gfc_simplify_ibits, gfc_simplify_ishft,
1971         gfc_simplify_ishftc): Likewise.
1972         * symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree,
1973         gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol):
1974         Likewise.
1975         * target-memory.c (gfc_target_interpret_expr): Likewise.
1976         * trans-const.c (gfc_build_wide_string_const): Likewise.
1977         * trans-expr.c (gfc_add_interface_mapping): Likewise.
1978         * trans-intrinsic.c (gfc_conv_intrinsic_conversion,
1979         gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function,
1980         gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime,
1981         gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
1982         gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char,
1983         gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify,
1984         gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise.
1985         * trans.c (gfc_get_backend_locus): Likewise.
1986         * trans.h (gfc_get_ss): Likewise.
1987
1988 2008-06-18  Daniel Kraft  <d@domob.eu>
1989
1990         PR fortran/36517, fortran/36492
1991         * array.c (gfc_resolve_character_array_constructor):  Call
1992         gfc_set_constant_character_len with changed length-chec argument.
1993         * decl.c (gfc_set_constant_character_len):  Changed array argument to
1994         be a generic length-checking argument that can be used for correct
1995         checking with typespec and in special cases where the should-be length
1996         is different from the target length.
1997         (build_struct):  Call gfc_set_constant_character_len with changed length
1998         checking argument and introduced additional checks for exceptional
1999         conditions on invalid code.
2000         (add_init_expr_to_sym), (do_parm):  Call gfc_set_constant_character_len
2001         with changed argument.
2002         * match.h (gfc_set_constant_character_len):  Changed third argument to
2003         int for the should-be length rather than bool.
2004
2005 2008-06-17  Daniel Kraft  <d@domob.eu>
2006
2007         PR fortran/36112
2008         * array.c (gfc_resolve_character_array_constructor):  Check that all
2009         elements with constant character length have the same one rather than
2010         fixing it if no typespec is given, emit an error if they don't.  Changed
2011         return type to "try" and return FAILURE for the case above.
2012         (gfc_resolve_array_constructor):  Removed unneeded call to
2013         gfc_resolve_character_array_constructor in this function.
2014         * gfortran.h (gfc_resolve_character_array_constructor):  Returns try.
2015         * trans-array.c (get_array_ctor_strlen):  Return length of first element
2016         rather than last element.
2017         * resolve.c (gfc_resolve_expr):  Handle FAILURE return from
2018         gfc_resolve_character_array_constructor.
2019
2020 2008-06-17  Paul Thomas  <pault@gcc.gnu.org>
2021
2022         PR fortran/34396
2023         * resolve.c (add_dt_to_dt_list):  New function.
2024         (resolve_fl_derived): Call new function for pointer components
2025         and when derived type resolved.
2026
2027 2008-06-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2028
2029         PR fortran/36515
2030         * trans-decl.c (gfc_generate_function_code): Add range_check to options
2031         array.
2032
2033 2008-06-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2034
2035         * gfc-internals.texi: Expand TABs, drop indentation outside examples.
2036         * gfortran.texi: Likewise.
2037         * intrinsic.texi: Likewise.
2038         * invoke.texi: Likewise.
2039
2040 2008-06-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2041
2042         PR fortran/35863
2043         * trans-io.c (gfc_build_io_library_fndecls): Build declaration for
2044         transfer_character_wide which includes passing in the character kind to
2045         support wide character IO. (transfer_expr): If the kind == 4, create the
2046         argument and build the call.
2047         * gfortran.texi: Fix typo.
2048
2049 2008-06-13  Tobias Burnus  <burnus@net-b.de>
2050
2051         PR fortran/36476
2052         * decl.c (do_parm): Handle init expression for len=*.
2053
2054 2008-06-12  Tobias Burnus  <burnus@net-b.de>
2055
2056         PR fortran/36462
2057         * trans-intrinsic.c (gfc_conv_intrinsic_index_scan_verify):
2058         Fix passing of the BACK= argument.
2059
2060 2008-06-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2061
2062         * cpp.c: Add copyright notice.
2063         * cpp.h: Add copyright notice.
2064
2065 2008-06-08  Janus Weil  <janus@gcc.gnu.org>
2066
2067         PR fortran/36459
2068         * decl.c (match_procedure_decl): Correctly recognize if the interface
2069         is an intrinsic procedure.
2070
2071 2008-06-08  Tobias Burnus  <burnus@net-b.de>
2072
2073         PR fortran/35830
2074         * resolve.c (resolve_symbol): Copy more attributes for
2075         PROCEDUREs with interfaces.
2076
2077 2008-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2078
2079         PR fortran/36420
2080         PR fortran/36422
2081         * io.c (check_format): Add new error message for zero width.
2082         Use new error message for FMT_A and with READ, FMT_G.  Allow
2083         FMT_G with WRITE except when -std=F95 and -std=F2003.
2084
2085 2008-06-07  Tobias Burnus  <burnus@net-b.de>
2086
2087         PR fortran/36437
2088         * intrinsic.c (add_functions): Implement c_sizeof.
2089         * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Do not
2090         create unneeded variable in the scalar case.
2091         * intrinsic.texi: Add C_SIZEOF documentation.
2092
2093 2008-06-06  Tobias Burnus  <burnus@net-b.de>
2094
2095         * intrinsic.texi (BESSEL_J1): Fix BES(S)EL_J1 typo.
2096
2097 2008-06-06  Jakub Jelinek  <jakub@redhat.com>
2098
2099         * scanner.c (skip_free_comments, skip_fixed_comments): Handle tabs.
2100         * parse.c (next_free): Allow tab after !$omp.
2101         (decode_omp_directive): Handle !$omp task, !$omp taskwait
2102         and !$omp end task.
2103         (case_executable): Add ST_OMP_TASKWAIT.
2104         (case_exec_markers): Add ST_OMP_TASK.
2105         (gfc_ascii_statement): Handle ST_OMP_TASK, ST_OMP_END_TASK and
2106         ST_OMP_TASKWAIT.
2107         (parse_omp_structured_block, parse_executable): Handle ST_OMP_TASK.
2108         * gfortran.h (gfc_find_sym_in_expr): New prototype.
2109         (gfc_statement): Add ST_OMP_TASK, ST_OMP_END_TASK and ST_OMP_TASKWAIT.
2110         (gfc_omp_clauses): Add OMP_SCHED_AUTO to sched_kind,
2111         OMP_DEFAULT_FIRSTPRIVATE to default_sharing.  Add collapse and
2112         untied fields.
2113         (gfc_exec_op): Add EXEC_OMP_TASK and EXEC_OMP_TASKWAIT.
2114         * f95-lang.c (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
2115         LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR,
2116         LANG_HOOKS_OMP_PRIVATE_OUTER_REF): Define.
2117         * trans.h (gfc_omp_clause_default_ctor): Add another argument.
2118         (gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
2119         gfc_omp_clause_dtor, gfc_omp_private_outer_ref): New prototypes.
2120         * types.def (BT_ULONGLONG, BT_PTR_ULONGLONG,
2121         BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
2122         BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
2123         BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
2124         BT_FN_VOID_PTR_PTR, BT_PTR_FN_VOID_PTR_PTR,
2125         BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): New.
2126         (BT_BOOL): Use integer type with BOOL_TYPE_SIZE rather
2127         than boolean_type_node.
2128         * dump-parse-tree.c (gfc_show_omp_node): Handle EXEC_OMP_TASK,
2129         EXEC_OMP_TASKWAIT, OMP_SCHED_AUTO, OMP_DEFAULT_FIRSTPRIVATE,
2130         untied and collapse clauses.
2131         (gfc_show_code_node): Handle EXEC_OMP_TASK and EXEC_OMP_TASKWAIT.
2132         * trans.c (gfc_trans_code): Handle EXEC_OMP_TASK and
2133         EXEC_OMP_TASKWAIT.
2134         * st.c (gfc_free_statement): Likewise.
2135         * resolve.c (gfc_resolve_blocks, resolve_code): Likewise.
2136         (find_sym_in_expr): Rename to...
2137         (gfc_find_sym_in_expr): ... this.  No longer static.
2138         (resolve_allocate_expr, resolve_ordinary_assign): Adjust caller.
2139         * match.h (gfc_match_omp_task, gfc_match_omp_taskwait): New
2140         prototypes.
2141         * openmp.c (resolve_omp_clauses): Allow allocatable arrays in
2142         firstprivate, lastprivate, reduction, copyprivate and copyin
2143         clauses.
2144         (omp_current_do_code): Made static.
2145         (omp_current_do_collapse): New variable.
2146         (gfc_resolve_omp_do_blocks): Compute omp_current_do_collapse,
2147         clear omp_current_do_code and omp_current_do_collapse on return.
2148         (gfc_resolve_do_iterator): Handle collapsed do loops.
2149         (resolve_omp_do): Likewise, diagnose errorneous collapsed do loops.
2150         (OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED): Define.
2151         (gfc_match_omp_clauses): Handle default (firstprivate),
2152         schedule (auto), untied and collapse (n) clauses.
2153         (OMP_DO_CLAUSES): Add OMP_CLAUSE_COLLAPSE.
2154         (OMP_TASK_CLAUSES): Define.
2155         (gfc_match_omp_task, gfc_match_omp_taskwait): New functions.
2156         * trans-openmp.c (gfc_omp_private_outer_ref): New function.
2157         (gfc_omp_clause_default_ctor): Add outer argument.  For allocatable
2158         arrays allocate them with the bounds of the outer var if outer
2159         var is allocated.
2160         (gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
2161         gfc_omp_clause_dtor): New functions.
2162         (gfc_trans_omp_array_reduction): If decl is allocatable array,
2163         allocate it with outer var's bounds in OMP_CLAUSE_REDUCTION_INIT
2164         and deallocate it in OMP_CLAUSE_REDUCTION_MERGE.
2165         (gfc_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
2166         for assumed-size arrays.
2167         (gfc_trans_omp_do): Add par_clauses argument.  If dovar is
2168         present in lastprivate clause and do loop isn't simple,
2169         set OMP_CLAUSE_LASTPRIVATE_STMT.  If dovar is present in
2170         parallel's lastprivate clause, change it to shared and add
2171         lastprivate clause to OMP_FOR_CLAUSES.  Handle collapsed do loops.
2172         (gfc_trans_omp_directive): Adjust gfc_trans_omp_do callers.
2173         (gfc_trans_omp_parallel_do): Likewise.  Move collapse clause to
2174         OMP_FOR from OMP_PARALLEL.
2175         (gfc_trans_omp_clauses): Handle OMP_SCHED_AUTO,
2176         OMP_DEFAULT_FIRSTPRIVATE, untied and collapse clauses.
2177         (gfc_trans_omp_task, gfc_trans_omp_taskwait): New functions.
2178         (gfc_trans_omp_directive): Handle EXEC_OMP_TASK and
2179         EXEC_OMP_TASKWAIT.
2180
2181 2008-06-04  Janus Weil  <janus@gcc.gnu.org>
2182
2183         PR fortran/36322
2184         PR fortran/36275
2185         * resolve.c (resolve_symbol): Correctly copy the interface for a
2186         PROCEDURE declaration.
2187
2188 2008-06-02  Janus Weil  <janus@gcc.gnu.org>
2189
2190         PR fortran/36361
2191         * symbol.c (gfc_add_allocatable,gfc_add_dimension,
2192         gfc_add_explicit_interface): Added checks.
2193         * decl.c (attr_decl1): Added missing "var_locus".
2194         * parse.c (parse_interface): Checking for errors.
2195
2196 2008-06-02  Daniel Kraft  <d@domob.eu>
2197
2198         * gfortran.h:  New statement-type ST_FINAL for FINAL declarations.
2199         (struct gfc_symbol):  New member f2k_derived.
2200         (struct gfc_namespace):  New member finalizers, for use in the above
2201         mentioned f2k_derived namespace.
2202         (struct gfc_finalizer):  New type defined for finalizers linked list.
2203         * match.h (gfc_match_final_decl):  New function header.
2204         * decl.c (gfc_match_derived_decl):  Create f2k_derived namespace on
2205         constructed symbol node.
2206         (gfc_match_final_decl):  New function to match a FINAL declaration line.
2207         * parse.c (decode_statement):  match-call for keyword FINAL.
2208         (parse_derived):  Parse CONTAINS section and accept FINAL statements.
2209         * resolve.c (gfc_resolve_finalizers):  New function to resolve (that is
2210         in this case, check) a list of finalizer procedures.
2211         (resolve_fl_derived):  Call gfc_resolve_finalizers here.
2212         * symbol.c (gfc_get_namespace):  Initialize new finalizers to NULL.
2213         (gfc_free_namespace):  Free finalizers list.
2214         (gfc_new_symbol):  Initialize new f2k_derived to NULL.
2215         (gfc_free_symbol):  Free f2k_derived namespace.
2216         (gfc_free_finalizer):  New function to free a single gfc_finalizer node.
2217         (gfc_free_finalizer_list):  New function to free a linked list of
2218         gfc_finalizer nodes.
2219
2220 2008-06-02  Daniel Franke  <franke.daniel@gmail.com>
2221
2222         PR fortran/36375
2223         PR fortran/36377
2224         * cpp.c (gfc_cpp_init): Do not initialize builtins if
2225         processing already preprocessed input.
2226         (gfc_cpp_preprocess): Finalize output with newline.
2227
2228 2008-05-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2229
2230         * intrinsic.texi: Revert wrong commit.
2231
2232 2008-05-31  Steven G. Kargl  <kargls@comcast.net>
2233
2234         * arith.c (gfc_arith_init_1): Remove now unused r and c variables.
2235         Cleanup numerical inquiry function initialization.
2236         (gfc_arith_done_1): Replace multiple mpfr_clear() invocations with
2237         a single mpfr_clears().
2238         (gfc_check_real_range): Re-arrange logic to eliminate multiple
2239         unnecessary branching and assignments.
2240         (gfc_arith_times): Use mpfr_clears() in preference to multiple
2241         mpfr_clear().
2242         (gfc_arith_divide): Ditto.
2243         (complex_reciprocal): Eliminate now unused variables a, re, im.
2244         Cleanup the mpfr abuse.  Use mpfr_clears() in preference to
2245         multiple mpfr_clear().
2246         (complex_pow): Fix comment whitespace.  Use mpfr_clears() in
2247         preference to multiple mpfr_clear().
2248         * simplify.c (gfc_simplify_and): Remove blank line.
2249         (gfc_simplify_atan2): Move error checking earlier to eliminate
2250         a now unnecessay gfc_free_expr().
2251         (gfc_simplify_bessel_j0): Remove unnecessary gfc_set_model_kind().
2252         (gfc_simplify_bessel_j1): Ditto.
2253         (gfc_simplify_bessel_jn): Ditto.
2254         (gfc_simplify_bessel_y0): Ditto.
2255         (gfc_simplify_bessel_y1): Ditto.
2256         (gfc_simplify_bessel_yn): Ditto. 
2257         (only_convert_cmplx_boz): Eliminate unnecessary duplicate code, and
2258         combine nested if statement rational expressions.
2259         (gfc_simplify_cos): Use mpfr_clears() in preference to multiple
2260         mpfr_clear().
2261         (gfc_simplify_exp): Ditto.
2262         (gfc_simplify_fraction): Move gfc_set_model_kind() to after the
2263         special case of 0.  Use mpfr_clears() in preference to multiple
2264         mpfr_clear().
2265         (gfc_simplify_gamma): Eliminate unnecessary gfc_set_model_kind().
2266         (gfc_simplify_lgamma): Ditto.
2267         (gfc_simplify_log10): Ditto.
2268         (gfc_simplify_log): Move gfc_set_model_kind () inside switch
2269         statement. Use mpfr_clears() in preference to multiple mpfr_clear().
2270         (gfc_simplify_mod):  Eliminate now unused variables quot, iquot,
2271         and term.  Simplify the mpfr magic.
2272         (gfc_simplify_modulo): Ditto.
2273         (gfc_simplify_nearest): Eliminate unnecessary gfc_set_model_kind().
2274         (gfc_simplify_scale): Use mpfr_clears() in preference to multiple
2275         mpfr_clear().
2276         (gfc_simplify_sin): Ditto
2277         (gfc_simplify_sqrt): Ditto
2278         (gfc_simplify_set_exponent):  Move gfc_set_model_kind() to after the
2279         special case of 0.  Use mpfr_clears() in preference to multiple
2280         mpfr_clear().
2281
2282 2008-05-29  Daniel Franke  <franke.daniel@gmail.com>
2283
2284         PR target/36348
2285         * Make-lang.in (F95_OBJS): Added dependency on FORTRAN_TARGET_OBJS.
2286
2287 2008-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2288
2289         * scanner.c (load_line): Add first_char argument. Don't call ungetc.
2290         (gfc_read_orig_filename): Adjust call to load_line. Don't call
2291         ungetc.
2292         (load_file): Adjust call to load_line.
2293
2294 2008-05-28  Janus Weil  <janus@gcc.gnu.org>
2295
2296         PR fortran/36325
2297         PR fortran/35830
2298         * interface.c (gfc_procedure_use): Enable argument checking for
2299         external procedures with explicit interface.
2300         * symbol.c (check_conflict): Fix conflict checking for externals.
2301         (copy_formal_args): Fix handling of arrays.
2302         * resolve.c (resolve_specific_f0, resolve_specific_s0): Fix handling
2303         of intrinsics.
2304         * parse.c (parse_interface): Non-abstract INTERFACE statement implies
2305         EXTERNAL attribute.
2306
2307 2008-05-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2308
2309         PR fortran/36319
2310         * intrinsic.c (gfc_convert_chartype): Don't mark conversion
2311         function as pure.
2312         * trans-array.c (gfc_trans_array_ctor_element): Divide element
2313         size by the size of one character to obtain length.
2314         * iresolve.c (gfc_resolve_cshift): Call the _char4 variant when
2315         appropriate.
2316         (gfc_resolve_eoshift): Likewise.
2317         * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Minor beautification.
2318         (gfc_conv_intrinsic_fdate): Minor beautification.
2319         (gfc_conv_intrinsic_ttynam): Minor beautification.
2320         (gfc_conv_intrinsic_minmax_char): Allow all character kinds.
2321         (size_of_string_in_bytes): New function.
2322         (gfc_conv_intrinsic_size): Call size_of_string_in_bytes for
2323         character expressions.
2324         (gfc_conv_intrinsic_sizeof): Likewise.
2325         (gfc_conv_intrinsic_array_transfer): Likewise.
2326         (gfc_conv_intrinsic_trim): Allow all character kinds. Minor
2327         beautification.
2328         (gfc_conv_intrinsic_repeat): Fix comment typo.
2329         * simplify.c (gfc_convert_char_constant): Take care of conversion
2330         of array constructors.
2331
2332 2008-05-27  Tobias Burnus  <burnus@net-b.de>
2333
2334         PR fortran/36316
2335         * trans-array.c (gfc_set_loop_bounds_from_array_spec):
2336         Add missing fold_convert.
2337
2338 2008-05-26  Daniel Franke  <franke.daniel@gmail.com>
2339
2340         * fortran/cpp.c (cpp_define_builtins): Remove usage of TARGET_* macros,
2341         added FIXME instead.
2342
2343 2008-05-26  Daniel Franke  <franke.daniel@gmail.com>
2344
2345         PR fortran/18428
2346         * lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory,
2347         imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc,
2348         o, undef, v): New options.
2349         * options.c (gfc_init_options): Also initialize preprocessor
2350         options.
2351         (gfc_post_options): Also handle post-initialization of preprocessor
2352         options.
2353         (gfc_handle_option): Check if option is a preprocessor option.
2354         If yes, let gfc_cpp_handle_option() handle the option.
2355         * lang-specs.h: Reorganized to handle new options.
2356         * scanner.c (gfc_new_file): Read temporary file instead of
2357         input source if preprocessing is enabled.
2358         * f95-lang.c (gfc_init): Initialize preprocessor.
2359         (gfc_finish): Clean up preprocessor.
2360         * cpp.c: New.
2361         * cpp.h: New.
2362         * Make-lang.in: Added new objects and dependencies.
2363         * gfortran.texi: Updated section "Preprocessing and
2364         conditional compilation".
2365         * invoke.texi: Added new section "Preprocessing Options",
2366         listed and documented the preprocessing options handled
2367         by gfortran.
2368
2369 2008-05-25  Tobias Burnus  <burnus@net-b.de>
2370
2371         PR fortran/32600
2372         * trans-expr.c (gfc_conv_function_call): Remove library
2373         call for c_f_pointer with scalar Fortran pointers and for
2374         c_f_procpointer.
2375
2376 2008-05-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2377
2378         PR fortran/36257
2379         * iresolve.c (check_charlen_present): Don't force the rank to 1.
2380
2381 2008-05-19  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2382
2383         PR fortran/36265
2384         * trans-expr.c (gfc_conv_string_tmp): Pick the correct type for
2385         the temporary variable.
2386
2387 2008-05-19  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2388
2389         * simplify.c (gfc_simplify_dble, gfc_simplify_real): Initialize
2390         result variable to avoid warnings.
2391
2392 2008-05-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2393
2394         * intrinsic.c (char_conversions, ncharconv): New static variables.
2395         (find_char_conv): New function.
2396         (add_functions): Add simplification functions for ADJUSTL and
2397         ADJUSTR. Don't check the kind of their argument. Add checking for
2398         LGE, LLE, LGT and LLT.
2399         (add_subroutines): Fix argument type for SLEEP. Fix argument name
2400         for SYSTEM.
2401         (add_char_conversions): New function.
2402         (gfc_intrinsic_init_1): Call add_char_conversions.
2403         (gfc_intrinsic_done_1): Free char_conversions.
2404         (check_arglist): Use kind == 0 as a signal that we don't want
2405         the kind value to be checked.
2406         (do_simplify): Also simplify character functions.
2407         (gfc_convert_chartype): New function
2408         * trans-array.c (gfc_trans_array_ctor_element): Don't force the
2409         use of default character type.
2410         (gfc_trans_array_constructor_value): Likewise.
2411         (get_array_ctor_var_strlen): Use integer kind to build an integer
2412         instead of a character kind!
2413         (gfc_build_constant_array_constructor): Don't force the use of
2414         default character type.
2415         (gfc_conv_loop_setup): Likewise.
2416         * trans-expr.c (gfc_conv_string_tmp): Don't force the use of
2417         default character type. Allocate enough memory for wide strings.
2418         (gfc_conv_concat_op): Make sure operand kind are the same.
2419         (string_to_single_character): Remove gfc_ prefix. Reindent.
2420         Don't force the use of default character type.
2421         (gfc_conv_scalar_char_value): Likewise.
2422         (gfc_build_compare_string): Call string_to_single_character.
2423         (fill_with_spaces): New function
2424         (gfc_trans_string_copy): Add kind arguments. Use them to deal
2425         with wide character kinds.
2426         (gfc_conv_statement_function): Whitespace fix. Call
2427         gfc_trans_string_copy with new kind arguments.
2428         (gfc_conv_substring_expr): Call gfc_build_wide_string_const
2429         instead of using gfc_widechar_to_char.
2430         (gfc_conv_string_parameter): Don't force the use of default
2431         character type.
2432         (gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy.
2433         * intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant,
2434         gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes.
2435         * decl.c (gfc_set_constant_character_len): Don't assert the
2436         existence of a single character kind.
2437         * trans-array.h (gfc_trans_string_copy): New prototype.
2438         * gfortran.h (gfc_check_character_range, gfc_convert_chartype):
2439         New prototypes.
2440         * error.c (print_wide_char_into_buffer): New function lifting
2441         code from gfc_print_wide_char. Fix order to output '\x??' instead
2442         of 'x\??'.
2443         (gfc_print_wide_char): Call print_wide_char_into_buffer.
2444         (show_locus): Call print_wide_char_into_buffer with buffer local
2445         to this function.
2446         * trans-const.c (gfc_build_wide_string_const): New function.
2447         (gfc_conv_string_init): Deal with wide characters strings
2448         constructors.
2449         (gfc_conv_constant_to_tree): Call gfc_build_wide_string_const.
2450         * trans-stmt.c (gfc_trans_label_assign): Likewise.
2451         (gfc_trans_character_select): Deal with wide strings.
2452         * expr.c (gfc_check_assign): Allow conversion between character
2453         kinds on assignment.
2454         * trans-const.h (gfc_build_wide_string_const): New prototype.
2455         * trans-types.c (gfc_get_character_type_len_for_eltype,
2456         gfc_get_character_type_len): Create too variants of the old
2457         gfc_get_character_type_len, one getting kind argument and the
2458         other one directly taking a type tree.
2459         * trans.h (gfor_fndecl_select_string_char4,
2460         gfor_fndecl_convert_char1_to_char4,
2461         gfor_fndecl_convert_char4_to_char1): New prototypes.
2462         * trans-types.h (gfc_get_character_type_len_for_eltype): New
2463         prototype.
2464         * resolve.c (resolve_operator): Exit early when kind mismatches
2465         are detected, because that makes us issue an error message later.
2466         (validate_case_label_expr): Fix wording of error message.
2467         * iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New
2468         functions.
2469         (gfc_resolve_pack): Call _char4 variants of library function
2470         when dealing with wide characters.
2471         (gfc_resolve_reshape): Likewise.
2472         (gfc_resolve_spread): Likewise.
2473         (gfc_resolve_transpose): Likewise.
2474         (gfc_resolve_unpack): Likewise.
2475         * target-memory.c (size_character): Take character kind bit size
2476         correctly into account (not that it changes anything for now, but
2477         it's more generic).
2478         (gfc_encode_character): Added gfc_ prefix. Encoding each
2479         character of a string by calling native_encode_expr for the
2480         corresponding unsigned integer.
2481         (gfc_target_encode_expr): Add gfc_ prefix to encode_character.
2482         * trans-decl.c (gfc_build_intrinsic_function_decls): Build
2483         gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4
2484         and gfor_fndecl_convert_char4_to_char1.
2485         * target-memory.h (gfc_encode_character): New prototype.
2486         * arith.c (gfc_check_character_range): New function.
2487         (eval_intrinsic): Allow non-default character kinds.
2488         * check.c (gfc_check_access_func): Only allow default
2489         character kind arguments.
2490         (gfc_check_chdir): Likewise.
2491         (gfc_check_chdir_sub): Likewise.
2492         (gfc_check_chmod): Likewise.
2493         (gfc_check_chmod_sub): Likewise.
2494         (gfc_check_lge_lgt_lle_llt): New function.
2495         (gfc_check_link): Likewise.
2496         (gfc_check_link_sub): Likewise.
2497         (gfc_check_symlnk): Likewise.
2498         (gfc_check_symlnk_sub): Likewise.
2499         (gfc_check_rename): Likewise.
2500         (gfc_check_rename_sub): Likewise.
2501         (gfc_check_fgetputc_sub): Likewise.
2502         (gfc_check_fgetput_sub): Likewise.
2503         (gfc_check_stat): Likewise.
2504         (gfc_check_stat_sub): Likewise.
2505         (gfc_check_date_and_time): Likewise.
2506         (gfc_check_ctime_sub): Likewise.
2507         (gfc_check_fdate_sub): Likewise.
2508         (gfc_check_gerror): Likewise.
2509         (gfc_check_getcwd_sub): Likewise.
2510         (gfc_check_getarg): Likewise.
2511         (gfc_check_getlog): Likewise.
2512         (gfc_check_hostnm): Likewise.
2513         (gfc_check_hostnm_sub): Likewise.
2514         (gfc_check_ttynam_sub): Likewise.
2515         (gfc_check_perror): Likewise.
2516         (gfc_check_unlink): Likewise.
2517         (gfc_check_unlink_sub): Likewise.
2518         (gfc_check_system_sub): Likewise.
2519         * primary.c (got_delim): Perform correct character range checking
2520         for all kinds.
2521         * trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate
2522         calls to library functions convert_char4_to_char1 and
2523         convert_char1_to_char4 for character conversions.
2524         (gfc_conv_intrinsic_char): Allow all character kings.
2525         (gfc_conv_intrinsic_strcmp): Fix whitespace.
2526         (gfc_conv_intrinsic_repeat): Take care of all character kinds.
2527         * intrinsic.texi: For all GNU intrinsics accepting character
2528         arguments, mention that they're restricted to the default kind.
2529         * simplify.c (simplify_achar_char): New function.
2530         (gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char.
2531         gfc_simplify_ichar): Don't error out for wide characters.
2532         (gfc_convert_char_constant): New function.
2533
2534 2008-05-18  Steven G. Kargl  <kargls@comcast.net>
2535
2536         PR fortran/36251
2537         * symbol.c (check_conflict): Issue errors for abuse of PUBLIC, PRIVATE,
2538         and BIND(C).
2539         * resolve.c (gfc_verify_binding_labels): Fix NULL pointer dereference.
2540
2541 2008-05-17  Tobias Burnus  <burnus@net-b.de>
2542
2543         * intrinsic.texi: Correct description of GET_COMMAND_ARGUMENT
2544         and GET_ENVIRONMENT_VARIABLE; fix keyword= name for GETENV,
2545         GETLOG, GMTIME, HOSTNM, IRAND, ITIME, KILL.
2546         Move LOG_GAMMA after LOG10.
2547
2548 2008-05-17  Tobias Burnus  <burnus@net-b.de>
2549
2550         * intrinsic.c (add_functions): Change FLUSH(C) to FLUSH(UNIT).
2551         * intrinsic.texi: Change INTEGER(*) to INTEGER; fix keyword= name for
2552         ABS, ADJUSTL, AINT, ALLOCATED, ANINT, ASSOCIATED, C_ASSOCIATED,
2553         CEILING, DBLE, DFLOAT, DOT_PRODUCT, DREAL, FLOAT, FLOOR, GET_COMMAND.
2554
2555 2008-05-16  Paul Thomas  <pault@gcc.gnu.org>
2556
2557         PR fortran/35756
2558         PR fortran/35759
2559         * trans-stmt.c (gfc_trans_where): Tighten up the dependency
2560         check for calling gfc_trans_where_3.
2561
2562         PR fortran/35743
2563         * trans-stmt.c (gfc_trans_where_2): Set the mask size to zero
2564         if it is calculated to be negative.
2565
2566         PR fortran/35745
2567         * trans-stmt.c (gfc_trans_where_3, gfc_trans_where_assign): Set
2568         ss->where for scalar right hand sides.
2569         * trans-array.c (gfc_add_loop_ss_code): If ss->where is set do
2570         not evaluate scalars outside the loop.  Clean up whitespace.
2571         * trans.h : Add a bitfield 'where' to gfc_ss.
2572
2573 2008-05-16  Tobias Burnus  <burnus@net-b.de>
2574
2575         * libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15.
2576         * array.c (gfc_match_array_spec): Error with -std=f2003 if rank > 7.
2577
2578 2008-04-16  Daniel Kraft  <d@domob.eu>
2579
2580         PR fortran/27997
2581         * gfortran.h:  Added field "length_from_typespec" to gfc_charlength.
2582         * aray.c (gfc_match_array_constructor):  Added code to parse typespec.
2583         (check_element_type, check_constructor_type, gfc_check_constructor_type):
2584         Extended to support explicit typespec on constructor.
2585         (gfc_resolve_character_array_constructor):  Pad strings correctly for
2586         explicit, constant character length.
2587         * trans-array.c:  New static global variable "typespec_chararray_ctor"
2588         (gfc_trans_array_constructor):  New code to support explicit but dynamic
2589         character lengths.
2590
2591 2008-05-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2592
2593         PR fortran/34325
2594         * decl.c (match_attr_spec): Check for matching pairs of parenthesis.
2595         * expr.c (gfc_specification_expr): Supplement the error message with the
2596         type that was found.
2597         * resolve.c (gfc_resolve_index): Likewise.
2598         * match.c (gfc_match_parens): Clarify error message with "at or before".
2599         (gfc_match_do): Check for matching pairs of parenthesis.
2600
2601 2008-05-16  Tobias Burnus  <burnus@net-b.de
2602
2603         * intrinsic.texi: Write Fortran 77/90/95 instead of F77/90/95;
2604         add missing KIND argument to ACHAR and NINT; and state that
2605         the KIND argument is a F2003 extension for ACHAR, COUNT, IACHAR,
2606         ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND, VERIFY.
2607
2608 2008-05-16  Daniel Kraft  <d@domob.eu>
2609
2610         * primary.c:  New private structure "gfc_structure_ctor_component".
2611         (gfc_free_structure_ctor_component):  New helper function.
2612         (gfc_match_structure_constructor):  Extended largely to support named
2613         arguments and default initialization for structure constructors.
2614
2615 2008-05-15  Steven G. Kargl  <kargls@comcast.net>
2616
2617         * simplify.c (gfc_simplify_dble, gfc_simplify_float,
2618         simplify_bound, gfc_simplify_nearest, gfc_simplify_real): Plug
2619         possible memory leaks.
2620         (gfc_simplify_reshape): Plug possible memory leaks and dereferencing
2621         of NULL pointers.
2622
2623 2008-05-15  Steven G. Kargl  <kargls@comcast.net>
2624
2625         PR fortran/36239
2626         * simplify.c (gfc_simplify_int, gfc_simplify_intconv): Replaced hand
2627         rolled integer conversion with gfc_int2int, gfc_real2int, and
2628         gfc_complex2int.
2629         (gfc_simplify_intconv): Renamed to simplify_intconv.
2630         
2631 2008-05-15  Steven G. Kargl,   <kargl@comcast.net>
2632         * gfortran.dg/and_or_xor.f90: New test
2633
2634         * fortran/simplify.c (gfc_simplify_and, gfc_simplify_or,
2635         gfc_simplify_xor): Don't range check logical results.
2636
2637 2008-05-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2638
2639         * trans-expr.c (gfc_conv_concat_op): Take care of nondefault
2640         character kinds.
2641         (gfc_build_compare_string): Add kind argument and use it.
2642         (gfc_conv_statement_function): Fix indentation.
2643         * gfortran.h (gfc_character_info): New structure.
2644         (gfc_character_kinds): New array.
2645         * trans-types.c (gfc_character_kinds, gfc_character_types,
2646         gfc_pcharacter_types): New array.
2647         (gfc_init_kinds): Fill character kinds array.
2648         (validate_character): Take care of nondefault character kinds.
2649         (gfc_build_uint_type): New function.
2650         (gfc_init_types): Take care of nondefault character kinds.
2651         (gfc_get_char_type, gfc_get_pchar_type): New functions.
2652         (gfc_get_character_type_len): Use gfc_get_char_type.
2653         * trans.h (gfc_build_compare_string): Adjust prototype.
2654         (gfor_fndecl_compare_string_char4, gfor_fndecl_concat_string_char4,
2655         gfor_fndecl_string_len_trim_char4, gfor_fndecl_string_index_char4,
2656         gfor_fndecl_string_scan_char4, gfor_fndecl_string_verify_char4,
2657         gfor_fndecl_string_trim_char4, gfor_fndecl_string_minmax_char4,
2658         gfor_fndecl_adjustl_char4, gfor_fndecl_adjustr_char4): New
2659         prototypes.
2660         * trans-types.h (gfc_get_char_type, gfc_get_pchar_type): New
2661         prototypes.
2662         * trans-decl.c (gfor_fndecl_compare_string_char4,
2663         gfor_fndecl_string_len_trim_char4, gfor_fndecl_string_index_char4,
2664         gfor_fndecl_string_scan_char4, gfor_fndecl_string_verify_char4,
2665         gfor_fndecl_string_trim_char4, gfor_fndecl_string_minmax_char4,
2666         gfor_fndecl_adjustl_char4, gfor_fndecl_adjustr_char4,
2667         gfor_fndecl_concat_string_char4): New function decls.
2668         (gfc_build_intrinsic_function_decls): Define new *_char4 function
2669         decls.
2670         * trans-intrinsic.c (gfc_conv_intrinsic_minmax_char,
2671         gfc_conv_intrinsic_len_trim, gfc_conv_intrinsic_ichar,
2672         gfc_conv_intrinsic_strcmp, gfc_conv_intrinsic_trim,
2673         gfc_conv_intrinsic_function): Deal with nondefault character kinds.
2674
2675 2008-05-15  Sa Liu  <saliu@de.ibm.com>
2676
2677         * iso-c-binding.def: Add standard parameter to macro NAMED_INTCST.
2678         All existing NAMED_INTCST definitions has standard GFC_STD_F2003,
2679         c_int128_t, c_int_least128_t and c_int_fast128_t are added as
2680         GNU extensions.
2681         * iso-fortran-evn.def: Add standard parameter GFC_STD_F2003
2682         to macro NAMED_INTCST.
2683         * symbol.c (std_for_isocbinding_symbol): New helper function to 
2684         return the standard that supports this isocbinding symbol.
2685         (generate_isocbinding_symbol): Do not generate GNU extension symbols
2686         if std=f2003. Add new parameter to NAMED_INTCST.
2687         * module.c (use_iso_fortran_env_module): Add new parameter to
2688         NAMED_INTCST and new field standard to struct intmod_sym.
2689         * gfortran.h: Add new parameter to NAMED_INTCST.
2690         * trans-types.c (init_c_interop_kinds): Add new parameter to 
2691         NAMED_INTCST.
2692         * intrinsic.texi: Documented new types C_INT128_T, C_INT_LEASE128_T
2693         and C_INT_FAST128_T.
2694
2695 2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2696
2697         PR fortran/36059
2698         * trans-decl.c (gfc_build_dummy_array_decl): Don't repack
2699         arrays that have the TARGET attribute.
2700
2701 2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2702
2703         PR fortran/36186
2704         * simplify.c (only_convert_cmplx_boz): New function.
2705         (gfc_simplify_cmplx, gfc_simplify_complex, gfc_simplify_dcmplx):
2706         Call only_convert_cmplx_boz.
2707
2708 2008-05-14  Paul Thomas  <pault@gcc.gnu.org>
2709
2710         PR fortran/36233
2711         * interface.c (compare_actual_formal): Do not check sizes if the
2712         actual is BT_PROCEDURE.
2713
2714 2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2715
2716         PR fortran/35682
2717         * trans-array.c (gfc_conv_ss_startstride): Any negative size is
2718         the same as zero size.
2719         (gfc_conv_loop_setup): Fix size calculation.
2720
2721 2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2722
2723         PR fortran/35685
2724         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Correctly
2725         handle zero-size sections.
2726
2727 2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2728
2729         PR fortran/36215
2730         * scanner.c (preprocessor_line): Allocate enough memory for a
2731         wide string.
2732
2733 2008-05-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2734
2735         PR fortran/36176
2736         * target-memory.c (gfc_target_expr_size): Correctly treat
2737         substrings.
2738         (gfc_target_encode_expr): Likewise.
2739         (gfc_interpret_complex): Whitespace change.
2740
2741 2008-05-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
2742
2743         PR fortran/35719
2744         * trans.c (gfc_call_malloc): If size equals zero, allocate one
2745         byte; don't return a null pointer.
2746
2747 2008-05-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2748
2749         PR fortran/36197
2750         * module.c (quote_string): Fix sprintf format.
2751
2752 2008-05-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2753
2754         PR fortran/36162
2755         * module.c (quote_string, unquote_string,
2756         mio_allocated_wide_string): New functions.
2757         (mio_expr): Call mio_allocated_wide_string where needed.
2758
2759 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
2760
2761          * trans-decl.c (gfc_get_extern_function_decl, build_function_decl):
2762          Rename DECL_IS_PURE to DECL_PURE_P.
2763
2764 2008-05-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2765
2766         * arith.c: (gfc_arith_concat, gfc_compare_string,
2767         gfc_compare_with_Cstring, hollerith2representation,
2768         gfc_hollerith2int, gfc_hollerith2real, gfc_hollerith2complex,
2769         gfc_hollerith2character, gfc_hollerith2logical): Use wide
2770         characters for character constants.
2771         * data.c (create_character_intializer): Likewise.
2772         * decl.c (gfc_set_constant_character_len): Likewise.
2773         * dump-parse-tree.c (show_char_const): Correctly dump wide
2774         character strings.
2775         error.c (print_wide_char): Rename into gfc_print_wide_char.
2776         (show_locus): Adapt to new prototype of gfc_print_wide_char.
2777         expr.c (free_expr0): Representation is now disjunct from
2778         character string value, so we always free it.
2779         (gfc_copy_expr, find_substring_ref, gfc_simplify_expr): Adapt
2780         to wide character strings.
2781         * gfortran.h (gfc_expr): Make value.character.string a wide string.
2782         (gfc_wide_toupper, gfc_wide_strncasecmp, gfc_wide_memset,
2783         gfc_widechar_to_char, gfc_char_to_widechar): New prototypes.
2784         (gfc_get_wide_string): New macro.
2785         (gfc_print_wide_char): New prototype.
2786         * io.c (format_string): Make a wide string.
2787         (next_char, gfc_match_format, compare_to_allowed_values, 
2788         gfc_match_open): Deal with wide strings.
2789         * module.c (mio_expr): Convert between wide strings and ASCII ones.
2790         * primary.c (match_hollerith_constant, match_charkind_name): 
2791         Handle wide strings.
2792         * resolve.c (build_default_init_expr): Likewise.
2793         * scanner.c (gfc_wide_toupper, gfc_wide_memset,
2794         gfc_char_to_widechar): New functions.
2795         (wide_strchr, gfc_widechar_to_char, gfc_wide_strncasecmp):
2796         Changes in prototypes.
2797         (gfc_define_undef_line, load_line, preprocessor_line,
2798         include_line, load_file, gfc_read_orig_filename): Handle wide
2799         strings.
2800         * simplify.c (gfc_simplify_achar, gfc_simplify_adjustl,
2801         gfc_simplify_adjustr, gfc_simplify_char, gfc_simplify_iachar,
2802         gfc_simplify_ichar, simplify_min_max, gfc_simplify_new_line,
2803         gfc_simplify_repeat): Handle wide strings.
2804         (wide_strspn, wide_strcspn): New helper functions.
2805         (gfc_simplify_scan, gfc_simplify_trim, gfc_simplify_verify):
2806         Handle wide strings.
2807         * symbol.c (generate_isocbinding_symbol): Likewise.
2808         * target-memory.c (size_character, gfc_target_expr_size,
2809         encode_character, gfc_target_encode_expr, gfc_interpret_character,
2810         gfc_target_interpret_expr): Handle wide strings.
2811         * trans-const.c (gfc_conv_string_init): Lower wide strings to
2812         narrow ones.
2813         (gfc_conv_constant_to_tree): Likewise.
2814         * trans-expr.c (gfc_conv_substring_expr): Handle wide strings.
2815         * trans-io.c (gfc_new_nml_name_expr): Likewise.
2816         * trans-stmt.c (gfc_trans_label_assign): Likewise.
2817
2818 2008-05-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2819
2820         * simplify.c (gfc_simplify_bessel_j0,gfc_simplify_bessel_j1,
2821         gfc_simplify_bessel_jn,gfc_simplify_bessel_y0,
2822         gfc_simplify_bessel_y1,gfc_simplify_bessel_yn): Mark arguments
2823         with ATTRIBUTE_UNUSED.
2824
2825 2008-05-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2826
2827         * check.c (gfc_check_sizeof): Switch to ATTRIBUTE_UNUSED.
2828         * simplify.c (gfc_simplify_lgamma): Likewise.
2829
2830 2008-05-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2831
2832         * openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and
2833         gfc_peek_ascii_char.
2834         * decl.c (gfc_match_kind_spec, gfc_match_type_spec,
2835         gfc_match_implicit_none, match_implicit_range, gfc_match_implicit,
2836         match_string_p, match_attr_spec, gfc_match_suffix,
2837         match_procedure_decl, gfc_match_entry, gfc_match_subroutine):
2838         Likewise.
2839         * gfortran.h (gfc_char_t): New type.
2840         (gfc_linebuf): Make line member a gfc_char_t.
2841         (locus): Make nextc member a gfc_char_t.
2842         (gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte,
2843         gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char,
2844         gfc_peek_ascii_char, gfc_check_digit): New prototypes.
2845         * error.c (print_wide_char): New function.
2846         (show_locus): Use print_wide_char and gfc_wide_strlen.
2847         * io.c (next_char): Use gfc_char_t type.
2848         (match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char.
2849         * match.c (gfc_match_parens, gfc_match_eos,
2850         gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C,
2851         gfc_match_intrinsic_op, gfc_match_char,  gfc_match_return,
2852         gfc_match_common): Likewise.
2853         * match.h (gfc_match_special_char): Change prototype.
2854         * parse.c (decode_specification_statement, decode_statement,
2855         decode_omp_directive, next_free, next_fixed): Use
2856         gfc_peek_ascii_char and gfc_next_ascii_char.
2857         * primary.c (gfc_check_digit): Change name.
2858         (match_digits, match_hollerith_constant, match_boz_constant,
2859         match_real_constant, next_string_char, match_charkind_name,
2860         match_string_constant, match_logical_constant_string,
2861         match_complex_constant, match_actual_arg, match_varspec,
2862         gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and
2863         gfc_next_ascii_char.
2864         * scanner.c (gfc_wide_fits_in_byte, wide_is_ascii,
2865         gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit,
2866         gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy,
2867         wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp,
2868         gfc_next_ascii_char, gfc_peek_ascii_char):
2869         New functions.
2870         (next_char, gfc_define_undef_line, skip_free_comments,
2871         gfc_next_char_literal, gfc_next_char, gfc_peek_char,
2872         gfc_error_recovery, load_line, preprocessor_line, include_line,
2873         load_file, gfc_read_orig_filename): Use gfc_char_t for source
2874         characters and the {gfc_,}wide_* functions to manipulate wide
2875         strings.
2876
2877 2008-05-06  Tobias Burnus  <burnus@net-b.de>
2878
2879         PR fortran/36117
2880         * intrinsic.c (add_functions): Call gfc_simplify_bessel_*.
2881         * intrinsic.h: Add prototypes for gfc_simplify_bessel_*.
2882         * simplify.c (gfc_simplify_bessel_j0,gfc_simplify_bessel_j1,
2883         gfc_simplify_bessel_jn,gfc_simplify_bessel_y0,
2884         gfc_simplify_bessel_y1,gfc_simplify_bessel_yn): New.
2885
2886 2008-05-03  Janus Weil  <jaydub66@gmail.com>
2887
2888         * misc.c (gfc_clear_ts): Set interface to NULL.
2889
2890 2008-05-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2891
2892         PR fortran/33268
2893         * gfortran.h: Add extra_comma pointer to gfc_dt structure. Add iokind to
2894         gfc_expr value union. Add io_kind enum to here from io.c.
2895         * io.c (gfc_free_dt): Free extra_comma.
2896         (gfc_resolve_dt): If an extra comma was encountered and io_unit is type
2897         BT_CHARACTER, resolve to format_expr and set default unit.  Error if
2898         io_kind is M_WRITE. (match_io):  Match the extra comma and set new
2899         pointer, extra_comma.
2900
2901 2008-05-01  Bud Davis  <bdavis9659@sbcglobal.net>
2902
2903         PR35940/Fortran
2904         * simplify.c (gfc_simplify_index): Check for direction argument 
2905         being a constant.
2906
2907 2008-05-01  Janus Weil  <jaydub66@gmail.com>
2908
2909         * gfortran.h (struct gfc_symbol): Moving "interface" member to
2910         gfc_typespec (plus fixing a small docu error).
2911         * interface.c (gfc_procedure_use): Ditto.
2912         * decl.c (match_procedure_decl): Ditto.
2913         * resolve.c (resolve_specific_f0,
2914         resolve_specific_f0, resolve_symbol): Ditto.
2915
2916 2008-04-30  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2917
2918         * intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
2919         * intrinsic.h (gfc_check_selected_char_kind,
2920         gfc_simplify_selected_char_kind): New prototypes.
2921         * gfortran.h (gfc_isym_id): Add GFC_ISYM_SC_KIND.
2922         * trans.h (gfor_fndecl_sc_kind): New function decl.
2923         * trans-decl.c (gfor_fndecl_sc_kind): Build new decl.
2924         * arith.c (gfc_compare_with_Cstring): New function.
2925         * arith.h (gfc_compare_with_Cstring): New prototype.
2926         * check.c (gfc_check_selected_char_kind): New function.
2927         * primary.c (match_string_constant, match_kind_param): Mark
2928         symbols used as literal constant kind param as referenced.
2929         * trans-intrinsic.c (gfc_conv_intrinsic_sc_kind): New function.
2930         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_sc_kind.
2931         * intrinsic.texi (SELECTED_CHAR_KIND): Document new intrinsic.
2932         * simplify.c (gfc_simplify_selected_char_kind): New function.
2933
2934 2008-04-28  Paul Thomas  <pault@gcc.gnu.org>
2935
2936         PR fortran/35997
2937         * module.c (find_symbol): Do not return a result for a symbol
2938         that has been renamed in another module.
2939
2940 2008-04-26  George Helffrich <george@gcc.gnu.org>
2941
2942         PR fortran/35892
2943         PR fortran/35154
2944         * trans-common.c (create_common):  Add decl to function
2945         chain (if inside one) to preserve identifier scope in debug output.
2946
2947 2008-04-25  Jan Hubicka  <jh@suse.cz>
2948
2949         * trans-decl.c (trans_function_start): Update.
2950
2951 2008-04-25  Tobias Burnus  <burnus@net-b.de>
2952             Daniel Franke <franke.daniel@gmail.com>
2953
2954         PR fortran/35156
2955         * gfortranspec.c (lang_specific_driver): Deprecate
2956         -M option; fix ICE when "-M" is last argument and
2957         make "-M<dir>" work.
2958         * options.c (gfc_handle_module_path_options): 
2959         Use -J instead of -M in error messages.
2960         * invoke.texi: Mark -M as depecated.
2961
2962 2008-04-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2963             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2964
2965         PR fortran/35994
2966         * trans-instrinsic.c (gfc_conv_intrinsic_minmaxloc): Correctly adjust
2967         loop counter offset.
2968
2969 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
2970
2971         * trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT.
2972         * trans-array.c (gfc_build_null_descriptor): Don't set TREE_INVARIANT.
2973         (gfc_trans_array_constructor_value): Don't set TREE_INVARIANT.
2974         (gfc_build_constant_array_constructor): Don't set TREE_INVARIANT.
2975         (gfc_conv_array_initializer): Don't set TREE_INVARIANT.
2976         * trans-common.c (get_init_field): Don't set TREE_INVARIANT.
2977         (create_common): Don't set TREE_INVARIANT.
2978         * trans-stmt.c (gfc_trans_character_select): Don't set TREE_INVARIANT.
2979         * trans-decl.c (gfc_generate_function_code): Don't set TREE_INVARIANT.
2980
2981 2008-04-21  Steve Ellcey  <sje@cup.hp.com>
2982
2983         * f95-lang.c (gfc_init_decl_processing): use ptr_mode instead of Pmode.
2984
2985 2008-04-21  Daniel Franke  <franke.daniel@gmail.com>
2986
2987         PR fortran/35019
2988         * gfortranspec.c (lookup_option): Properly handle separated arguments
2989         in -J option, print missing argument message when necessary.
2990
2991 2008-04-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2992
2993         PR fortran/35882
2994         * scanner.c (skip_fixed_comments): Update continue_line when comment is
2995         detected. (gfc_next_char_literal): Likewise.
2996
2997 2008-04-19  Paul Thomas  <pault@gcc.gnu.org>
2998
2999         PR fortran/35944
3000         PR fortran/35946
3001         PR fortran/35947
3002         * trans_array.c (gfc_trans_array_constructor): Temporarily
3003         realign loop, if loop->from is not zero, before creating
3004         the temporary array and provide an offset.
3005
3006         PR fortran/35959
3007         * trans-decl.c (gfc_init_default_dt): Add gfc_ prefix to name
3008         and allow for NULL body.  Change all references from
3009         init_default_dt to gfc_init_default_dt.
3010         * trans.h : Add prototype for gfc_init_default_dt.
3011         * trans-array.c (gfc_trans_deferred_vars): After nullification
3012         call gfc_init_default_dt for derived types with allocatable
3013         components.
3014
3015 2008-04-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3016
3017         PR fortran/35892
3018         * trans-common.c (create_common): Revert patch causing regression.
3019
3020 2008-04-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3021
3022         PR fortran/35724
3023         * iresolve.c (gfc_resolve_eoshift): Check for NULL symtree in test for
3024         optional argument attribute.
3025         
3026 2008-04-16  Paul Thomas  <pault@gcc.gnu.org>
3027
3028         PR fortran/35932
3029         * trans-intrinsic.c (gfc_conv_intrinsic_char): Even though KIND
3030         is not used, the argument must be converted.
3031
3032 2008-04-16  Jakub Jelinek  <jakub@redhat.com>
3033
3034         PR target/35662
3035         * f95-lang.c (gfc_init_builtin_functions): Make sure
3036         BUILT_IN_SINCOS{,F,L} types aren't varargs.
3037
3038 2008-04-15  Paul Thomas  <pault@gcc.gnu.org>
3039
3040         PR fortran/35864
3041         * expr.c (scalarize_intrinsic_call): Reorder identification of
3042         array argument so that if one is not found a segfault does not
3043         occur.  Return FAILURE if all scalar arguments.
3044
3045 2008-04-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3046             Tobias Burnus  <burnus@net-b.de>
3047
3048         PR fortran/35882
3049         * options.c (gfc_init_options): Set the default maximum continuation
3050         lines to 255 for both free and fixed form source for warnings.
3051         (gfc_handle_option): Set -std=f95 fixed form max continuations to 19 and
3052         the -std=f95 free form max continuations to 39 for warnings.
3053         * scanner.c (gfc_next_char_literal): Adjust the current_line number only
3054         if it is less than the current locus.
3055
3056 2008-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3057
3058         PR fortran/25829 28655
3059         * io.c (io_tag): Add new tags for decimal, encoding, asynchronous,
3060         round, sign, and id. (match_open_element): Match new tags.
3061         (gfc_resolve_open): Resolve new tags. (gfc_match_open): Enable encoding
3062         for DEFAULT only. Update error messages. (match_dt_element): Fix match
3063         tag for asynchronous. Update error messages. (gfc_free_inquire): Free
3064         new expressions. (match_inquire_element): Match new tags.
3065         (gfc_match_inquire): Add constraint for ID and PENDING.
3066         (gfc_resolve_inquire): Resolve new tags.
3067         * trans-io.c (gfc_trans_inquire): Clean up whitespace and fix setting of
3068         mask for ID parameter.
3069         * ioparm.def: Fix order of parameters for pending, round, and sign.
3070         NOTE: These must line up with the definitions in libgfortran/io/io.h. or
3071         things don't work.
3072
3073 2008-04-06  Paul Thomas  <pault@gcc.gnu.org>
3074
3075         PR fortran/35780
3076         * expr.c (scalarize_intrinsic_call): Identify which argument is
3077         an array and use that as the template.
3078         (check_init_expr): Remove tests that first argument is an array
3079         in the call to scalarize_intrinsic_call.
3080
3081 2008-04-06  Tobias Schlüter  <tobi@gcc.gnu.org>
3082
3083         PR fortran/35832
3084         * io.c (io_tag): Add field 'value'.  Split 'spec' field in
3085         existing io_tags.
3086         (match_etag, match_vtag, match_ltag): Split parsing in two steps
3087         to give better error messages.
3088
3089 2008-04-06  Tobias Burnus  <burnus@net-b.de>
3090
3091         * io.c (check_io_constraints): Add constrains. ID= requires
3092         asynchronous= and asynchronous= must be init expression.
3093
3094 2008-04-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3095
3096         * f95-lang.c: Set LANG_HOOKS_NAME to "GNU Fortran".
3097
3098 2008-04-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3099
3100         * dump-parse-tree.c: Use fprintf, fputs and fputc instead of
3101         gfc_status and gfc_status_char. Remove gfc_ prefix of the gfc_show_*
3102         functions and make them static. Add new gfc_dump_parse_tree
3103         function.
3104         * gfortran.h (gfc_option_t): Rename verbose into dump_parse_tree.
3105         (gfc_status, gfc_status_char): Delete prototypes.
3106         * error.c (gfc_status, gfc_status_char): Remove functions.
3107         * scanner.c (gfc_new_file): Use printf instead of gfc_status.
3108         * options.c (gfc_init_options): Rename verbose into dump_parse_tree.
3109         (gfc_handle_module_path_options): Use gfc_fatal_error instead of
3110         gfc_status and exit.
3111         (gfc_handle_option): Rename verbose into dump_parse_tree.
3112         * parse.c (gfc_parse_file): Use gfc_dump_parse_tree.
3113
3114 2008-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3115             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3116
3117         PR fortran/25829 28655
3118         * dump-parse-tree.c (gfc_show_code_node): Show new I/O parameters.
3119         * gfortran.h (gfc_statement): Add ST_WAIT enumerator.
3120         (gfc_open): Add pointers for decimal, encoding, round, sign,
3121         asynchronous. (gfc_inquire): Add pointers for asynchronous, decimal,
3122         encoding, pending, round, sign, size, id.
3123         (gfc_wait): New typedef struct. (gfc_dt): Add pointers for id, pos,
3124         asynchronous, blank, decimal, delim, pad, round, sign.
3125         (gfc_exec_op): Add EXEC_WAIT enumerator. (gfc_code): Add pointer for
3126         wait. (gfc_free_wait), (gfc_resolve_wait): New function prototypes.
3127         * trans-stmt.h (gfc_trans_wait): New function prototype.
3128         * trans.c (gfc_trans_code): Add case for EXEC_WAIT.
3129         * io.c (io_tag): Add new tags for DECIMAL, ENCODING, ROUND, SIGN,
3130         ASYCHRONOUS, ID. (match_open_element): Add matchers for new tags.
3131         (gfc_free_open): Free new pointers. (gfc_resolve_open): Resolve new
3132         tags. (gfc_resolve_open): Remove comment around check for allowed
3133         values and ASYNCHRONOUS, update it.  Likewise for DECIMAL, ENCODING,
3134         ROUND, and SIGN. (match_dt_element): Add matching for new tags.
3135         (gfc_free_wait): New function. (gfc_resolve_wait): New function.
3136         (match_wait_element): New function. (gfc_match_wait): New function.
3137         * resolve.c (gfc_resolve_blocks): Add case for EXEC_WAIT.
3138         (resolve_code): Add case for EXEC_WAIT. 
3139         * st.c (gfc_free_statement): Add case for EXEC_WAIT.
3140         * trans-io.c (ioparam_type): Add IOPARM_ptype_wait. (gfc_st_parameter):
3141         Add "wait" entry. (iocall): Add IOCALL_WAIT enumerator.
3142         (gfc_build_io_library_fndecls): Add function declaration for st_wait.
3143         (gfc_trans_open): Add mask bits for new I/O tags.
3144         (gfc_trans_inquire): Add mask bits for new I/O tags.
3145         (gfc_trans_wait): New translation function.
3146         (build_dt): Add mask bits for new I/O tags.
3147         * match.c (gfc_match_if) Add matcher for "wait".
3148         * match.h (gfc_match_wait): Prototype for new function.
3149         * ioparm.def: Add new I/O parameter definitions.
3150         * parse.c (decode_statement): Add match for "wait" statement.
3151         (next_statement): Add case for ST_WAIT. (gfc_ascii_statement): Same.
3152
3153 2008-04-03  Jakub Jelinek  <jakub@redhat.com>
3154
3155         PR fortran/35786
3156         * openmp.c (resolve_omp_clauses): Diagnose if a clause symbol
3157         isn't a variable.
3158
3159 2008-04-03  Tom Tromey  <tromey@redhat.com>
3160
3161         * Make-lang.in (fortran_OBJS): New variable.
3162
3163 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
3164
3165         * f95-lang.c (insert_block): Kill.
3166
3167 2008-04-01  George Helffrich <george@gcc.gnu.org>
3168
3169         PR fortran/35154, fortran/23057
3170         * trans-common.c (create_common):  Add decl to function
3171         chain to preserve identifier scope in debug output.
3172
3173 2008-04-01  Joseph Myers  <joseph@codesourcery.com>
3174
3175         * gfortran.texi: Include gpl_v3.texi instead of gpl.texi
3176         * Make-lang.in (GFORTRAN_TEXI): Include gpl_v3.texi instead of
3177         gpl.texi.
3178
3179 2008-03-30  Paul Thomas  <pault@gcc.gnu.org>
3180
3181         PR fortran/35740
3182         * resolve.c (resolve_function, resolve_call): If the procedure
3183         is elemental do not look for noncopying intrinsics.
3184
3185 2008-03-29  Paul Thomas  <pault@gcc.gnu.org>
3186
3187         PR fortran/35698
3188         * trans-array.c (gfc_array_init_size): Set 'size' zero if
3189         negative in one dimension.
3190
3191         PR fortran/35702
3192         * trans-expr.c (gfc_trans_string_copy): Only assign a char
3193         directly if the lhs and rhs types are the same.
3194
3195 2008-03-28  Daniel Franke  <franke.daniel@gmail.com>
3196             Paul Richard Thomas <paul.richard.thomas@gmail.com>
3197
3198         PR fortran/34714
3199         * primary.c (match_variable): Improved matching of function 
3200         result variables.
3201         * resolve.c (resolve_allocate_deallocate): Removed checks if
3202         the actual argument for STAT is a variable.
3203
3204 2008-03-28  Tobias Burnus  <burnus@net-b.de>
3205
3206         * symbol.c (gfc_get_default_type): Fix error message; option
3207         -fallow_leading_underscore should be -fallow-leading-underscore
3208
3209 2008-03-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3210
3211         PR fortran/35724
3212         * iresolve.c (gfc_resolve_cshift): Check for NULL symtree in test for
3213         optional argument attribute.
3214
3215 2008-03-27  Tom Tromey  <tromey@redhat.com>
3216
3217         * Make-lang.in: Revert automatic dependency patch.
3218
3219 2008-03-25  Tom Tromey  <tromey@redhat.com>
3220
3221         * Make-lang.in: Remove .o targets.
3222         (fortran_OBJS): New variable.
3223         (fortran/gfortranspec.o): Move to fortran/.  Reduce to variable
3224         setting.
3225         (GFORTRAN_D_OBJS): Update.
3226         (GFORTRAN_TRANS_DEPS): Remove.
3227
3228 2008-03-24  Paul Thomas  <pault@gcc.gnu.org>
3229
3230         PR fortran/34813
3231         * resolve.c (resolve_structure_cons): It is an error to assign
3232         NULL to anything other than a pointer or allocatable component.
3233
3234         PR fortran/33295
3235         * resolve.c (resolve_symbol): If the symbol is a derived type,
3236         resolve the derived type.  If the symbol is a derived type
3237         function, ensure that the derived type is visible in the same
3238         namespace as the function.
3239
3240 2008-03-23  Tobias Schlüter  <tobi@gcc.gnu.org>
3241
3242         * trans.h: Use fold_build in build1_v, build2_v and build3_v
3243         macros.
3244         * trans-openmp.c (gfc_trans_omp_critical, gfc_trans_omp_single):
3245         Don't use build2_v macro.
3246
3247 2008-03-19  Daniel Franke  <franke.daniel@gmail.com>
3248
3249         PR fortran/35152
3250         * interface.c (gfc_procedure_use): Check for keyworded arguments in
3251         procedures without explicit interfaces.
3252
3253 2008-03-16  Paul Thomas  <pault@gcc.gnu.org>
3254
3255         PR fortran/35470
3256         * resolve.c (check_assumed_size_reference):  Only visit the
3257         first reference and look directly at the highest dimension.
3258
3259 2008-03-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3260
3261         PR fortran/35184
3262         * trans-array.c (gfc_conv_array_index_offset): Remove unnecessary
3263         assert.
3264
3265 2008-03-15  Daniel Franke  <franke.daniel@gmail.com>
3266
3267         PR fortran/35584
3268         * resolve.c (resolve_branch): Less strict and pessimistic warning
3269         message.
3270
3271 2008-03-11  Paolo Bonzini  <bonzini@gnu.org>
3272
3273         * f95-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
3274         (gfc_be_parse_file): Call clear_binding_stack from here.
3275         (gfc_clear_binding_stack): Rename to clear_binding_stack.
3276                 
3277 2008-03-09  Paul Thomas  <pault@gcc.gnu.org>
3278
3279         PR fortran/35474
3280         * module.c (mio_symtree_ref): After providing a symbol for a
3281         missing equivalence member, resolve and NULL the fixups.
3282
3283 2008-03-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3284
3285         * invoke.texi (Error and Warning Options): Document
3286         -Wline-truncation.
3287
3288 2008-03-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3289
3290         PR fortran/34956
3291         * trans-array.c (gfc_conv_ss_startstride): Fix the logic to avoid
3292         checking bounds of absent optional arguments.
3293
3294 2008-03-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3295
3296         PR fortran/33197
3297         * intrinsic.c (add_functions): Add simplification routines for
3298         ERF, DERF, ERFC and DERFC.
3299         * decl.c (gfc_match_suffix, gfc_match_subroutine): Change GNU
3300         extensions into Fortran 2008 features.
3301         * intrinsic.h (gfc_simplify_erf, gfc_simplify_erfc): New
3302         prototypes.
3303         * simplify.c (gfc_simplify_erf, gfc_simplify_erfc): New functions.
3304
3305 2008-03-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3306
3307         PR fortran/33197
3308         * intrinsic.c (add_functions): Modify intrinsics ACOSH, ASINH,
3309         ATANH, ERF, ERFC and GAMMA. Add intrinsics BESSEL_{J,Y}{0,1,N},
3310         ERFC_SCALED, LOG_GAMMA and HYPOT.
3311         * intrinsic.h (gfc_check_hypot, gfc_simplify_hypot,
3312         gfc_resolve_hypot): New prototypes.
3313         * mathbuiltins.def: Add HYPOT builtin. Make complex versions of
3314         ACOSH, ASINH and ATANH available.
3315         * gfortran.h (GFC_ISYM_ERFC_SCALED, GFC_ISYM_HYPOT): New values.
3316         * lang.opt: Add -std=f2008 option.
3317         * libgfortran.h: Define GFC_STD_F2008.
3318         * lang-specs.h: Add .f08 and .F08 file suffixes.
3319         * iresolve.c (gfc_resolve_hypot): New function.
3320         * parse.c (parse_contained): Allow empty CONTAINS for Fortran 2008.
3321         * check.c (gfc_check_hypot): New function.
3322         * trans-intrinsic.c (gfc_intrinsic_map): Define ERFC_SCALE builtin.
3323         * options.c (set_default_std_flags): Allow Fortran 2008 by default.
3324         (form_from_filename): Add .f08 suffix.
3325         (gfc_handle_option): Handle -std=f2008 option.
3326         * simplify.c (gfc_simplify_hypot): New function.
3327         * gfortran.texi: Document Fortran 2008 status and file extensions.
3328         * intrinsic.texi: Document new BESSEL_{J,Y}{0,1,N} intrinsics,
3329         as well as HYPOT and ERFC_SCALED. Update documentation of ERF,
3330         ERFC, GAMMA, LGAMMA, ASINH, ACOSH and ATANH.
3331         * invoke.texi: Document the new -std=f2008 option.
3332
3333 2008-03-02  Jakub Jelinek  <jakub@redhat.com>
3334
3335         * gfortranspec.c (lang_specific_driver): Update copyright notice
3336         dates.
3337
3338 2008-02-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3339
3340         PR fortran/35059
3341         * expr.c (find_array_element): Modify traversing the constructor to
3342         avoid trying to access NULL memory pointed to by next for the
3343         last element. (find_array_section): Exit while loop if cons->next is
3344         NULL.
3345         * trans-expr.c (gfc_conv_scalar_char_value): Initialize gfc_typespec.
3346         (gfc_conv_function_call): Same.
3347         * decl.c (gfc_match_implicit): Same.
3348         * trans-intrinsic.c (gfc_conv_intrinsic_sr_kind): Same.
3349
3350 2008-02-28  Daniel Franke  <franke.daniel@gmail.com>
3351
3352         PR fortran/31463
3353         PR fortran/33950
3354         PR fortran/34296
3355         * lang.opt: Added -Wreturn-type.
3356         * options.c (gfc_handle_option): Recognize -Wreturn-type.
3357         * trans-decl.c (gfc_trans_deferred_vars): Emit warnings for funtions
3358         where the result value is not set.
3359         (gfc_generate_function_code): Likewise.
3360         (generate_local_decl): Emit warnings for funtions whose RESULT
3361         variable is not set.
3362
3363 2008-02-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3364
3365         PR fortran/34868
3366         * trans-expr.c (gfc_conv_variable): Don't build indirect
3367         references when explicit interface is mandated.
3368         * resolve.c (resolve_formal_arglist): Set attr.always_explicit
3369         on the result symbol as well as the procedure symbol.
3370
3371 2008-02-27  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3372
3373         PR fortran/33387
3374         * trans.h: Remove prototypes for gfor_fndecl_math_exponent4,
3375         gfor_fndecl_math_exponent8, gfor_fndecl_math_exponent10 and
3376         gfor_fndecl_math_exponent16.
3377         * f95-lang.c (build_builtin_fntypes): Add new function types.
3378         (gfc_init_builtin_functions): Add new builtins for nextafter,
3379         frexp, ldexp, fabs, scalbn and inf.
3380         * iresolve.c (gfc_resolve_rrspacing): Don't add hidden arguments.
3381         (gfc_resolve_scale): Don't convert type of second argument.
3382         (gfc_resolve_set_exponent): Likewise.
3383         (gfc_resolve_size): Don't add hidden arguments.
3384         * trans-decl.c: Remove gfor_fndecl_math_exponent4,
3385         gfor_fndecl_math_exponent8, gfor_fndecl_math_exponent10 and
3386         gfor_fndecl_math_exponent16.
3387         * trans-intrinsic.c (gfc_intrinsic_map): Remove intrinsics
3388         for scalbn, fraction, nearest, rrspacing, set_exponent and
3389         spacing.
3390         (gfc_conv_intrinsic_exponent): Directly call frexp.
3391         (gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_nearest,
3392         gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing,
3393         gfc_conv_intrinsic_scale, gfc_conv_intrinsic_set_exponent): New
3394         functions.
3395         (gfc_conv_intrinsic_function): Use the new functions above.
3396
3397 2008-02-26  Tobias Burnus  <burnus@net-b.de>
3398
3399         PR fortran/35033
3400         * interface.c (check_operator_interface): Show better line for error
3401         messages; fix constrains for user-defined assignment operators.
3402         (gfc_extend_assign): Fix constrains for user-defined assignment
3403         operators.
3404
3405 2008-02-26  Tom Tromey  <tromey@redhat.com>
3406
3407         * trans-io.c (set_error_locus): Remove old location code.
3408         * trans-decl.c (gfc_set_decl_location): Remove old location code.
3409         * f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
3410         * scanner.c (gfc_gobble_whitespace): Remove old location code.
3411         (get_file): Likewise.
3412         (preprocessor_line): Likewise.
3413         (load_file): Likewise.
3414         (gfc_new_file): Likewise.
3415         * trans.c (gfc_trans_runtime_check): Remove old location code.
3416         (gfc_get_backend_locus): Likewise.
3417         (gfc_set_backend_locus): Likewise.
3418         * data.c (gfc_assign_data_value): Remove old location code.
3419         * error.c (show_locus): Remove old location code.
3420         * gfortran.h (gfc_linebuf): Remove old location code.
3421         (gfc_linebuf_linenum): Remove old-location variant.
3422
3423 2008-02-25  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3424
3425         PR fortran/34729
3426         * trans-const.c (gfc_build_string_const): Don't call gettext.
3427         (gfc_build_localized_string_const): New function.
3428         * trans-const.h (gfc_build_localized_string_const): New prototype.
3429         * trans.c (gfc_trans_runtime_check): Use
3430         gfc_build_localized_string_const instead of gfc_build_string_const.
3431         (gfc_call_malloc): Likewise.
3432         (gfc_allocate_with_status): Likewise.
3433         (gfc_allocate_array_with_status): Likewise.
3434         (gfc_deallocate_with_status): Likewise.
3435         (gfc_call_realloc): Likewise.
3436         * trans-io.c (gfc_trans_io_runtime_check): Likewise.
3437
3438 2008-02-24  Tobias Schlüter  <tobi@gcc.gnu.org>
3439
3440         * arith.c: Update copyright years.
3441         * arith.h: Likewise.
3442         * array.c: Likewise.
3443         * bbt.c: Likewise.
3444         * check.c: Likewise.
3445         * data.c: Likewise.
3446         * data.h: Likewise.
3447         * decl.c: Likewise.
3448         * dependency.c: Likewise.
3449         * dependency.h: Likewise.
3450         * dump-parse-tree.c: Likewise.
3451         * error.c: Likewise.
3452         * expr.c: Likewise.
3453         * gfc-internals.texi: Likewise.
3454         * gfortran.h: Likewise.
3455         * gfortran.texi: Likewise.
3456         * gfortranspec.c: Likewise.
3457         * interface.c: Likewise.
3458         * intrinsic.c: Likewise.
3459         * intrinsic.h: Likewise.
3460         * intrinsic.texi: Likewise.
3461         * invoke.texi: Likewise.
3462         * io.c: Likewise.
3463         * iresolve.c: Likewise.
3464         * iso-c-binding.def: Likewise.
3465         * iso-fortran-env.def: Likewise.
3466         * lang-specs.h: Likewise.
3467         * lang.opt: Likewise.
3468         * libgfortran.h: Likewise.
3469         * match.c: Likewise.
3470         * match.h: Likewise.
3471         * matchexp.c: Likewise.
3472         * misc.c: Likewise.
3473         * module.c: Likewise.
3474         * openmp.c: Likewise.
3475         * options.c: Likewise.
3476         * parse.c: Likewise.
3477         * parse.h: Likewise.
3478         * primary.c: Likewise.
3479         * resolve.c: Likewise.
3480         * scanner.c: Likewise.
3481         * simplify.c: Likewise.
3482         * st.c: Likewise.
3483         * symbol.c: Likewise.
3484         * target-memory.c: Likewise.
3485         * target-memory.h: Likewise.
3486         * trans-array.h: Likewise.
3487         * trans-const.h: Likewise.
3488         * trans-stmt.h: Likewise.
3489         * trans-types.c: Likewise.
3490         * trans-types.h: Likewise.
3491         * types.def: Likewise.
3492
3493 2008-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3494
3495         PR fortran/35223
3496         * simplify.c (gfc_simplify_ibclr), (gfc_simplify_ibits),
3497         (gfc_simplify_ibset): Remove call to range_check.
3498         (simplify_cmplx), (gfc_simplify_dble), (gfc_simplify_float)
3499         (gfc_simplify_real): Add call gfc_clear_ts to initialize the
3500         temporary gfc_typspec variable.
3501
3502 2008-02-24  Tobias Schlüter  <tobi@gcc.gnu.org>
3503
3504         * trans-array.c (gfc_conv_descriptor_data_get,
3505         gfc_conv_descriptor_data_set_internal,
3506         gfc_conv_descriptor_data_addr, gfc_conv_descriptor_offset,
3507         gfc_conv_descriptor_dtype, gfc_conv_descriptor_dimension,
3508         gfc_conv_descriptor_stride, gfc_conv_descriptor_lbound,
3509         gfc_conv_descriptor_ubound, gfc_trans_create_temp_array,
3510         gfc_conv_array_transpose, gfc_grow_array,
3511         gfc_trans_array_constructor_subarray,
3512         gfc_trans_array_constructor_value, gfc_trans_scalarized_loop_end,
3513         gfc_array_init_size, gfc_array_allocate, gfc_array_deallocate,
3514         gfc_conv_array_initializer, gfc_trans_array_bounds,
3515         gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
3516         gfc_get_dataptr_offset, gfc_conv_array_parameter,
3517         gfc_trans_dealloc_allocated, get_full_array_size,
3518         gfc_duplicate_allocatable, structure_alloc_comps): Use fold_buildN
3519         instead of buildN.
3520         * trans-expr.c (gfc_conv_expr_present, gfc_conv_missing_dummy,
3521         gfc_conv_component_ref, gfc_conv_cst_int_power,
3522         gfc_conv_function_call, gfc_trans_structur_assign): Likewise.
3523         * trans-common.c (create_common): Likewise.
3524         * trans-openmp.c (gfc_trans_omp_atomic, gfc_trans_omp_do):
3525         Likewise.
3526         * trans-const.c (gfc_conv_constant_to_tree): Likewise.
3527         * trans-stmt.c (gfc_trans_goto, gfc_trans_return, gfc_trans_do,
3528         gfc_trans_integer_select, gfc_trans_character_select,
3529         gfc_trans_forall_loop, compute_overall_iter_number,
3530         gfc_trans_forall_1, gfc_evaluate_where_mask, gfc_trans_allocate,
3531         gfc_trans_deallocate): Likewise.
3532         * trans.c (gfc_build_addr_expr, gfc_trans_runtime_check,
3533         gfc_allocate_with_status, gfc_allocate_array_with_status,
3534         gfc_deallocate_with_status): Likewise.
3535         * f95-lang.c (gfc_truthvalue_conversion): Likewise.
3536         * trans-io.c (set_parameter_const, set_parameter_value,
3537         set_parameter_ref, set_string, set_internal_unit, io_result,
3538         set_error_locus, nml_get_addr_expr, transfer_expr): Likewise.
3539         * trans-decl.c (gfc_build_qualified_array, build_entry_thunks,
3540         gfc_get_fake_result_decl, gfc_trans_auto_character_variable,
3541         gfc_generate_function_code): Likewise.
3542         * convert.c (convert): Likewise.
3543         * trans-intrinsic.c (gfc_conv_intrinsic_conversion,
3544         build_fixbound_expr, build_fix_expr, gfc_conv_intrinsic_aint,
3545         gfc_conv_intrinsic_int, gfc_conv_intrinsic_imagpart,
3546         gfc_conv_intrinsic_conjg, gfc_conv_intrinsic_abs,
3547         gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_mod,
3548         gfc_conv_intrinsic_dim, gfc_conv_intrinsic_dprod,
3549         gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate,
3550         gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax,
3551         gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_count,
3552         gfc_conv_intrinsic_arith, gfc_conv_intrinsic_dot_product,
3553         gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval,
3554         gfc_conv_intrinsic_btest, gfc_conv_intrinsic_not,
3555         gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_ishft,
3556         gfc_conv_intrinsic_ichar, gfc_conv_intrinsic_size,
3557         gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer,
3558         gfc_conv_allocated, gfc_conv_associated, gfc_conv_intrinsic_trim,
3559         gfc_conv_intrinsic_repeat): Likewise.
3560
3561 2008-02-23  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3562
3563         PR target/25477
3564         * trans-expr.c (gfc_conv_power_op): Use BUILT_IN_CPOW{F,,L}.
3565         * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_CPOW{F,,L}.
3566         * trans.h (gfor_fndecl_math_cpow, gfor_fndecl_math_cpowf,
3567         gfor_fndecl_math_cpowl10, gfor_fndecl_math_cpowl16): Remove.
3568         * trans-decl.c: Likewise.
3569
3570 2008-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3571
3572         PR fortran/35059
3573         * expr.c (find_array_element): Modify traversing the constructor to
3574         avoid trying to access NULL memory pointed to by next for the
3575         last element. (find_array_section): Exit while loop if cons->next is
3576         NULL.
3577
3578 2008-02-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3579
3580         PR fortran/34907
3581         * iresolve.c (resolve_mask_arg): Add gfc_clear_ts to initialize
3582         structure.
3583         (gfc_resolve_aint): Likewise.
3584         (gfc_resolve_anint): Likewise.
3585         (gfc_resolve_besn): Likewise.
3586         (gfc_resolve_cshift): Likewise.
3587         (gfc_resolve_ctime): Likewise.
3588         (gfc_resolve_eoshift): Likewise.
3589         (gfc_resolve_index_func): Likewise.
3590         (gfc_resolve_isatty): Likewise.
3591         (gfc_resolve_malloc): Likewise.
3592         (gfc_resolve_rrspacing): Likewise.
3593         (gfc_resolve_scale): Likewise.
3594         (gfc_resolve_set_exponent): Likewise.
3595         (gfc_resolve_spacing): Likewise.
3596         (gfc_resolve_spacing): Likewise.
3597         (gfc_resolve_fgetc): Likewise.
3598         (gfc_resolve_fputc): Likewise.
3599         (gfc_resolve_ftell): Likewise.
3600         (gfc_resolve_ttynam): Likewise.
3601         (gfc_resolve_alarm_sub): Likewise.
3602         (gfc_resolve_mvbits): Likewise.
3603         (gfc_resolve_getarg): Likewise.
3604         (gfc_resolve_signal_sub): Likewise.
3605         (gfc_resolve_exit): Likewise.
3606         (gfc_resolve_flush): Likewise.
3607         (gfc_resolve_free): Likewise.
3608         (gfc_resolve_ctime_sub): Likewise.
3609         (gfc_resolve_fgetc_sub): Likewise.
3610         (gfc_resolve_fputc_sub): Likewise.
3611         (gfc_resolve_fseek_sub): Likewise.
3612         (gfc_resolve_ftell_sub): Likewise.
3613         (gfc_resolve_ttynam_sub): Likewise.
3614
3615 2008-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3616
3617         * gfc-internals.texi: Fix typos and markup nits.
3618         * gfortran.texi: Likewise.
3619         * intrinsic.texi: Likewise.
3620
3621 2008-02-21  Richard Guenther  <rguenther@suse.de>
3622
3623         * trans-expr.c (gfc_conv_expr_op): Expand INTRINSIC_PARENTHESES
3624         as unary PAREN_EXPR for real and complex typed expressions.
3625         (gfc_conv_unary_op): Fold the built tree.
3626
3627 2008-02-20  Tobias Burnus  <burnus@net-b.de>
3628
3629         PR fortran/34997
3630         * match.c (gfc_match_name): Improve error message for '$'.
3631
3632 2008-02-19  Daniel Franke  <franke.daniel@gmail.com>
3633
3634         PR fortran/35030
3635         * expr.c (gfc_check_pointer_assign): Add type and kind information
3636         to type-mismatch message.
3637         (gfc_check_assign): Unify error messages.
3638
3639 2008-02-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3640
3641         PR fortran/34952
3642         * gfortran.texi: Create new section for unimplemented extensions.
3643         Add "STRUCTURE and RECORD" and "ENCODE and DECODE statements".
3644         Remove "smaller projects" list. Fix a few typos.
3645
3646 2008-02-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3647
3648         * intrinsic.texi: Rename INDEX node to avoid clashing with
3649         index.html on case-insensitive systems.
3650
3651 2008-02-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3652
3653         PR fortran/35150
3654         * trans-expr.c (gfc_conv_function_call): Force evaluation of
3655         se->expr.
3656
3657 2008-02-10  Daniel Franke  <franke.daniel@gmail.com>
3658
3659         PR fortran/35019
3660         * lang.opt: Allow '-J<dir>' next to '-J <dir>', 
3661         likewise '-I <dir>' and '-I<dir>'.
3662
3663 2008-02-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3664
3665         PR other/35107
3666         * Make-lang.in (f951): Add $(GMPLIBS).
3667
3668 2008-02-05  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3669
3670         PR fortran/35037
3671         * trans-common.c (build_field): Mark fields as volatile when needed.
3672
3673 2008-02-05  Tobias Burnus  <burnus@net-b.de>
3674
3675         PR fortran/35093
3676         * data.c (gfc_assign_data_value): Only free "size" if
3677         it has not already been freed.
3678
3679 2008-02-05  Paul Thomas  <pault@gcc.gnu.org>
3680
3681         PR fortran/34945
3682         * array.c (match_array_element_spec): Remove check for negative
3683         array size.
3684         (gfc_resolve_array_spec): Add check for negative size.
3685
3686 2008-02-05  Paul Thomas  <pault@gcc.gnu.org>
3687
3688         PR fortran/32315
3689         * data.c (gfc_assign_data_value): Add bounds check for array
3690         references.
3691
3692 2008-02-04  Daniel Franke  <franke.daniel@gmail.com>
3693
3694         * resolve.c (resolve_where): Fix typo.
3695         (gfc_resolve_where_code_in_forall): Likewise.
3696
3697 2008-02-03  Paul Thomas  <pault@gcc.gnu.org>
3698
3699         PR fortran/32760
3700         * resolve.c (resolve_allocate_deallocate): New function.
3701         (resolve_code): Call it for allocate and deallocate.
3702         * match.c (gfc_match_allocate, gfc_match_deallocate) : Remove
3703         the checking of the STAT tag and put in above new function.
3704         * primary,c (match_variable): Do not fix flavor of host
3705         associated symbols yet if the type is not known.
3706
3707 2008-01-31  Paul Thomas  <pault@gcc.gnu.org>
3708
3709         PR fortran/34910
3710         * expr.c (gfc_check_assign): It is an error to assign
3711         to a sibling procedure.
3712
3713 2008-01-30  Paul Thomas  <pault@gcc.gnu.org>
3714
3715         PR fortran/34975
3716         * symbol.c (gfc_delete_symtree, gfc_undo_symbols): Rename
3717         delete_symtree to gfc_delete_symtree.
3718         * gfortran.h : Add prototype for gfc_delete_symtree.
3719         * module.c (load_generic_interfaces): Transfer symbol to a
3720         unique symtree and delete old symtree, instead of renaming.
3721         (read_module): The rsym and the found symbol are the same, so
3722         the found symtree can be deleted.
3723
3724         PR fortran/34429
3725         * decl.c (match_char_spec): Remove the constraint on deferred
3726         matching of functions and free the length expression.
3727         delete_symtree to gfc_delete_symtree.
3728         (gfc_match_type_spec): Whitespace.
3729         (gfc_match_function_decl): Defer characteristic association for
3730         all types except BT_UNKNOWN.
3731         * parse.c (decode_specification_statement): Only derived type
3732         function matching is delayed to the end of specification.
3733
3734 2008-01-28  Tobias Burnus  <burnus@net-b.de>
3735
3736         PR libfortran/34980
3737         * simplify.c (gfc_simplify_shape): Simplify rank zero arrays.
3738
3739 2008-01-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3740
3741         PR fortran/34990
3742         * array.c (gfc_check_constructor_type): Revert clearing the expression.
3743
3744 2008-01-26  Tobias Burnus  <burnus@net-b.de>
3745
3746         PR fortran/34848
3747         * trans-expr.c (gfc_conv_function_call): Don't call
3748         gfc_add_interface_mapping if the expression is NULL.
3749
3750 2008-01-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3751
3752         PR fortran/31610
3753         * trans-array.c (gfc_trans_create_temp_array): Remove call to
3754         gcc_assert (integer_zerop (loop->from[n])).
3755
3756 2008-01-25  Daniel Franke  <franke.daniel@gmail.com>
3757
3758         PR fortran/34661
3759         * resolve.c (resolve_where): Added check if user-defined assignment 
3760         operator is an elemental subroutine.
3761         (gfc_resolve_where_code_in_forall): Likewise.
3762
3763 2008-01-24  Daniel Franke  <franke.daniel@gmail.com>
3764
3765         PR fortran/33375
3766         PR fortran/34858
3767         * gfortran.h: Revert changes from 2008-01-17.
3768         * match.c: Likewise.
3769         * symbol.c: Likewise.
3770         (gfc_undo_symbols): Undo namespace changes related to common blocks.
3771
3772 2008-01-24  Daniel Franke  <franke.daniel@gmail.com>
3773
3774         PR fortran/34202
3775         * data.c (formalize_structure_cons): Skip formalization on
3776         empty structures.
3777
3778 2008-01-24  Daniel Franke  <franke.daniel@gmail.com>
3779
3780         * gfortran.texi (OpenMP): Extended existing documentation.
3781         (contributors): Added major contributors of 2008 that were
3782         not listed yet.
3783         (proposed extensions): Removed implemented items.
3784
3785 2008-01-24  Paul Thomas  <pault@gcc.gnu.org>
3786
3787         PR fortran/34872
3788         * parse.c (next_statement) : If ST_GET_FCN_CHARACTERISTICS  is
3789         seen, check for a statement label and, if present, delete it
3790         and set the locus to the start of the statement.
3791
3792 2008-01-22  Paul Thomas  <pault@gcc.gnu.org>
3793
3794         PR fortran/34875
3795         * trans-io.c (gfc_trans_transfer): If the array reference in a
3796         read has a vector subscript, use gfc_conv_subref_array_arg to
3797         copy back the temporary.
3798
3799 2008-01-22  Tobias Burnus  <burnus@net-b.de>
3800
3801         PR fortran/34848
3802         * interface.c (compare_actual_formal): Fix adding type
3803         to missing_arg_type for absent optional arguments.
3804
3805 2008-01-22  Tobias Burnus  <burnus@net-b.de>
3806
3807         PR fortran/34907
3808         * parse.c (parse_spec): Change = into ==.
3809
3810 2008-01-22  Daniel Franke  <franke.daniel@gmail.com>
3811
3812         PR fortran/34915
3813         * expr.c (check_elemental): Fix check for valid data types.
3814
3815 2008-01-22  Tobias Burnus  <burnus@net-b.de>
3816
3817         PR fortran/34899
3818         * scanner.c (load_line): Support <tab><digit> continuation lines.
3819         * invoke.texi (-Wtabs): Document this.
3820
3821 2008-01-22  Paul Thomas  <pault@gcc.gnu.org>
3822
3823         PR fortran/34896
3824         * module.c (read_module): Set use_rename attribute.
3825
3826 2007-01-21  Tobias Burnus  <burnus@net-b.de>
3827
3828         PR fortran/34901
3829         * interface.c (compare_parameter): Improved error message
3830         for arguments of same type and mismatched kinds.
3831
3832 2008-01-20  Paul Thomas  <pault@gcc.gnu.org>
3833
3834         PR fortran/34861
3835         * resolve.c (resolve_entries): Do not do an array bounds check
3836         if the result symbols are the same.
3837
3838         PR fortran/34854
3839         * module.c (read_module) : Hide the symtree of the previous
3840         version of the symbol if this symbol is renamed.
3841
3842 2008-01-20  Paul Thomas  <pault@gcc.gnu.org>
3843
3844         PR fortran/34784
3845         * array.c (gfc_check_constructor_type): Clear the expression ts
3846         so that the checking starts from the deepest level of array
3847         constructor.
3848         * primary.c (match_varspec): If an unknown type is changed to
3849         default character and the attempt to match a substring fails,
3850         change it back to unknown.
3851
3852         PR fortran/34785
3853         * trans-array.c (gfc_add_loop_ss_code) : If ss->string_length is
3854         NULL for an array constructor, use the cl.length expression to
3855         build it.
3856         (gfc_conv_array_parameter): Change call to gfc_evaluate_now to
3857         a tree assignment.
3858
3859 2008-01-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
3860
3861         PR fortran/34817
3862         PR fortran/34838
3863         * iresolve.c (gfc_resolve_all):  Remove conversion of mask
3864         argument to kind=1 by removing call to resolve_mask_arg().
3865         (gfc_resolve_any):  Likewise.
3866
3867 2008-01-19  Tobias Burnus  <burnus@net-b.de>
3868
3869         PR fortran/34760
3870         * primary.c (match_variable): Handle FL_UNKNOWN without
3871         uneducated guessing.
3872         (match_variable): Improve error message.
3873
3874 2008-01-18  Tobias Burnus  <burnus@net-b.de>
3875
3876         PR fortran/32616
3877         * interface.c (get_expr_storage_size): Return storage size
3878         for array element designators.
3879         (compare_actual_formal): Reject unequal string sizes for
3880         assumed-shape dummy arguments. And fix error message for
3881         array-sections with vector subscripts.
3882
3883 2008-01-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3884
3885         PR fortran/34556
3886         * simplify.c (is_constant_array_expr): New static function that returns
3887         true if the given expression is an array and is constant.
3888         (gfc_simplify_reshape): Use new function.
3889
3890 2008-01-17  H.J. Lu  <hongjiu.lu@intel.com>
3891
3892         PR fortran/33375
3893         * symbol.c (free_common_tree): Renamed to ...
3894         (gfc_free_common_tree): This.  Remove static.
3895         (gfc_free_namespace): Updated.
3896
3897         * gfortran.h (gfc_free_common_tree): New.
3898
3899         * match.c (gfc_match_common): Call gfc_free_common_tree () with
3900         gfc_current_ns->common_root and set gfc_current_ns->common_root
3901         to NULL on syntax error.
3902
3903 2008-01-18  Richard Sandiford  <rsandifo@nildram.co.uk>
3904
3905         PR fortran/34686
3906         * trans-expr.c (gfc_conv_function_call): Use proper
3907         type for returned character pointers.
3908
3909 2008-01-17  Paul Thomas  <pault@gcc.gnu.org>
3910
3911         PR fortran/34429
3912         PR fortran/34431
3913         PR fortran/34471
3914         * decl.c : Remove gfc_function_kind_locus and
3915         gfc_function_type_locus. Add gfc_matching_function.
3916         (match_char_length): If matching a function and the length
3917         does not match, return MATCH_YES and try again later.
3918         (gfc_match_kind_spec): The same.
3919         (match_char_kind): The same.
3920         (gfc_match_type_spec): The same for numeric and derived types.
3921         (match_prefix): Rename as gfc_match_prefix.
3922         (gfc_match_function_decl): Except for function valued character
3923         lengths, defer applying kind, type and charlen info until the
3924         end of specification block.
3925         gfortran.h (gfc_statement): Add ST_GET_FCN_CHARACTERISTICS.
3926         parse.c (decode_specification_statement): New function.
3927         (decode_statement): Call it when a function has kind = -1. Set
3928         and reset gfc_matching function, as function statement is being
3929         matched.
3930         (match_deferred_characteristics): Simplify with a single call
3931         to gfc_match_prefix. Do appropriate error handling. In any
3932         case, make sure that kind = -1 is reset or corrected.
3933         (parse_spec): Call above on seeing ST_GET_FCN_CHARACTERISTICS.
3934         Throw an error if kind = -1 after last specification statement.
3935         parse.h : Prototype for gfc_match_prefix.
3936
3937 2008-01-16  Tobias Burnus  <burnus@net-b.de>
3938
3939         PR fortran/34796
3940         * interface.c (compare_parameter): Allow AS_DEFERRED array
3941         elements and reject attr.pointer array elemenents.
3942         (get_expr_storage_size): Return storage size of elements of
3943         assumed-shape and pointer arrays.
3944
3945 2008-01-15  Sebastian Pop  <sebastian.pop@amd.com>
3946
3947         * f95-lang.c (gfc_init_builtin_functions): Initialize GOMP builtins
3948         for flag_tree_parallelize_loops.
3949
3950 2008-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
3951
3952         PR libfortran/34671
3953         * iresolve.c (gfc_resolve_all):  Call resolve_mask_arg.
3954         (gfc_resolve_any):  Likewise.
3955         (gfc_resolve_count):  Likewise.  Don't append kind of
3956         argument to function name.
3957
3958 2008-01-13  Tobias Burnus  <burnus@net-b.de>
3959
3960         PR fortran/34665
3961         * resolve.c (resolve_actual_arglist): For expressions,
3962         also check for assume-sized arrays.
3963         * interface.c (compare_parameter): Move F2003 character checks
3964         here, print error messages here, reject elements of
3965         assumed-shape array as argument to dummy arrays.
3966         (compare_actual_formal): Update for the changes above.
3967
3968 2008-01-13  Tobias Burnus  <burnus@net-b.de>
3969
3970         PR fortran/34763
3971         * decl.c (contained_procedure): Only check directly preceeding state.
3972
3973 2008-01-13  Tobias Burnus  <burnus@net-b.de>
3974
3975         PR fortran/34759
3976         * check.c (gfc_check_shape): Accept array ranges of
3977         assumed-size arrays.
3978
3979 2008-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3980
3981         PR fortran/34432
3982         * match.c (gfc_match_name): Don't error if leading character is a '(',
3983         just return MATCH_NO.
3984
3985 2008-01-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3986
3987         PR fortran/34722
3988         * trans-io.c (create_dummy_iostat): Commit the symbol.
3989
3990 2008-01-11  Paul Thomas  <pault@gcc.gnu.org>
3991
3992         PR fortran/34537
3993         * simplify.c (gfc_simplify_transfer): Return NULL if the size
3994         of the element is unavailable and only assign character length
3995         to the result, if 'mold' is constant.
3996
3997 2008-01-10  Paul Thomas  <pault@gcc.gnu.org>
3998
3999         PR fortran/34396
4000         * trans-array.c (gfc_trans_array_ctor_element):  Use gfc_trans_string_copy
4001         to assign strings and perform bounds checks on the string length.
4002         (get_array_ctor_strlen): Remove bounds checking.
4003         (gfc_trans_array_constructor): Initialize string length checking.
4004         * trans-array.h : Add prototype for gfc_trans_string_copy.
4005
4006 2008-01-08  Richard Guenther  <rguenther@suse.de>
4007
4008         PR fortran/34706
4009         PR tree-optimization/34683
4010         * trans-types.c (gfc_get_array_type_bounds): Use an array type
4011         with known size for accesses if that is known.
4012
4013 2008-01-08  Paul Thomas  <pault@gcc.gnu.org>
4014
4015         PR fortran/34476
4016         * expr.c (find_array_element): Check that the array bounds are
4017         constant before using them.  Use lower, as well as upper bound.
4018         (check_restricted): Allow implied index variable.
4019
4020 2008-01-08  Paul Thomas  <pault@gcc.gnu.org>
4021
4022         PR fortran/34681
4023         * trans_array.c (gfc_trans_deferred_array): Do not null the
4024         data pointer on entering scope, nor deallocate it on leaving
4025         scope, if the symbol has the 'save' attribute.
4026
4027         PR fortran/34704
4028         * trans_decl.c (gfc_finish_var_decl): Derived types with
4029         allocatable components and an initializer must be TREE_STATIC.
4030
4031 2008-01-07  Paul Thomas  <pault@gcc.gnu.org>
4032
4033         PR fortran/34672
4034         * module.c (write_generic): Rewrite completely.
4035         (write_module): Change call to write_generic.
4036
4037 2008-01-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4038
4039         PR fortran/34659
4040         * scanner.c (load_line): Do not count ' ' as printable when checking for
4041         continuations.
4042
4043 2008-01-06  Paul Thomas  <pault@gcc.gnu.org>
4044
4045         PR fortran/34545
4046         * module.c (load_needed): If the namespace has no proc_name
4047         give it the module symbol.
4048
4049 2008-01-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4050
4051         PR fortran/34387
4052         * trans-expr.c (gfc_conv_missing_dummy): Use a temporary to type convert
4053         the dummy variable expression, test for NULL, and pass the variable
4054         address to the called function.
4055
4056 2007-01-06  Tobias Burnus  <burnus@net-b.de>
4057
4058         PR fortran/34658
4059         * match.c (gfc_match_common): Remove blank common in
4060         DATA BLOCK warning.
4061         * resolve.c (resolve_common_vars): New function.
4062         (resolve_common_blocks): Move checks to resolve_common_vars
4063         and invoke that function.
4064         (resolve_types): Call resolve_common_vars for blank commons.
4065
4066 2008-01-06  Tobias Burnus  <burnus@net-b.de>
4067
4068         PR fortran/34655
4069         * resolve.c (resolve_equivalence_derived): Reject derived types with
4070         default initialization if equivalenced with COMMON variable.
4071
4072 2008-01-06  Tobias Burnus  <burnus@net-b.de>
4073
4074         PR fortran/34654
4075         * io.c (check_io_constraints): Disallow unformatted I/O for
4076         internal units.
4077
4078 2008-01-06  Tobias Burnus  <burnus@net-b.de>
4079
4080         PR fortran/34660
4081         * resolve.c (resolve_formal_arglist): Reject dummy procedure in
4082         ELEMENTAL functions.
4083
4084 2008-01-06  Tobias Burnus  <burnus@net-b.de>
4085
4086         PR fortran/34662
4087         * interface.c (compare_actual_formal): Reject parameter
4088         actual to intent(out) dummy.
4089
4090 2008-01-04  Tobias Burnus  <burnus@net-b.de>
4091
4092         PR fortran/34557
4093         * primary.c (match_varspec): Gobble whitespace before
4094         checking for '('.