OSDN Git Service

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