OSDN Git Service

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