OSDN Git Service

2009-11-03 Steven G. Kargl <kargl@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2009-11-05  Steven G. Kargl  <kargl@gcc.gnu.org>
2
3         PR fortran/41918
4         * fortran/trans-decl.c: Silence intent(out) warning for derived type
5         dummy arguments with default initialization.
6
7 2009-11-05  Janus Weil  <janus@gcc.gnu.org>
8
9         PR fortran/41556
10         * interface.c (matching_typebound_op,gfc_extend_assign): Handle CLASS
11         variables.
12
13 2009-11-05  Janus Weil  <janus@gcc.gnu.org>
14
15         PR fortran/41556
16         PR fortran/41873
17         * resolve.c (resolve_function,resolve_call): Prevent abstract interfaces
18         from being called, but allow deferred type-bound procedures with
19         abstract interface.
20
21 2009-11-04  Tobias Burnus <burnus@gcc.gnu.org>
22             Janus Weil  <janus@gcc.gnu.org>
23
24         PR fortran/41556
25         PR fortran/41937
26         * interface.c (gfc_check_operator_interface): Handle CLASS arguments.
27         * resolve.c (resolve_allocate_expr): Handle allocatable components of
28         CLASS variables.
29
30 2009-11-04  Richard Guenther  <rguenther@suse.de>
31
32         * options.c (gfc_post_options): Rely on common code processing
33         LTO options.  Only enable -fwhole-file here.
34
35 2009-11-03  Tobias Burnus  <burnus@net-b.de>
36
37         PR fortran/41907
38         * trans-expr.c (gfc_conv_procedure_call): Fix presence check
39         for optional arguments.
40
41 2009-11-01  Tobias Burnus  <burnus@net-b.de>
42
43         PR fortran/41872
44         * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
45         autodeallocated allocatable scalars at the end of scope.
46         (gfc_generate_function_code): Fix indention.
47         * trans-expr.c (gfc_conv_procedure_call): For allocatable
48         scalars, fix calling by reference and autodeallocating
49         of intent out variables.
50
51 2009-11-01  Tobias Burnus  <burnus@net-b.de>
52
53         PR fortran/41850
54         * trans-expr.c (gfc_conv_procedure_call): Deallocate intent-out
55         variables only when present. Remove unneccessary present check.
56
57 2009-10-29  Tobias Burnus  <burnus@net-b.de>
58
59         PR fortran/41777
60         * trans-expr.c (gfc_conv_procedure_call,gfc_conv_expr_reference):
61         Use for generic EXPR_FUNCTION the attributes of the specific
62         function.
63
64 2009-10-29  Janne Blomqvist  <jb@gcc.gnu.org>
65
66         PR fortran/41860
67         * resolve.c (apply_default_init_local): Treat -fno-automatic as if
68         var was saved.
69
70 2009-10-28  Rafael Avila de Espindola  <espindola@google.com>
71
72         * trans-common.c (create_common): Set TREE_PUBLIC to false on
73         fake variables.
74
75 2009-10-26  Janus Weil  <janus@gcc.gnu.org>
76
77         PR fortran/41714
78         * trans.c (gfc_trans_code): Remove call to
79         'tree_annotate_all_with_location'. Location should already be set.
80         * trans-openmp.c (gfc_trans_omp_workshare): Ditto.
81         * trans-stmt.c (gfc_trans_allocate): Do correct data initialization for
82         CLASS variables with SOURCE tag, plus some cleanup.
83
84 2009-10-24  Janus Weil  <janus@gcc.gnu.org>
85             Paul Thomas  <pault@gcc.gnu.org>
86
87         PR fortran/41784
88         * module.c (load_derived_extensions): Skip symbols which are not being
89         loaded.
90
91 2009-10-24  Paul Thomas  <pault@gcc.gnu.org>
92
93         PR fortran/41772
94         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Stop'extent'
95         from going negative.
96
97 2009-10-23  Janus Weil  <janus@gcc.gnu.org>
98
99         PR fortran/41800
100         * trans-expr.c (gfc_trans_scalar_assign): Handle CLASS variables.
101
102 2009-10-23  Janus Weil  <janus@gcc.gnu.org>
103
104         PR fortran/41758
105         * match.c (conformable_arrays): Move to resolve.c.
106         (gfc_match_allocate): Don't resolve SOURCE expr yet, and move some
107         checks to resolve_allocate_expr.
108         * resolve.c (conformable_arrays): Moved here from match.c.
109         (resolve_allocate_expr): Moved some checks here from gfc_match_allocate.
110         (resolve_code): Resolve SOURCE tag for ALLOCATE expressions.
111
112 2009-10-22  Janus Weil  <janus@gcc.gnu.org>
113
114         PR fortran/41781
115         * resolve.c (resolve_codes): Don't clear 'cs_base' for BLOCK constructs,
116         to make sure labels are treated correctly.
117         * symbol.c (gfc_get_st_label): Create labels in the right namespace.
118         For BLOCK constructs go into the parent namespace.
119
120 2009-10-21  Janus Weil  <janus@gcc.gnu.org>
121
122         PR fortran/41706
123         PR fortran/41766
124         * match.c (select_type_set_tmp): Set flavor for temporary.
125         * resolve.c (resolve_class_typebound_call): Correctly resolve actual
126         arguments.
127
128 2009-10-20  Paul Thomas  <pault@gcc.gnu.org>
129
130         PR fortran/41706
131         * resolve.c (resolve_arg_exprs): New function.
132         (resolve_class_compcall): Call the above.
133         (resolve_class_typebound_call): The same.
134
135 2009-10-19  Janus Weil  <janus@gcc.gnu.org>
136
137         PR fortran/41586
138         * parse.c (parse_derived): Correctly set 'alloc_comp' and 'pointer_comp'
139         for CLASS variables.
140         * trans-array.c (structure_alloc_comps): Handle deallocation and
141         nullification of allocatable scalar components.
142         * trans-decl.c (gfc_get_symbol_decl): Remember allocatable scalars for
143         automatic deallocation.
144         (gfc_trans_deferred_vars): Automatically deallocate allocatable scalars.
145
146 2009-10-19  Tobias Burnus  <burnus@net-b.de>
147             Steven G. Kargl  <kargl@gcc.gnu.org>
148
149         PR fortran/41755
150         * symbol.c (gfc_undo_symbols): Add NULL check.
151         * match.c (gfc_match_equivalence): Add check for
152         missing comma.
153
154 2009-10-19  Richard Guenther  <rguenther@suse.de>
155
156         PR fortran/41494
157         * trans-expr.c (gfc_trans_scalar_assign): Do not call
158         gfc_evaluate_now.
159
160 2009-10-17  Janus Weil  <janus@gcc.gnu.org>
161             Paul Thomas  <pault@gcc.gnu.org>
162
163         PR fortran/41608
164         * decl.c (gfc_match_data_decl): Add BT_CLASS for undefined type
165         and empty type errors.
166         * parse.c (gfc_build_block_ns): Only set recursive if parent ns
167         has a proc_name.
168
169         PR fortran/41629
170         PR fortran/41618
171         PR fortran/41587
172         * gfortran.h : Add class_ok bitfield to symbol_attr.
173         * decl.c (build_sym): Set attr.class_ok if dummy, pointer or
174         allocatable.
175         (build_struct): Use gfc_try 't' to carry errors past the call
176         to encapsulate_class_symbol.
177         (attr_decl1): For a CLASS object, apply the new attribute to
178         the data component.
179         * match.c (gfc_match_select_type): Set attr.class_ok for an
180         assigned selector.
181         * resolve.c (resolve_fl_variable_derived): Check a CLASS object
182         is dummy, pointer or allocatable by testing the class_ok and
183         the use_assoc attribute.
184
185 2009-10-16  Janus Weil  <janus@gcc.gnu.org>
186
187         PR fortran/41719
188         * resolve.c (resolve_ordinary_assign): Reject intrinsic assignments
189         to polymorphic variables.
190
191 2009-10-16  Paul Thomas  <pault@gcc.gnu.org>
192
193         PR fortran/41648
194         PR fortran/41656
195         * trans-expr.c (select_class_proc): Convert the expression for the
196         vindex, carried on the first member of the esym list.
197         * gfortran.h : Add the vindex field to the esym_list structure.
198         and eliminate the class_object field.
199         * resolve.c (check_class_members): Remove the setting of the
200         class_object field.
201         (vindex_expr): New function.
202         (get_class_from_expr): New function.
203         (resolve_class_compcall): Call the above to find the ultimate
204         class or derived component.  If derived, do not generate the
205         esym list.  Add and expression for the vindex to the esym list
206         by calling the above.
207         (resolve_class_typebound_call): The same.
208
209 2009-10-15  Steven G. Kargl  <kargl@gcc.gnu.org>
210
211         PR fortran/41712
212         * intrinsic.texi: Explicitly state that ETIME and DTIME take
213         REAL(4) arguments.  Fix nearby typographically errors where 
214         /leq was used instead of \leq.
215
216 2009-10-13  Janus Weil  <janus@gcc.gnu.org>
217
218         PR fortran/41581
219         * decl.c (encapsulate_class_symbol): Add new component '$size'.
220         * resolve.c (resolve_allocate_expr): Move CLASS handling to
221         gfc_trans_allocate.
222         (resolve_class_assign): Replaced by gfc_trans_class_assign.
223         (resolve_code): Remove calls to resolve_class_assign.
224         * trans.c (gfc_trans_code): Use new function gfc_trans_class_assign.
225         * trans-expr.c (get_proc_ptr_comp): Fix a memory leak.
226         (gfc_conv_procedure_call): For CLASS dummies, set the
227         $size component.
228         (gfc_trans_class_assign): New function, replacing resolve_class_assign.
229         * trans-stmt.h (gfc_trans_class_assign): New prototype.
230         * trans-stmt.c (gfc_trans_allocate): Use correct size when allocating
231         CLASS variables. Do proper initialization. Move some code here from
232         resolve_allocate_expr.
233
234 2009-10-11 Jerry DeLisle  <jvdelisle@gcc.gnu.org>
235
236         PR fortran/38439
237         * io.c (check_format): Fix locus for error messages and fix a comment.
238
239 2009-10-11  Paul Thomas  <pault@gcc.gnu.org>
240
241         PR fortran/41583
242         * decl.c (hash_value): New function.
243         (gfc_match_derived_decl): Call it.
244
245 2009-10-09  Janus Weil  <janus@gcc.gnu.org>
246
247         PR fortran/41585
248         * decl.c (build_struct): Bugfix for CLASS components.
249
250 2009-10-09  Tobias Burnus  <burnus@net-b.de>
251
252         PR fortran/41582
253         * decl.c (encapsulate_class_symbol): Save attr.abstract.
254         * resolve.c (resolve_allocate_expr): Reject class allocate
255         without typespec or source=.
256         * trans-stmt.c (gfc_trans_allocate): Change gfc_warning
257         into gfc_error for "not yet implemented".
258
259 2009-10-09  Janus Weil  <janus@gcc.gnu.org>
260
261         PR fortran/41579
262         * gfortran.h (gfc_select_type_stack): New struct, to be used as a stack
263         for SELECT TYPE statements.
264         (select_type_stack): New global variable.
265         (type_selector,select_type_tmp): Removed.
266         * match.c (type_selector,type_selector): Removed.
267         (select_type_stack): New variable, serving as a stack for
268         SELECT TYPE statements.
269         (select_type_push,select_type_set_tmp): New functions.
270         (gfc_match_select_type): Call select_type_push.
271         (gfc_match_type_is): Call select_type_set_tmp.
272         * parse.c (select_type_pop): New function.
273         (parse_select_type_block): Call select_type_pop.
274         * symbol.c (select_type_insert_tmp): New function.
275         (gfc_find_sym_tree): Call select_type_insert_tmp.
276
277 2009-10-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
278
279         * arith.c (arith_power): Use mpc_pow_z.
280         * gfortran.h (HAVE_mpc_pow_z): Define.
281
282 2009-10-07  Daniel Kraft  <d@domob.eu>
283
284         PR fortran/41615
285         * resolve.c (resolve_contained_fntype): Clarify error message for
286         invalid assumed-length character result on module procedures.
287
288 2009-10-07  Janus Weil  <janus@gcc.gnu.org>
289
290         * expr.c (gfc_check_pointer_assign): Do the correct type checking when
291         CLASS variables are involved.
292         * match.c (gfc_match_select_type): Parse associate-name in SELECT TYPE
293         statements, and set up a local namespace for the SELECT TYPE block.
294         * parse.h (gfc_build_block_ns): New prototype.
295         * parse.c (parse_select_type_block): Return from local namespace to its
296         parent after SELECT TYPE block.
297         (gfc_build_block_ns): New function for setting up the local namespace
298         for a BLOCK construct.
299         (parse_block_construct): Use gfc_build_block_ns.
300         * resolve.c (resolve_select_type): Insert assignment for the selector
301         variable, in case an associate-name is given, and put the SELECT TYPE
302         statement inside a BLOCK.
303         (resolve_code): Call resolve_class_assign after checking the assignment.
304         * symbol.c (gfc_find_sym_tree): Moved some code here from
305         gfc_get_ha_sym_tree.
306         (gfc_get_ha_sym_tree): Moved some code to gfc_find_sym_tree.
307
308 2009-10-07  Paul Thomas <pault@gcc.gnu.org>
309
310         PR fortran/41613
311         * resolve.c (check_class_members): Reset compcall.assign.
312
313 2009-10-05  Paul Thomas  <pault@gcc.gnu.org>
314
315         * trans-expr.c (select_class_proc): New function.
316         (conv_function_val): Deal with class methods and call above.
317         * symbol.c (gfc_type_compatible): Treat case where both ts1 and
318         ts2 are BT_CLASS.
319         gfortran.h : Add structure gfc_class_esym_list and include in
320         the structure gfc_expr.
321         * module.c (load_derived_extensions): New function.
322         (read_module): Call above.
323         (write_dt_extensions): New function.
324         (write_derived_extensions): New function.
325         (write_module): Use the above.
326         * resolve.c (resolve_typebound_call): Add a function expression
327         for class methods.  This carries the chain of symbols for the
328         dynamic dispatch in select_class_proc.
329         (resolve_compcall): Add second, boolean argument to indicate if
330         a function is being handled.
331         (check_members): New function.
332         (check_class_members): New function.
333         (resolve_class_compcall): New function.
334         (resolve_class_typebound_call): New function.
335         (gfc_resolve_expr): Call above for component calls.. 
336
337 2009-10-05  Daniel Kraft  <d@domob.eu>
338
339         PR fortran/41403
340         * trans-stmt.c (gfc_trans_goto): Ignore statement list on assigned goto
341         if it is present.
342
343 2009-10-03  Richard Guenther  <rguenther@suse.de>
344
345         * options.c (gfc_post_options): Handle -flto and -fwhopr.
346
347 2009-10-02  Tobias Burnus  <burnus@net-b.de>
348
349         PR fortran/41479
350         * trans-decl.c (gfc_init_default_dt): Check for presence of
351         the argument only if it is optional or in entry master.
352         (init_intent_out_dt): Ditto; call gfc_init_default_dt
353         for all derived types with initializers.
354
355 2009-10-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
356
357         PR fortran/33197
358         * gfortran.h (HAVE_mpc_arc): Define.
359         * simplify.c (gfc_simplify_acos): Handle complex acos.
360         (gfc_simplify_acosh): Likewise for acosh.
361         (gfc_simplify_asin): Likewise for asin.
362         (gfc_simplify_asinh): Likewise for asinh.
363         (gfc_simplify_atan): Likewise for atan.
364         (gfc_simplify_atanh): Likewise for atanh.
365
366 2009-10-01  Tobias Burnus  <burnus@net-b.de>
367
368         PR fortran/41515
369         * decl.c (do_parm): Call add_init_expr_to_sym.
370
371 2009-09-30  Dennis Wassel  <dennis.wassel@gmail.com>
372
373         * gcc/fortran/trans-array.c (gfc_trans_array_bound_check): Improved
374         bounds checking error messages. (gfc_conv_array_ref): Likewise.
375         (gfc_conv_ss_startstride): Likewise.
376
377 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
378
379         * resolve.c (check_typebound_baseobject): Don't check for
380         abstract types for CLASS.
381         (resolve_class_assign): Adapt for RHS being a CLASS.
382         * trans-intrinsic.c (gfc_conv_associated): Add component ref
383         if expr is a CLASS.
384
385 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
386
387         * check.c (gfc_check_same_type_as): New function for checking
388         SAME_TYPE_AS and EXTENDS_TYPE_OF.
389         * decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
390         container, if the contained type has it. Add an initializer for the
391         class container.
392         (add_init_expr_to_sym): Handle BT_CLASS.
393         (vindex_counter): New counter for setting vindices.
394         (gfc_match_derived_decl): Set vindex for all derived types, not only
395         those which are being extended.
396         * expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
397         pointers.
398         * gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
399         GFC_ISYM_EXTENDS_TYPE_OF.
400         (gfc_type_is_extensible): New prototype.
401         * intrinsic.h (gfc_check_same_type_as): New prototype.
402         * intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
403         * primary.c (gfc_expr_attr): Handle CLASS-valued functions.
404         * resolve.c (resolve_structure_cons): Handle BT_CLASS.
405         (type_is_extensible): Make non-static and rename to
406         'gfc_type_is_extensible.
407         (resolve_select_type): Renamed type_is_extensible.
408         (resolve_class_assign): Handle NULL pointers.
409         (resolve_fl_variable_derived): Renamed type_is_extensible.
410         (resolve_fl_derived): Ditto.
411         * trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
412         initialization of class pointer components.
413         (gfc_conv_structure): Handle BT_CLASS.
414         * trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
415         New functions.
416         (gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
417
418 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
419
420         * gfortran.h (type_selector, select_type_tmp): New global variables.
421         * match.c (type_selector, select_type_tmp): New global variables,
422         used for SELECT TYPE statements.
423         (gfc_match_select_type): Better error handling. Remember selector.
424         (gfc_match_type_is): Create temporary variable.
425         * module.c (ab_attribute): New value 'AB_IS_CLASS'.
426         (attr_bits): New string.
427         (mio_symbol_attribute): Handle 'is_class'.
428         * resolve.c (resolve_select_type): Insert pointer assignment statement,
429         to assign temporary to selector.
430         * symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
431         in SELECT TYPE statements.
432
433 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
434
435         * dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
436         * gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
437         (gfc_expr_to_initialize): New prototype.
438         * match.c (alloc_opt_list): Correctly check type compatibility.
439         Renamed 'alloc_list'.
440         (dealloc_opt_list): Renamed 'alloc_list'.
441         * resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
442         and make it non-static.
443         (resolve_allocate_expr): Set vindex for CLASS variables correctly.
444         Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
445         (resolve_allocate_deallocate): Renamed 'alloc_list'.
446         (check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
447         argument type. Adjust to work with ordinary assignments.
448         (resolve_code): Call 'resolve_class_assign' for ordinary assignments.
449         Renamed 'check_class_pointer_assign'.
450         * st.c (gfc_free_statement): Renamed 'alloc_list'.
451         * trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
452         size determination and initialization of CLASS variables. Bugfix for
453         ALLOCATE statements with default initialization and SOURCE block.
454         (gfc_trans_deallocate): Renamed 'alloc_list'.
455
456 2009-09-30  Paul Thomas  <pault@gcc.gnu.org>
457
458         * trans-expr.c (gfc_conv_procedure_call): Convert a derived
459         type actual to a class object if the formal argument is a
460         class.
461
462 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
463
464         PR fortran/40996
465         * decl.c (build_struct): Handle allocatable scalar components.
466         * expr.c (gfc_add_component_ref): Correctly set typespec of expression,
467         after inserting component reference.
468         * match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
469         variables are being used uninitialized.
470         * primary.c (gfc_match_varspec): Handle CLASS array components.
471         * resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
472         EXEC_SELECT.
473         * trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
474         Handle allocatable scalar components.
475         * trans-expr.c (gfc_conv_component_ref): Ditto.
476         * trans-types.c (gfc_get_derived_type): Ditto.
477
478 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
479
480         * decl.c (encapsulate_class_symbol): Modify names of class container
481         components by prefixing with '$'.
482         (gfc_match_end): Handle COMP_SELECT_TYPE.
483         * expr.c (gfc_add_component_ref): Modify names of class container
484         components by prefixing with '$'.
485         * gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
486         ST_CLASS_IS.
487         (gfc_case): New field 'ts'.
488         (gfc_exec_op): Add EXEC_SELECT_TYPE.
489         (gfc_type_is_extension_of): New prototype.
490         * match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
491         New prototypes.
492         * match.c (match_derived_type_spec): New function.
493         (match_type_spec): Use 'match_derived_type_spec'.
494         (match_case_eos): Modify error message.
495         (gfc_match_select_type): New function.
496         (gfc_match_case): Modify error message.
497         (gfc_match_type_is): New function.
498         (gfc_match_class_is): Ditto.
499         * parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
500         * parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
501         statements.
502         (next_statement): Handle ST_SELECT_TYPE.
503         (gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
504         (parse_select_type_block): New function.
505         (parse_executable): Handle ST_SELECT_TYPE.
506         * resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
507         class container components by prefixing with '$'.
508         (resolve_allocate_expr): Ditto.
509         (resolve_select_type): New function.
510         (gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
511         (check_class_pointer_assign): Modify names of class container
512         components by prefixing with '$'.
513         (resolve_code): Ditto.
514         * st.c (gfc_free_statement): Ditto.
515         * symbol.c (gfc_type_is_extension_of): New function.
516         (gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
517         * trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
518
519 2009-09-30  Janus Weil  <janus@gcc.gnu.org>
520             Paul Thomas <pault@gcc.gnu.org> 
521
522         * check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
523         The second argument needs to be type-compatible with the first (not the
524         other way around, which makes a difference for CLASS entities).
525         * decl.c (encapsulate_class_symbol): New function.
526         (build_sym,build_struct): Handle BT_CLASS, call
527         'encapsulate_class_symbol'.
528         (gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
529         (gfc_match_derived_decl): Set vindex;
530         * expr.c (gfc_add_component_ref): New function.
531         (gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
532         Handle BT_CLASS.
533         * dump-parse-tree.c (show_symbol): Print vindex.
534         * gfortran.h (bt): New basic type BT_CLASS.
535         (symbol_attribute): New field 'is_class'.
536         (gfc_typespec): Remove field 'is_class'.
537         (gfc_symbol): New field 'vindex'.
538         (gfc_get_ultimate_derived_super_type): New prototype.
539         (gfc_add_component_ref): Ditto.
540         * interface.c (gfc_compare_derived_types): Pointer equality check
541         moved here from gfc_compare_types.
542         (gfc_compare_types): Handle BT_CLASS and use
543         gfc_type_compatible.
544         * match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
545         Handle BT_CLASS.
546         * misc.c (gfc_clear_ts): Removed is_class.
547         (gfc_basic_typename,gfc_typename): Handle BT_CLASS.
548         * module.c (bt_types,mio_typespec): Handle BT_CLASS.
549         (mio_symbol): Handle vindex.
550         * primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
551         * resolve.c (find_array_spec,check_typebound_baseobject):
552         Handle BT_CLASS.
553         (resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
554         inside 'gcc_assert'.
555         (resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
556         (check_class_pointer_assign): New function.
557         (resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
558         (resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
559         resolve_fl_variable): Handle BT_CLASS.
560         (check_generic_tbp_ambiguity): Add special case.
561         (resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
562         * symbol.c (gfc_get_ultimate_derived_super_type): New function.
563         (gfc_type_compatible): Handle BT_CLASS.
564         * trans-expr.c (conv_parent_component_references): Handle CLASS
565         containers.
566         (gfc_conv_initializer): Handle BT_CLASS.
567         * trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
568         Handle BT_CLASS.
569
570 2009-09-29  Daniel Kraft  <d@domob.eu>
571
572         PR fortran/39626
573         * gfortran.h (enum gfc_statement): Add ST_BLOCK and ST_END_BLOCK.
574         (struct gfc_namespace): Convert flags to bit-fields and add flag
575         `construct_entities' for use with BLOCK constructs.
576         (enum gfc_exec_code): Add EXEC_BLOCK.
577         (struct gfc_code): Add namespace field to union for EXEC_BLOCK.
578         * match.h (gfc_match_block): New prototype.
579         * parse.h (enum gfc_compile_state): Add COMP_BLOCK.
580         * trans.h (gfc_process_block_locals): New prototype.
581         (gfc_trans_deferred_vars): Made public, new prototype.
582         * trans-stmt.h (gfc_trans_block_construct): New prototype.
583         * decl.c (gfc_match_end): Handle END BLOCK correctly.
584         (gfc_match_intent): Error if inside of BLOCK.
585         (gfc_match_optional), (gfc_match_value): Ditto.
586         * match.c (gfc_match_block): New routine.
587         * parse.c (decode_statement): Handle BLOCK statement.
588         (case_exec_markers): Add ST_BLOCK.
589         (case_end): Add ST_END_BLOCK.
590         (gfc_ascii_statement): Handle ST_BLOCK and ST_END_BLOCK.
591         (parse_spec): Check for statements not allowed inside of BLOCK.
592         (parse_block_construct): New routine.
593         (parse_executable): Parse BLOCKs.
594         (parse_progunit): Disallow CONTAINS in BLOCK constructs.
595         * resolve.c (is_illegal_recursion): Find real container procedure and
596         don't get confused by BLOCK constructs.
597         (resolve_block_construct): New routine.
598         (gfc_resolve_blocks), (resolve_code): Handle EXEC_BLOCK.
599         * st.c (gfc_free_statement): Handle EXEC_BLOCK statements.
600         * trans-decl.c (saved_local_decls): New static variable.
601         (add_decl_as_local): New routine.
602         (gfc_finish_var_decl): Add variable as local if inside BLOCK.
603         (gfc_trans_deferred_vars): Make public.
604         (gfc_process_block_locals): New routine.
605         * trans-stmt.c (gfc_trans_block_construct): New routine.
606         * trans.c (gfc_trans_code): Handle EXEC_BLOCK statements.
607
608 2009-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
609
610         PR fortran/35862
611         * io.c (format_token): Add enumerators for rounding format specifiers.
612         (format_lex): Tokenize the rounding format specifiers.
613         (gfc_match_open): Enable rounding modes in OPEN statement.
614
615 2009-09-28  Richard Henderson  <rth@redhat.com>
616
617         * f95-lang.c (gfc_init_builtin_functions): Update call to
618         build_common_builtin_nodes.
619
620 2009-09-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
621
622         * simplify.c (gfc_simplify_acos, gfc_simplify_acosh,
623         gfc_simplify_asin, gfc_simplify_asinh, gfc_simplify_atan,
624         gfc_simplify_atanh): Fix error message.
625
626 2009-09-24  Steven G. Kargl  <kargl@gcc.gnu.org>
627
628         PR fortran/41459
629         * error.c(gfc_warning_now): Move warnings_are_errors test to 
630         after actual emitting of the warning.
631         * parse.c (next_free): Improve error locus printing.
632         (next_fixed): Change gfc_warn to gfc_warning_now, and improve
633         locus reporting.
634
635 2009-09-16  Michael Matz  <matz@suse.de>
636
637         PR fortran/41212
638         * trans.h (struct lang_type): Remove nontarget_type member.
639         * trans.c (gfc_add_modify): Don't access it.
640         * trans-decl.c (gfc_finish_var_decl): Don't allocate and set it,
641         instead set DECL_RESTRICTED_P on affected decls.
642
643 2009-09-14  Richard Henderson  <rth@redhat.com>
644
645         * f95-lang.c (gfc_init_builtin_functions): Update call to
646         build_common_builtin_nodes.
647         (gfc_maybe_initialize_eh): Don't call
648         default_init_unwind_resume_libfunc.
649
650 2009-09-13  Richard Guenther  <rguenther@suse.de>
651         Rafael Avila de Espindola  <espindola@google.com>
652
653         * f95-lang.c (gfc_maybe_initialize_eh): Do not init
654         eh_personality_libfunc.
655
656 2009-09-11  Janus Weil  <janus@gcc.gnu.org>
657
658         PR fortran/41242
659         * resolve.c (resolve_ordinary_assign): Don't call resolve_code,
660         to avoid that subsequent codes are resolved more than once.
661         (resolve_code): Make sure that type-bound assignment operators are
662         resolved correctly.
663
664
665 2009-09-10  Steven G. Kargl  <kargl@gcc.gnu.org>
666
667         PR fortran/31292
668         * fortran/decl.c(gfc_match_modproc): Check that module procedures
669         from a module can USEd in module procedure statements in other
670         program units.  Update locus for better error message display.
671         Detect intrinsic procedures in module procedure statements.
672
673 2009-09-09  Richard Guenther  <rguenther@suse.de>
674
675         PR fortran/41297
676         * trans-expr.c (gfc_trans_scalar_assign): Correct typo that
677         left 'tmp' unused in derived type assignment.
678
679 2009-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
680
681         PR fortran/41197
682         * resolve_c (resolve_allocate_deallocate):  Complain
683         if stat or errmsg varaible is an array.
684
685 2009-09-05  Paul Thomas  <pault@gcc.gnu.org>
686
687         PR fortran/41258
688         * primary.c (gfc_match_varspec): Do not look for typebound
689         procedures unless the derived type has a f2k_derived namespace.
690
691 2009-09-03  Diego Novillo  <dnovillo@google.com>
692
693         * f95-lang.c (lang_hooks): Remove const qualifier.
694
695 2009-09-01  Richard Guenther  <rguenther@suse.de>
696
697         * f95-lang.c (gfc_mark_addressable): Remove.
698         (LANG_HOOKS_MARK_ADDRESSABLE): Likewise.
699
700 2009-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
701
702         PR fortran/39229
703         * scanner.c (next_char): Fix typo in comment.
704         (gfc_get_char_literal): Warn if truncate flag is set for both fixed and
705         free form source, adjusting error locus as needed.
706         * parse.c (next_fixed): Clear the truncate flag.
707         (next_statement): Remove truncate warning.
708
709 2009-08-31  Janus Weil  <janus@gcc.gnu.org>
710             Paul Thomas  <pault@gcc.gnu.org>
711
712         PR fortran/40940
713         * array.c (gfc_match_array_constructor): Rename gfc_match_type_spec.
714         * decl.c (gfc_match_type_spec): Rename to gfc_match_decl_type_spec,
715         and reject CLASS with -std=f95.
716         (gfc_match_implicit, gfc_match_data_decl,gfc_match_prefix,
717         match_procedure_interface): Rename gfc_match_type_spec.
718         * gfortran.h (gfc_type_compatible): Add prototype.
719         * match.h (gfc_match_type_spec): Rename to gfc_match_decl_type_spec.
720         * match.c (match_intrinsic_typespec): Rename to match_type_spec, and
721         add handling of derived types.
722         (gfc_match_allocate): Rename match_intrinsic_typespec and check
723         type compatibility of derived types.
724         * symbol.c (gfc_type_compatible): New function to check if two types
725         are compatible.
726
727 2009-08-31  Janus Weil  <janus@gcc.gnu.org>
728
729         PR fortran/40996
730         * check.c (gfc_check_allocated): Implement allocatable scalars.
731         * resolve.c (resolve_allocate_expr,resolve_fl_var_and_proc): Ditto.
732         * trans-intrinsic.c (gfc_conv_allocated): Ditto.
733
734 2009-08-30  Daniel Kraft  <d@domob.eu>
735
736         PR fortran/37425
737         * dump-parse-tree.c (show_typebound_proc): Renamed from `show_typebound'
738         and accept gfc_typebound_proc and name instead of the symtree, needed
739         for intrinsic operator output.
740         (show_typebound_symtree): New method calling `show_typebound_proc'.
741         (show_f2k_derived): Output type-bound operators also.
742         (show_symbol): Moved output of `Procedure bindings:' label to
743         `show_f2k_derived'.
744         * gfortran.texi (Fortran 2003 status): Mention support of
745         array-constructors with explicit type specification, type-bound
746         procedures/operators, type extension, ABSTRACT types and DEFERRED.
747         Link to Fortran 2003 wiki page.
748         (Fortran 2008 status): Fix typo.  Link to Fortran 2008 wiki page.
749         * gfc-internals.texi (Type-bound Procedures): Document the new
750         members/attributes of gfc_expr.value.compcall used for type-bound
751         operators.
752         (Type-bound Operators): New section documenting their internals.
753
754 2009-08-27  Janus Weil  <janus@gcc.gnu.org>
755
756         PR fortran/40869
757         * expr.c (gfc_check_pointer_assign): Enable interface check for
758         pointer assignments involving procedure pointer components.
759         * gfortran.h (gfc_compare_interfaces): Modified prototype.
760         * interface.c (gfc_compare_interfaces): Add argument 'name2', to be
761         used instead of s2->name. Don't rely on the proc_pointer attribute,
762         but instead on the flags handed to this function.
763         (check_interface1,compare_parameter): Add argument for
764         gfc_compare_interfaces.
765         * resolve.c (check_generic_tbp_ambiguity): Ditto.
766
767 2009-08-27  Daniel Kraft  <d@domob.eu>
768
769         PR fortran/37425
770         * gfortran.h (gfc_expr): Optionally store base-object in compcall value
771         and add a new flag to distinguish assign-calls generated.
772         (gfc_find_typebound_proc): Add locus argument.
773         (gfc_find_typebound_user_op), (gfc_find_typebound_intrinsic_op): Ditto.
774         (gfc_extend_expr): Return if failure was by a real error.
775         * interface.c (matching_typebound_op): New routine.
776         (build_compcall_for_operator): New routine.
777         (gfc_extend_expr): Handle type-bound operators, some clean-up and
778         return if failure was by a real error or just by not finding an
779         appropriate operator definition.
780         (gfc_extend_assign): Handle type-bound assignments.
781         * module.c (MOD_VERSION): Incremented.
782         (mio_intrinsic_op): New routine.
783         (mio_full_typebound_tree): New routine to make typebound-procedures IO
784         code reusable for type-bound user operators.
785         (mio_f2k_derived): IO of type-bound operators.
786         * primary.c (gfc_match_varspec): Initialize new fields in gfc_expr and
787         pass locus to gfc_find_typebound_proc.
788         * resolve.c (resolve_operator): Only output error about no matching
789         interface if gfc_extend_expr did not already fail with an error.
790         (extract_compcall_passed_object): Use specified base-object if present.
791         (update_compcall_arglist): Handle ignore_pass field.
792         (resolve_ordinary_assign): Update to handle extended code for
793         type-bound assignments, too.
794         (resolve_code): Handle EXEC_ASSIGN_CALL statement code.
795         (resolve_tb_generic_targets): Pass locus to gfc_find_typebound_proc.
796         (resolve_typebound_generic), (resolve_typebound_procedure): Ditto.
797         (resolve_typebound_intrinsic_op), (resolve_typebound_user_op): Ditto.
798         (ensure_not_abstract_walker), (resolve_fl_derived): Ditto.
799         (resolve_typebound_procedures): Remove not-implemented error.
800         (resolve_typebound_call): Handle assign-call flag.
801         * symbol.c (find_typebound_proc_uop): New argument to pass locus for
802         error message about PRIVATE, verify that a found procedure is not marked
803         as erraneous.
804         (gfc_find_typebound_intrinsic_op): Ditto.
805         (gfc_find_typebound_proc), (gfc_find_typebound_user_op): New locus arg.
806
807 2009-08-22  Bud Davis <bdavis9659@sbcglobal.net>
808
809         PR fortran/28093
810         * io.c: reverted previous patch.
811
812 2009-08-25  Janne Blomqvist  <jb@gcc.gnu.org>
813
814         * gfortran.texi: Fix ENCODE example.
815
816 2009-08-25  Janus Weil  <janus@gcc.gnu.org>
817
818         PR fortran/41139
819         * primary.c (gfc_match_varspec): Make sure EXPR_PPC is only used for
820         calls to procedure pointer components, other references to procedure
821         pointer components are EXPR_VARIABLE.
822         * resolve.c (resolve_actual_arglist): Bugfix (there can be calls without
823         actual arglist).
824         * trans-expr.c (gfc_get_proc_ptr_comp): Renamed to 'get_proc_ptr_comp',
825         removed argument 'se' and made static. Avoid inserting a temporary
826         variable for calling the PPC.
827         (conv_function_val): Renamed gfc_get_proc_ptr_comp.
828         (gfc_conv_procedure_call): Distinguish functions returning a procedure
829         pointer from calls to a procedure pointer. Distinguish calls to
830         procedure pointer components from procedure pointer components as
831         actual arguments.
832         * trans-stmt.h (gfc_get_proc_ptr_comp): Make it static.
833
834 2009-08-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
835
836         PR fortran/41162
837         * io.c (check_format): Fix to not error on slash after P. Fix some
838         error loci.
839         
840 2009-08-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
841
842         PR fortran/41154
843         * io.c (check_format): Fix to not error on right paren after P.
844
845 2009-08-24  Aldy Hernandez  <aldyh@redhat.com>
846
847         PR fortran/40660
848         * trans-io.c (build_dt): Pass UNKNOWN_LOCATION to build_call_expr_loc.
849         (transfer_array_desc): Same.
850
851 2009-08-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
852
853         PR fortran/35754
854         * io.c (check_format): Add checks for comma and the allowed
855         format specifiers after the 'P' specifier. Fix typo in error message
856         and adjust locus.
857
858 2009-08-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
859
860         PR fortran/37446
861         * io.c (enum format_token): Change FMT_EXT to FMT_EN and FMT_ES.
862         (format_lex): Likewise.
863         (token_to_string): New function.
864         (check_format): Use the new tokens and the new function. Add
865         check for positive width.
866
867 2009-08-22  Steven G. Kargl  <kargl@gcc.gnu.org>
868
869         * fortran/decl.c: Disallow procedure pointers with -std=f95.
870
871 2009-08-22 Steven K. kargl  <kargl@gcc.gnu.org>
872            Paul Thomas  <pault@gcc.gnu.org>
873
874         * fortran/decl.c (match_char_spec): Rename to gfc_match_char_spec,
875         and remove static.
876         * fortran/gfortran.h: Add *expr3 entity to gfc_code.  Add prototype
877         for gfc_match_char_spec.
878         * fortran/trans-stmt.c (gfc_trans_allocate): Translate the SOURCE=
879         tag.
880         * fortran/match.c (match_intrinsic_typespec): New function to match
881         F2003 intrinsic-type-spec.
882         (conformable_arrays): New function. Check SOURCE= and
883         allocation-object are conformable.
884         (gfc_match_allocate): Use new functions.  Match SOURCE= tag.
885
886 2009-08-22  Bud Davis <bdavis9659@sbcglobal.net>
887
888         PR fortran/28093
889         * io.c : added variable to store original len of fmt
890         * io.c (check_format): Consume H items using next_char
891         in both modes to handle consecutive single quotes.
892         Test for extra characters in fmt, issue warning.
893
894 2009-08-21  Janus Weil  <janus@gcc.gnu.org>
895
896         PR fortran/41106
897         * primary.c (gfc_variable_attr): Make it work also on EXPR_FUNCTION.
898         (gfc_expr_attr): Use gfc_variable_attr for procedure pointer components.
899         * resolve.c (resolve_fl_derived): Handle CHARACTER-valued procedure
900         pointer components.
901         * trans-expr.c (gfc_conv_component_ref): Ditto.
902         (gfc_conv_variable): Ditto.
903         (gfc_conv_procedure_call): Ditto.
904         (gfc_trans_pointer_assignment): Ditto.
905         * trans-types.c (gfc_get_derived_type): Ditto.
906
907 2009-08-20  Tobias Schlüter  <tobi@gcc.gnu.org>
908
909         * trans-stmt.c (gfc_trans_do): Add a few missing folds.
910
911 2009-08-20  Michael Matz  <matz@suse.de>
912
913         PR fortran/41126
914         * trans-expr.c (gfc_conv_string_tmp): Check type compatibility
915         instead of equality.
916
917 2009-08-20  Janus Weil  <janus@gcc.gnu.org>
918
919         PR fortran/41121
920         * resolve.c (resolve_symbol): Don't resolve formal_ns of intrinsic
921         procedures.
922
923 2009-08-18  Michael Matz  <matz@suse.de>
924
925         * trans-expr.c (gfc_conv_substring): Don't evaluate casted decl early,
926         change order of length calculation to (end - start) + 1.
927         (gfc_get_interface_mapping_array): Adjust call to
928         gfc_get_nodesc_array_type.
929         * trans-array.c (gfc_trans_create_temp_array,
930         gfc_build_constant_array_constructor, gfc_conv_expr_descriptor): Ditto.
931         * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Ditto.
932         * trans.c (gfc_add_modify): Assignment between base type and nontarget
933         type are equal enough.
934         (gfc_call_malloc): Use prvoid_type_node for return value of
935         __builtin_malloc.
936         (gfc_allocate_with_status): Ditto.
937         * trans-types.c (gfc_array_descriptor_base): Double size of this array.
938         (gfc_init_types): Build prvoid_type_node.
939         (gfc_build_array_type): New bool parameter "restricted".
940         (gfc_get_nodesc_array_type): Ditto, build restrict qualified pointers,
941         if it's true.
942         (gfc_get_array_descriptor_base): Ditto.
943         (gfc_get_array_type_bounds): Ditto.
944         (gfc_sym_type): Use symbol attributes to feed calls to above functions.
945         (gfc_get_derived_type): Ditto.
946         * trans.h (struct lang_type): Add nontarget_type member.
947         * trans-types.h (prvoid_type_node): Declare.
948         (gfc_get_array_type_bounds, gfc_get_nodesc_array_type): Declare new
949         parameter.
950         * trans-decl.c (gfc_finish_var_decl): Give scalars that can't be
951         aliased a type with a different alias set than the base type.
952         (gfc_build_dummy_array_decl): Adjust call to gfc_get_nodesc_array_type.
953
954 2009-08-18  Janus Weil  <janus@gcc.gnu.org>
955             Paul Thomas  <pault@gcc.gnu.org>
956
957         PR fortran/40870
958         * trans-types.c (gfc_get_ppc_type): Include formal args in backend_decl
959         using the interface symbol. Character types are returned by reference.
960         (gfc_get_derived_type): Prevent infinite recursion loop
961         if a PPC has a derived-type formal arg.
962
963 2008-08-17  Paul Thomas  <pault@gcc.gnu.org>
964
965         PR fortran/41062
966         * trans-decl.c (gfc_trans_use_stmts):  Keep going through use
967         list if symbol is not use associated.
968
969 2009-08-17  Daniel Kraft  <d@domob.eu>
970
971         PR fortran/37425
972         * resolve.c (get_checked_tb_operator_target): New routine to do checks
973         on type-bound operators in common between intrinsic and user operators.
974         (resolve_typebound_intrinsic_op): Call it.
975         (resolve_typebound_user_op): Ditto.
976
977 2009-08-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
978
979         PR fortran/41075
980         * scanner.c (gfc_next_char_literal): Add comment to improve 
981         readability.
982         * io.c (enum format_token): Add FMT_STAR. (format_lex): Add case
983         for '*'. (check_format): Check for left paren after '*'.  Change
984         format checks to use %L to improve format string error locus.
985
986 2009-08-17  Janus Weil  <janus@gcc.gnu.org>
987
988         PR fortran/40877
989         * array.c (gfc_resolve_character_array_constructor): Add NULL argument
990         to gfc_new_charlen.
991         * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec,
992         gfc_match_implicit): Ditto.
993         * expr.c (simplify_const_ref): Fix memory leak.
994         (gfc_simplify_expr): Add NULL argument to gfc_new_charlen.
995         * gfortran.h (gfc_new_charlen): Modified prototype.
996         * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Add NULL
997         argument to gfc_new_charlen.
998         * module.c (mio_charlen): Ditto.
999         * resolve.c (gfc_resolve_substring_charlen,
1000         gfc_resolve_character_operator,fixup_charlen): Ditto.
1001         (resolve_fl_derived,resolve_symbol): Add argument to gfc_charlen.
1002         * symbol.c (gfc_new_charlen): Add argument 'old_cl' (to make a copy of
1003         an existing charlen).
1004         (gfc_set_default_type,generate_isocbinding_symbol): Fix memory leak.
1005         (gfc_copy_formal_args_intr): Add NULL argument to gfc_new_charlen.
1006         * trans-decl.c (create_function_arglist): Fix memory leak.
1007
1008 2009-08-17  Richard Guenther  <rguenther@suse.de>
1009
1010         * trans-expr.c (gfc_trans_scalar_assign): Replace hack with
1011         more proper hack.
1012
1013 2009-08-15  Tobias Burnus  <burnus@net-b.de>
1014
1015         PR fortran/41080
1016         * gfortranspec.c (lookup_option): Remove gfortran-specific
1017         version of -dumpversion.
1018
1019 2009-08-14  Janus Weil  <janus@gcc.gnu.org>
1020
1021         PR fortran/41070
1022         * resolve.c (resolve_structure_cons): Make sure that ts.u.derived is
1023         only used if type is BT_DERIVED.
1024
1025 2009-08-13  Janus Weil  <janus@gcc.gnu.org>
1026
1027         PR fortran/40941
1028         * gfortran.h (gfc_typespec): Put 'derived' and 'cl' into union.
1029         * decl.c (build_struct): Make sure 'cl' is only used
1030         if type is BT_CHARACTER.
1031         * symbol.c (gfc_set_default_type): Ditto.
1032         * resolve.c (resolve_symbol, resolve_fl_derived): Ditto.
1033         (resolve_equivalence,resolve_equivalence_derived): Make sure 'derived'
1034         is only used if type is BT_DERIVED.
1035         * trans-io.c (transfer_expr): Make sure 'derived' is only used if type
1036         is BT_DERIVED or BT_INTEGER (special case: C_PTR/C_FUNPTR).
1037         * array.c: Mechanical replacements to accomodate union in gfc_typespec.
1038         * check.c: Ditto.
1039         * data.c: Ditto.
1040         * decl.c: Ditto.
1041         * dump-parse-tree.c: Ditto.
1042         * expr.c: Ditto.
1043         * interface.c: Ditto.
1044         * iresolve.c: Ditto.
1045         * match.c: Ditto.
1046         * misc.c: Ditto.
1047         * module.c: Ditto.
1048         * openmp.c: Ditto.
1049         * parse.c: Ditto.
1050         * primary.c: Ditto.
1051         * resolve.c: Ditto.
1052         * simplify.c: Ditto.
1053         * symbol.c: Ditto.
1054         * target-memory.c: Ditto.
1055         * trans-array.c: Ditto.
1056         * trans-common.c: Ditto.
1057         * trans-const.c: Ditto.
1058         * trans-decl.c: Ditto.
1059         * trans-expr.c: Ditto.
1060         * trans-intrinsic.c: Ditto.
1061         * trans-io.c: Ditto.
1062         * trans-stmt.c: Ditto.
1063         * trans-types.c: Ditto.
1064
1065 2009-08-13  Janus Weil  <janus@gcc.gnu.org>
1066
1067         PR fortran/40995
1068         * resolve.c (resolve_symbol): Move some checking code to
1069         resolve_intrinsic, and call this from here.
1070         (resolve_intrinsic): Some checking code moved here from resolve_symbol.
1071         Make sure each intrinsic is only resolved once.
1072
1073 2009-08-12  Tobias Burnus  <burnus@net-b.de>
1074
1075         PR fortran/41034
1076         * symbol.c (gfc_copy_attr): Merge bits instead of replace
1077         bits in gfc_copy_attr.
1078         * gfc_check_pointer_assign (gfc_check_pointer_assign):
1079         Initialize ext_attr bits by zero.
1080
1081 2009-08-11  Richard Guenther  <rguenther@suse.de>
1082
1083         * trans-types.c (gfc_get_derived_type): Do not clear TYPE_CANONICAL.
1084
1085 2009-08-11  Janus Weil  <janus@gcc.gnu.org>
1086
1087         PR fortran/41022
1088         * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointer
1089         components as actual arguments.
1090
1091 2009-08-10  Daniel Kraft  <d@domob.eu>
1092
1093         PR fortran/37425
1094         * gfortran.h (struct gfc_namespace): New fields tb_uop_root and tb_op.
1095         (gfc_find_typebound_user_op): New routine.
1096         (gfc_find_typebound_intrinsic_op): Ditto.
1097         (gfc_check_operator_interface): Now public routine.
1098         * decl.c (gfc_match_generic): Match OPERATOR(X) or ASSIGNMENT(=).
1099         * interface.c (check_operator_interface): Made public, renamed to
1100         `gfc_check_operator_interface' accordingly and hand in the interface
1101         as gfc_symbol rather than gfc_interface so it is useful for type-bound
1102         operators, too.  Return boolean result.
1103         (gfc_check_interfaces): Adapt call to `check_operator_interface'.
1104         * symbol.c (gfc_get_namespace): Initialize new field `tb_op'.
1105         (gfc_free_namespace): Free `tb_uop_root'-based tree.
1106         (find_typebound_proc_uop): New helper function.
1107         (gfc_find_typebound_proc): Use it.
1108         (gfc_find_typebound_user_op): New method.
1109         (gfc_find_typebound_intrinsic_op): Ditto.
1110         * resolve.c (resolve_tb_generic_targets): New helper function.
1111         (resolve_typebound_generic): Use it.
1112         (resolve_typebound_intrinsic_op), (resolve_typebound_user_op): New.
1113         (resolve_typebound_procedures): Resolve operators, too.
1114         (check_uop_procedure): New, code from gfc_resolve_uops.
1115         (gfc_resolve_uops): Moved main code to new `check_uop_procedure'.
1116
1117 2009-08-10  Janus Weil  <janus@gcc.gnu.org>
1118
1119         PR fortran/40940
1120         * decl.c (gfc_match_type_spec): Match CLASS statement and warn about
1121         missing polymorphism.
1122         * gfortran.h (gfc_typespec): Add field 'is_class'.
1123         * misc.c (gfc_clear_ts): Initialize 'is_class' to zero.
1124         * resolve.c (type_is_extensible): New function to check if a derived
1125         type is extensible.
1126         (resolve_fl_variable_derived): Add error checks for CLASS variables.
1127         (resolve_typebound_procedure): Disallow non-polymorphic passed-object
1128         dummy arguments, turning warning into error.
1129         (resolve_fl_derived): Use 'type_is_extensible'. Disallow non-polymorphic
1130         passed-object dummy arguments for procedure pointer components,
1131         turning warning into error. Add error check for CLASS components.
1132
1133 2009-08-05  Tobias Burnus  <burnus@net-b.de>
1134
1135         PR fortran/40955
1136         * gfortran.h (ext_attr_id_t): Add typedef for this enum.
1137         (gfc_add_ext_attribute): Use it.
1138         * decl.c (gfc_match_gcc_attributes): Ditto.
1139         * expr.c (gfc_check_pointer_assign): Ditto.
1140         * symbol.c (gfc_add_ext_attribute): Ditto.
1141         (gfc_copy_attr): Copy also ext_attr.
1142         * resolve.c (resolve_fl_derived,resolve_symbol): Ditto.
1143         * module.c (mio_symbol_attribute): Save ext_attr in the mod file.
1144
1145 2009-08-05  Tobias Burnus  <burnus@net-b.de>
1146
1147         PR fortran/40969
1148         Revert:
1149         2009-08-04  Tobias Burnus  <burnus@net-b.de>
1150
1151         PR fortran/40949
1152         * trans-types.c (gfc_get_function_type): Fix typelist of
1153         functions without argument.
1154
1155 2009-08-05  Paul Thomas  <pault@gcc.gnu.org>
1156
1157         PR fortran/40847
1158         * iresolve.c (gfc_resolve_transfer): Correct error in 'mold'
1159         character length for case where length expresson is NULL.
1160
1161 2009-08-04  Tobias Burnus  <burnus@net-b.de>
1162
1163         PR fortran/40949
1164         * trans-types.c (gfc_get_function_type): Fix typelist of
1165         functions without argument.
1166
1167 2009-08-04  Paul Thomas  <pault@gcc.gnu.org>
1168
1169         PR fortran/40875
1170         * decl.c (add_init_expr_to_sym): Character symbols can only be
1171         initialized with character expressions.
1172
1173 2009-08-02  Janus Weil  <janus@gcc.gnu.org>
1174
1175         PR fortran/40881
1176         * decl.c (match_char_length): Warn about old-style character length
1177         declarations.
1178         * match.c (match_arithmetic_if,gfc_match_if): Modify warning message
1179         for arithmetic if.
1180         (gfc_match_goto): Warn about computed gotos.
1181         (gfc_match_return): Warn about alternate return.
1182         (gfc_match_st_function): Warn about statement functions.
1183         * resolve.c (resolve_fl_procedure): Modify warning message for
1184         assumed-length character functions.
1185
1186 2009-08-01  Paul Thomas  <pault@gcc.gnu.org>
1187
1188         PR fortran/40011
1189         * error.c : Add static flag 'warnings_not_errors'.
1190         (gfc_error): If 'warnings_not_errors' is set, branch to code
1191         from gfc_warning.
1192         (gfc_clear_error): Reset 'warnings_not_errors'.
1193         (gfc_errors_to_warnings): New function.
1194         * options.c (gfc_post_options): If pedantic and flag_whole_file
1195         change the latter to a value of 2.
1196         * parse.c (parse_module): Add module namespace to gsymbol.
1197         (resolve_all_program_units): New function.
1198         (clean_up_modules): New function.
1199         (translate_all_program_units): New function.
1200         (gfc_parse_file): If whole_file, do not clean up module right
1201         away and add derived types to namespace derived types. In
1202         addition, call the three new functions above.
1203         * resolve.c (not_in_recursive): New function.
1204         (not_entry_self_reference): New function.
1205         (resolve_global_procedure): Symbol must not be IFSRC_UNKNOWN,
1206         procedure must not be in the course of being resolved and
1207         must return false for the two new functions. Pack away the
1208         current derived type list before calling gfc_resolve for the
1209         gsymbol namespace.  It is unconditionally an error if the ranks
1210         of the reference and ther procedure do not match. Convert
1211         errors to warnings during call to gfc_procedure_use if not
1212         pedantic or legacy.
1213         (gfc_resolve): Set namespace resolved flag to -1 during
1214         resolution and store current cs_base.
1215         * trans-decl.c (gfc_get_symbol_decl): If whole_file compilation
1216         substitute a use associated variable, if it is available in a
1217         gsymbolnamespace.
1218         (gfc_get_extern_function_decl): If the procedure is use assoc,
1219         do not attempt to find it in a gsymbol because it could be an
1220         interface. If the symbol exists in a module namespace, return
1221         its backend_decl.
1222         * trans-expr.c (gfc_trans_scalar_assign): If a derived type
1223         assignment, set the rhs TYPE_MAIN_VARIANT to that of the rhs.
1224         * trans-types.c (copy_dt_decls_ifequal): Add 'from_gsym' as a
1225         boolean argument. Copy component backend_decls directly if the
1226         components are derived types and from_gsym is true.
1227         (gfc_get_derived_type): If whole_file copy the derived type from
1228         the module if it is use associated, otherwise, if can be found
1229         in another gsymbol namespace, use the existing derived type as
1230         the TYPE_CANONICAL and build normally.
1231         * gfortran.h : Add derived_types and resolved fields to
1232         gfc_namespace. Include prototype for gfc_errors_to_warnings.
1233
1234 2009-07-29  Tobias Burnus  <burnus@net-b.de>
1235
1236         PR fortran/40898
1237         * trans-types.c (gfc_get_function_type): Do not add hidden
1238         string-length argument for BIND(C) procedures.
1239         * trans-decl.c (create_function_arglist): Skip over nonexisting
1240         string-length arguments for BIND(C) procedures.
1241
1242 2009-07-28  Jakub Jelinek  <jakub@redhat.com>
1243
1244         PR fortran/40878
1245         * openmp.c (gfc_match_omp_clauses): Use gfc_error_now instead of
1246         gfc_error to diagnose invalid COLLAPSE arguments.
1247
1248 2009-07-28  Janus Weil  <janus@gcc.gnu.org>
1249
1250         PR fortran/40882
1251         * trans-types.c (gfc_get_ppc_type): For derived types, directly use the
1252         backend_decl, instead of calling gfc_typenode_for_spec, to avoid
1253         infinte loop.
1254         (gfc_get_derived_type): Correctly handle PPCs returning derived types,
1255         avoiding infinite recursion.
1256
1257 2009-07-27  Janus Weil  <janus@gcc.gnu.org>
1258
1259         PR fortran/40848
1260         * interface.c (gfc_compare_interfaces): Call 'count_types_test' before
1261         'generic_correspondence', and only if checking a generic interface.
1262
1263 2009-07-27  Tobias Burnus  <burnus@net-b.de>
1264
1265         PR fortran/40851
1266         * resolve.c (resolve_symbol): Do not initialize pointer derived-types.
1267         * trans-decl.c (init_intent_out_dt): Ditto.
1268         (generate_local_decl): No need to set attr.referenced for DT pointers.
1269
1270 2009-07-26  Tobias Burnus  <burnus@net-b.de>
1271
1272         PR fortran/33197
1273         * intrinsic.c (make_generic): Remove assert as "atan" can be
1274         both ISYM_ATAN and ISYM_ATAN2.
1275         (add_functions): Add two-argument variant of ATAN.
1276         * intrinsic.h (gfc_check_atan_2): Add check for it.
1277         * intrinsic.texi (ATAN2): Correct and enhance description.
1278         (ATAN): Describe two-argument variant of ATAN.
1279
1280 2009-07-25  Tobias Burnus  <burnus@net-b.de>
1281             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1282
1283         PR fortran/33197
1284         * intrinsic.c (add_functions): Support complex arguments for
1285         acos,acosh,asin,asinh,atan,atanh.
1286         * invoke.texi (ACOS,ACOSH,ASIN,ASINH,ATAN,ATANH): Support
1287         complex arguments.
1288         * simplify.c (gfc_simplify_acos,gfc_simplify_acosh,
1289         gfc_simplify_asin,gfc_simplify_asinh,gfc_simplify_atan,
1290         gfc_simplify_atanh,gfc_simplify_atan,gfc_simplify_asinh,
1291         gfc_simplify_acosh,gfc_simplify_atanh): Support
1292         complex arguments.
1293
1294 2009-07-25  Richard Guenther  <rguenther@suse.de>
1295
1296         PR fortran/40005
1297         * trans-types.c (gfc_get_array_type_bounds): Use
1298         build_distinct_type_copy with a proper TYPE_CANONICAL and
1299         re-use the type-decl of the original type.
1300         * trans-decl.c (build_entry_thunks): Signal cgraph we may not
1301         garbage collect.
1302         (create_main_function): Likewise.
1303         (gfc_generate_function_code): Likewise.
1304         * trans-expr.c (gfc_trans_subcomponent_assign): Do not use
1305         fold_convert on record types.
1306
1307 2009-07-25  Janus Weil  <janus@gcc.gnu.org>
1308
1309         PR fortran/39630
1310         * decl.c (match_ppc_decl): Implement the PASS attribute for procedure
1311         pointer components.
1312         (match_binding_attributes): Ditto.
1313         * gfortran.h (gfc_component): Add member 'tb'.
1314         (gfc_typebound_proc): Add member 'ppc' and make 'pass_arg' const.
1315         * module.c (MOD_VERSION): Bump module version.
1316         (binding_ppc): New string constants.
1317         (mio_component): Only use formal args if component is a procedure
1318         pointer and add 'tb' member.
1319         (mio_typebound_proc): Include pass_arg and take care of procedure
1320         pointer components.
1321         * resolve.c (update_arglist_pass): Add argument 'name' and take care of
1322         optional arguments.
1323         (extract_ppc_passed_object): New function, analogous to
1324         extract_compcall_passed_object, but for procedure pointer components.
1325         (update_ppc_arglist): New function, analogous to
1326         update_compcall_arglist, but for procedure pointer components.
1327         (resolve_typebound_generic_call): Added argument to update_arglist_pass.
1328         (resolve_ppc_call, resolve_expr_ppc): Take care of PASS attribute.
1329         (resolve_fl_derived): Check the PASS argument for procedure pointer
1330         components.
1331         * symbol.c (verify_bind_c_derived_type): Reject procedure pointer
1332         components in BIND(C) types.
1333
1334 2009-07-24  Janus Weil  <janus@gcc.gnu.org>
1335
1336         PR fortran/40822
1337         * array.c (gfc_resolve_character_array_constructor): Use new function
1338         gfc_new_charlen.
1339         * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec,
1340         gfc_match_implicit): Ditto.
1341         * expr.c (gfc_simplify_expr): Ditto.
1342         * gfortran.h (gfc_new_charlen): New prototype.
1343         * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Use new
1344         function gfc_new_charlen.
1345         * module.c (mio_charlen): Ditto.
1346         * resolve.c (gfc_resolve_substring_charlen,
1347         gfc_resolve_character_operator,fixup_charlen,resolve_fl_derived,
1348         resolve_symbol): Ditto.
1349         * symbol.c (gfc_new_charlen): New function to create a new gfc_charlen
1350         structure and add it to a namespace.
1351         (gfc_copy_formal_args_intr): Make sure ts.cl is present
1352         for CHARACTER variables.
1353
1354 2009-07-24  Jakub Jelinek  <jakub@redhat.com>
1355
1356         PR fortran/40643
1357         PR fortran/31067
1358         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc,
1359         gfc_conv_intrinsic_minmaxval): Handle Infinities and NaNs properly,
1360         optimize.
1361         * trans-array.c (gfc_trans_scalarized_loop_end): No longer static.
1362         * trans-array.h (gfc_trans_scalarized_loop_end): New prototype.
1363
1364 2009-07-23  Jakub Jelinek  <jakub@redhat.com>
1365
1366         PR fortran/40839
1367         * io.c (gfc_resolve_dt): Add LOC argument.  Fail if
1368         dt->io_unit is NULL.  Return FAILURE after issuing error about
1369         negative UNIT number.
1370         (match_io_element): Don't segfault if current_dt->io_unit is NULL.
1371         * gfortran.h (gfc_resolve_dt): Adjust prototype.
1372         * resolve.c (resolve_code): Adjust caller.
1373
1374 2009-07-22  Paul Thomas  <pault@gcc.gnu.org>
1375
1376         PR fortran/40796
1377         * trans-decl.c (generate_local_decl): Unreferenced result
1378         variables with allocatable components should be treated like
1379         INTENT_OUT dummy variables.
1380
1381 2009-07-22  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1382
1383         * trans.h (gfc_set_decl_assembler_name): New prototype.
1384         * trans-decl.c (gfc_set_decl_assembler_name): New function.
1385         (gfc_get_symbol_decl, gfc_get_extern_function_decl,
1386         build_function_decl): Use gfc_set_decl_assembler_name instead of
1387         SET_DECL_ASSEMBLER_NAME.
1388         * trans-common.c (build_common_decl): Use
1389         gfc_set_decl_assembler_name instead of SET_DECL_ASSEMBLER_NAME.
1390
1391 2009-07-21  Richard Guenther  <rguenther@suse.de>
1392
1393         PR fortran/40726
1394         * trans-decl.c (gfc_get_extern_function_decl): Do not set
1395         DECL_IS_MALLOC for pointer valued functions.
1396         (build_function_decl): The same.
1397
1398 2009-07-19  Steven G. Kargl  <kargl@gcc.gnu.org>
1399
1400         PR fortran/40727
1401         * fortran/check.c (gfc_check_cmplx, gfc_check_dcmplx): Add check that
1402         the optional second argument isn't of COMPLEX type.
1403
1404 2009-07-17  Richard Guenther  <rguenther@suse.de>
1405
1406         PR c/40401
1407         * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here.
1408         * trans-decl.c (gfc_gimplify_function): Remove.
1409         (build_entry_thunks): Do not gimplify here.
1410         (create_main_function): Likewise.
1411         (gfc_generate_function_code): Likewise.
1412
1413 2009-07-17  Aldy Hernandez  <aldyh@redhat.com>
1414             Manuel López-Ibáñez  <manu@gcc.gnu.org>
1415
1416         PR 40435 
1417         * trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c,
1418         trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location
1419         argument to fold_{unary,binary,ternary}, fold_build[123],
1420         build_call_expr, build_size_arg, build_fold_addr_expr,
1421         build_call_array, non_lvalue, size_diffop,
1422         fold_build1_initializer, fold_build2_initializer,
1423         fold_build3_initializer, fold_build_call_array,
1424         fold_build_call_array_initializer, fold_single_bit_test,
1425         omit_one_operand, omit_two_operands, invert_truthvalue,
1426         fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
1427         combine_comparisons, fold_builtin_*, fold_call_expr,
1428         build_range_check, maybe_fold_offset_to_address, round_up,
1429         round_down.
1430
1431 2009-07-15  Janus Weil  <janus@gcc.gnu.org>
1432
1433         PR fortran/40743
1434         * resolve.c (resolve_symbol): Don't resolve the formal namespace of a
1435         contained procedure.
1436
1437 2009-07-14  Taras Glek  <tglek@mozilla.com>
1438             Rafael Espindola  <espindola@google.com>
1439
1440         * Make-lang.in (fortran.install-plugin): New target for
1441         installing plugin headers.
1442
1443 2009-07-13  H.J. Lu  <hongjiu.lu@intel.com>
1444
1445         * module.c (mio_symbol): Remove the unused variable, formal.
1446
1447 2009-07-13  Janus Weil  <janus@gcc.gnu.org>
1448
1449         PR fortran/40646
1450         * module.c (mio_symbol): If the symbol has formal arguments,
1451         the formal namespace will be present.
1452         * resolve.c (resolve_actual_arglist): Correctly handle 'called'
1453         procedure pointer components as actual arguments.
1454         (resolve_fl_derived,resolve_symbol): Make sure the formal namespace
1455         is present.
1456         * trans-expr.c (gfc_conv_procedure_call): Correctly handle the formal
1457         arguments of procedure pointer components.
1458
1459 2009-07-12  Tobias Burnus  <burnus@net-b.de>
1460             Philippe Marguinaud <philippe.marguinaud@meteo.fr>
1461
1462         PR fortran/40588
1463         * primary.c (match_charkind_name): Fix condition for $ matching.
1464
1465         PR libfortran/22423
1466         * libgfortran.h: Typedef the GFC_DTYPE_* enum.
1467
1468 2009-07-11  Tobias Burnus  <burnus@net-b.de>
1469
1470         PR fortran/33197
1471         * check.c (gfc_check_fn_rc2008): New function.
1472         * intrinsic.h (gfc_check_fn_rc2008): New prototype.
1473         * intrinsic.c (add_functions): Add complex tan, cosh, sinh,
1474         and tanh.
1475
1476 2009-07-10  Paul Thomas  <pault@gcc.gnu.org>
1477
1478         PR fortran/39334
1479         * primary.c (match_kind_param): Return MATCH_NO if the symbol
1480         has no value.
1481
1482 2008-07-09  Paul Thomas  <pault@gcc.gnu.org>
1483
1484         PR fortran/40629
1485         * resolve.c (check_host_association):  Use the existing
1486         accessible symtree and treat function expressions with
1487         symbols that have procedure flavor.
1488
1489 2009-07-09  Janus Weil  <janus@gcc.gnu.org>
1490
1491         PR fortran/40646
1492         * dump-parse-tree.c (show_expr): Renamed 'is_proc_ptr_comp'.
1493         * expr.c (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'.
1494         (gfc_check_pointer_assign): Renamed 'is_proc_ptr_comp'.
1495         (replace_comp,gfc_expr_replace_comp): New functions, analogous
1496         to 'replace_symbol' and 'gfc_expr_replace_symbol', just with components
1497         instead of symbols.
1498         * gfortran.h (gfc_expr_replace_comp): New prototype.
1499         (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'.
1500         * interface.c (compare_actual_formal): Renamed 'is_proc_ptr_comp'.
1501         * match.c (gfc_match_pointer_assignment): Ditto.
1502         * primary.c (gfc_match_varspec): Handle array-valued procedure pointers
1503         and procedure pointer components. Renamed 'is_proc_ptr_comp'.
1504         * resolve.c (resolve_fl_derived): Correctly handle interfaces with
1505         RESULT statement, and handle array-valued procedure pointer components.
1506         (resolve_actual_arglist,resolve_ppc_call,resolve_expr_ppc): Renamed
1507         'is_proc_ptr_comp'.
1508         * trans-array.c (gfc_walk_function_expr): Ditto.
1509         * trans-decl.c (gfc_get_symbol_decl): Security check for presence of
1510         ns->proc_name.
1511         * trans-expr.c (gfc_conv_procedure_call): Handle array-valued procedure
1512         pointer components. Renamed 'is_proc_ptr_comp'.
1513         (conv_function_val,gfc_trans_arrayfunc_assign): Renamed
1514         'is_proc_ptr_comp'.
1515         (gfc_get_proc_ptr_comp): Do not modify the argument 'e', but instead
1516         make a copy of it.
1517         * trans-io.c (gfc_trans_transfer): Handle array-valued procedure
1518         pointer components.
1519
1520 2009-07-09  Tobias Burnus  <burnus@net-b.de>
1521
1522         PR fortran/40604
1523         * intrinsic.c (gfc_convert_type_warn): Set sym->result.
1524         * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer
1525         for optional arguments.
1526
1527 2009-07-08  Tobias Burnus  <burnus@net-b.de>
1528
1529         PR fortran/40675
1530         * simplify.c (gfc_simplify_sign): Handle signed zero correctly.
1531         * trans-intrinsic.c (gfc_conv_intrinsic_sign): Support
1532         -fno-sign-zero.
1533         * invoke.texi (-fno-sign-zero): Add text regarding SIGN intrinsic.
1534
1535 2008-07-08  Paul Thomas  <pault@gcc.gnu.org>
1536
1537         PR fortran/40591
1538         * decl.c (match_procedure_interface):  Correct the association
1539         or creation of the interface procedure's symbol.
1540
1541 2009-07-04  Jakub Jelinek  <jakub@redhat.com>
1542
1543         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): For integer
1544         maxloc initialize limit to -huge-1 rather than just -huge.
1545
1546 2009-07-04  Janus Weil  <janus@gcc.gnu.org>
1547
1548         PR fortran/40593
1549         * interface.c (compare_actual_formal): Take care of proc-pointer-valued
1550         functions as actual arguments.
1551         * trans-expr.c (gfc_conv_procedure_call): Ditto.
1552         * resolve.c (resolve_specific_f0): Use the correct ts.
1553
1554 2009-07-02  Michael Matz  <matz@suse.de>
1555
1556         PR fortran/32131
1557         * trans-array.c (gfc_conv_descriptor_stride_get): Return
1558         constant one for strides in the first dimension of ALLOCATABLE
1559         arrays.
1560
1561 2009-06-30  Janus Weil  <janus@gcc.gnu.org>
1562
1563         PR fortran/40594
1564         * trans-types.c (gfc_get_derived_type): Bugfix, reverting one hunk from
1565         r147206.
1566
1567 2009-06-29  Tobias Burnus  <burnus@net-b.de>
1568
1569         PR fortran/40580
1570         * trans-expr.c  (gfc_conv_procedure_call): Add -fcheck=pointer check.
1571         * libgfortran.h: Add GFC_RTCHECK_POINTER.
1572         * invoke.texi (-fcheck): Document new pointer option.
1573         * options.c (gfc_handle_runtime_check_option): Handle pointer option.
1574
1575         * gfortran.texi (C Binding): Improve wording.
1576         * iso-c-binding.def: Remove obsolete comment.
1577
1578 2009-06-29  Paul Thomas  <pault@gcc.gnu.org>
1579
1580         PR fortran/40551
1581         * dependency.h : Add second bool* argument to prototype of
1582         gfc_full_array_ref_p.
1583         * dependency.c (gfc_full_array_ref_p): If second argument is
1584         present, return true if last dimension of reference is an
1585         element or has unity stride.
1586         * trans-array.c : Add NULL second argument to references to
1587         gfc_full_array_ref_p.
1588         * trans-expr.c : The same, except for;
1589         (gfc_trans_arrayfunc_assign): Return fail if lhs reference
1590         is not a full array or a contiguous section.
1591
1592 2009-06-28  Tobias Burnus  <burnus@net-b.de>
1593             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1594
1595         PR fortran/34112
1596         * symbol.c (gfc_add_ext_attribute): New function.
1597         (gfc_get_sym_tree): New argument allow_subroutine.
1598         (gfc_get_symbol,gfc_get_ha_sym_tree,gen_cptr_param,gen_fptr_param
1599         gen_shape_param,generate_isocbinding_symbol): Use it.
1600         * decl.c (find_special): New argument allow_subroutine.
1601         (add_init_expr_to_sym,add_hidden_procptr_result,attr_decl1,
1602         match_procedure_in_type,gfc_match_final_decl): Use it.
1603         (gfc_match_gcc_attributes): New function.
1604         * gfortran.texi (Mixed-Language Programming): New section
1605         "GNU Fortran Compiler Directives".
1606         * gfortran.h (ext_attr_t): New struct.
1607         (symbol_attributes): Use it.
1608         (gfc_add_ext_attribute): New prototype.
1609         (gfc_get_sym_tree): Update pototype.
1610         * expr.c (gfc_check_pointer_assign): Check whether call
1611         convention is the same.
1612         * module.c (import_iso_c_binding_module, create_int_parameter,
1613         use_iso_fortran_env_module): Update gfc_get_sym_tree call.
1614         * scanner.c (skip_gcc_attribute): New function.
1615         (skip_free_comments,skip_fixed_comments): Use it.
1616         (gfc_next_char_literal): Support !GCC$ lines.
1617         * resolve.c (check_host_association): Update
1618         gfc_get_sym_tree call.
1619         * match.c (gfc_match_sym_tree,gfc_match_call): Update
1620         gfc_get_sym_tree call.
1621         * trans-decl.c (add_attributes_to_decl): New function.
1622         (gfc_get_symbol_decl,get_proc_pointer_decl,
1623         gfc_get_extern_function_decl,build_function_decl: Use it.
1624         * match.h (gfc_match_gcc_attributes): Add prototype.
1625         * parse.c (decode_gcc_attribute): New function.
1626         (next_free,next_fixed): Support !GCC$ lines.
1627         * primary.c (match_actual_arg,check_for_implicit_index,
1628         gfc_match_rvalue,gfc_match_rvalue): Update
1629         gfc_get_sym_tree call.
1630
1631 2009-06-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1632
1633         * gfortran.h: Define HAVE_mpc_pow.
1634         * arith.c (complex_reciprocal, complex_pow): If HAVE_mpc_pow,
1635         don't define these functions.
1636         (arith_power): If HAVE_mpc_pow, use mpc_pow.
1637
1638 2009-06-26  Janus Weil  <janus@gcc.gnu.org>
1639
1640         PR fortran/39997
1641         PR fortran/40541
1642         * decl.c (add_hidden_procptr_result): Copy the typespec to the hidden
1643         result.
1644         * expr.c (gfc_check_pointer_assign): Enable interface check for
1645         procedure pointer assignments where the rhs is a function returning a
1646         procedure pointer.
1647         * resolve.c (resolve_symbol): If an external procedure with unspecified
1648         return type can not be implicitly typed, it must be a subroutine.
1649
1650 2009-06-24  Janus Weil  <janus@gcc.gnu.org>
1651
1652         PR fortran/40427
1653         * gfortran.h (gfc_component): New member 'formal_ns'.
1654         (gfc_copy_formal_args_ppc,void gfc_ppc_use): New.
1655         * interface.c (gfc_ppc_use): New function, analogous to
1656         gfc_procedure_use, but for procedure pointer components.
1657         * module.c (MOD_VERSION): Bump module version.
1658         (mio_component): Treat formal arguments.
1659         (mio_formal_arglist): Changed argument from gfc_symbol to
1660         gfc_formal_arglist.
1661         (mio_symbol): Changed argument of mio_formal_arglist.
1662         * resolve.c (resolve_ppc_call,resolve_expr_ppc): Call gfc_ppc_use,
1663         to check actual arguments and treat formal args correctly.
1664         (resolve_fl_derived): Copy formal args of procedure pointer components
1665         from their interface.
1666         * symbol.c (gfc_copy_formal_args_ppc): New function, analogous to
1667         gfc_copy_formal_args, but for procedure pointer components.
1668
1669 2009-06-22  Janus Weil  <janus@gcc.gnu.org>
1670
1671         PR fortran/37254
1672         PR fortran/39850
1673         * interface.c (compare_parameter): Set implicit type for function
1674         actual arguments with BT_UNKNOWN.
1675
1676 2009-06-22  Tobias Burnus  <burnus@net-b.de>
1677
1678         PR fortran/40472
1679         PR fortran/50520
1680         * simplify.c (gfc_simplify_spread): Fix the case that source=
1681         is a scalar.
1682
1683 2009-06-22  Paul Thomas  <pault@gcc.gnu.org>
1684
1685         PR fortran/40443
1686         * interface.c (gfc_search_interface): Hold back a match to an
1687         elementary procedure until all other possibilities are
1688         exhausted.
1689
1690 2009-06-22  Paul Thomas  <pault@gcc.gnu.org>
1691
1692         PR fortran/40472
1693         * simplify.c (gfc_simplify_spread): Restrict the result size to
1694         the limit for an array constructor.
1695
1696 2009-06-21  Janus Weil  <janus@gcc.gnu.org>
1697
1698         PR fortran/39850
1699         * interface.c (gfc_compare_interfaces): Take care of implicit typing
1700         when checking the function attribute. Plus another bugfix.
1701         (compare_parameter): Set attr.function and attr.subroutine according
1702         to the usage of a procedure as actual argument.
1703
1704 2009-06-20  Tobias Burnus  <burnus@net-b.de>
1705
1706         PR fortran/40452
1707         * trans-decl.c (add_argument_checking): Disable bounds check
1708         for allowed argument storage association.
1709
1710 2009-06-19  Paul Thomas  <pault@gcc.gnu.org>
1711
1712         PR fortran/40440
1713         * trans-expr.c (gfc_conv_procedure_call): Do not deallocate
1714         allocatable components if the argument is a pointer.
1715
1716 2009-06-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1717
1718         * gfortran.h (gfc_expr): Use mpc_t to represent complex numbers.
1719
1720         * arith.c, dump-parse-tree.c, expr.c, module.c, resolve.c,
1721         simplify.c, target-memory.c, target-memory.h, trans-const.c,
1722         trans-expr.c: Convert to mpc_t throughout.
1723
1724 2009-06-19  Ian Lance Taylor  <iant@google.com>
1725
1726         * cpp.c (struct gfc_cpp_option_data): Give this struct, used for
1727         the global variable gfc_cpp_option, a name.
1728
1729 2009-06-19  Janus Weil  <janus@gcc.gnu.org>
1730
1731         PR fortran/40450
1732         * trans-expr.c (gfc_conv_procedure_call): Only add an extra addr_expr
1733         to a procedure pointer actual argument, if it is not itself a
1734         dummy arg.
1735
1736 2009-06-18  Janus Weil  <janus@gcc.gnu.org>
1737
1738         PR fortran/40451
1739         * resolve.c (resolve_contained_fntype): Prevent implicit typing for
1740         procedures with explicit interface.
1741         * symbol.c (gfc_check_function_type): Ditto.
1742
1743 2009-06-16  Ian Lance Taylor  <iant@google.com>
1744
1745         * decl.c (build_struct): Rewrite loop over constructor elements.
1746
1747 2009-06-16  Janus Weil  <janus@gcc.gnu.org>
1748
1749         PR fortran/36947
1750         PR fortran/40039
1751         * expr.c (gfc_check_pointer_assign): Call 'gfc_compare_interfaces' with
1752         error message.
1753         * gfortran.h (gfc_compare_interfaces): Additional argument.
1754         * interface.c (operator_correspondence): Removed.
1755         (gfc_compare_interfaces): Additional argument to return error message.
1756         Directly use the code from 'operator_correspondence' instead of calling
1757         the function. Check for OPTIONAL. Some rearrangements.
1758         (check_interface1): Call 'gfc_compare_interfaces' without error message.
1759         (compare_parameter): Call 'gfc_compare_interfaces' with error message.
1760         * resolve.c (check_generic_tbp_ambiguity): Call 'gfc_compare_interfaces'
1761         without error message.
1762
1763 2009-06-16  Tobias Burnus  <burnus@net-b.de>
1764
1765         PR fortran/40383
1766         * trans-decl.c (create_function_arglist): Copy formal charlist to
1767         have a proper passed_length for -fcheck=bounds.
1768
1769 2009-06-12  Steven G. Kargl  <kargls@comcast.net>
1770
1771         * arith.c (gfc_enum_initializer): Move function ...
1772         * decl.c: ... here.  Remove gfc_ prefix and make static.
1773         (enumerator_decl): Update function call.
1774         * gfortran.h:  Remove gfc_enum_initializer prototype.
1775
1776 2009-06-12  Aldy Hernandez  <aldyh@redhat.com>
1777
1778         * trans-array.c (gfc_trans_allocate_array_storage): Pass
1779         location on down.
1780         (gfc_trans_array_constructor_value): Same.
1781         (gfc_trans_scalarized_loop_end): Same.
1782         (gfc_conv_ss_startstride): Same.
1783         (gfc_trans_g77_array): Same.
1784         (gfc_trans_dummy_array_bias): Same.
1785         (gfc_conv_array_parameter): Same.
1786         (structure_alloc_comps): Same.
1787         * trans-expr.c (gfc_conv_function_call): Same.
1788         (fill_with_spaces): Same.
1789         (gfc_trans_string_copy): Same.
1790         (gfc_trans_scalar_assign): Same.
1791         * trans-stmt.c (gfc_trans_goto): Same.
1792         (gfc_trans_if_1): Same.
1793         (gfc_trans_simple_do): Same.
1794         (gfc_trans_do): Same.
1795         (gfc_trans_do_while): Same.
1796         (gfc_trans_logical_select): Same.
1797         (gfc_trans_select): Same.
1798         (gfc_trans_forall_loop): Same.
1799         (gfc_trans_nested_forall_loop): Same.
1800         (generate_loop_for_temp_to_lhs): Same.
1801         (generate_loop_for_rhs_to_temp): Same.
1802         (gfc_trans_forall_1): Same.
1803         (gfc_trans_where_assign): Same.
1804         (gfc_trans_where_3): Same.
1805         (gfc_trans_allocate): Same.
1806         * trans.c (gfc_finish_block): Same.
1807         (gfc_trans_runtime_check): Same.
1808         (gfc_call_malloc): Same.
1809         (gfc_allocate_with_status): Same.
1810         (gfc_call_free): Same.
1811         (gfc_deallocate_with_status): Same.
1812         (gfc_call_realloc): Same.
1813         (gfc_trans_code): Same.
1814         * trans-decl.c (gfc_init_default_dt): Same.
1815         (gfc_generate_constructors): Same.
1816         * trans-io.c (gfc_trans_io_runtime_check): Same.
1817         * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
1818         (gfc_conv_intrinsic_fdate): Same.
1819         (gfc_conv_intrinsic_ttynam): Same.
1820         (gfc_conv_intrinsic_minmax): Same.
1821         (gfc_conv_intrinsic_minmax_char): Same.
1822         (gfc_conv_intrinsic_anyall): Same.
1823         (gfc_conv_intrinsic_count): Same.
1824         (gfc_conv_intrinsic_arith): Same.
1825         (gfc_conv_intrinsic_minmaxloc): Same.
1826         (gfc_conv_intrinsic_minmaxval): Same.
1827         (gfc_conv_intrinsic_rrspacing): Same.
1828         (gfc_conv_intrinsic_array_transfer): Same.
1829         (gfc_conv_intrinsic_trim): Same.
1830         (gfc_conv_intrinsic_repeat): Same.
1831         
1832 2009-06-12  Janus Weil  <janus@gcc.gnu.org>
1833
1834         PR fortran/40176
1835         * resolve.c (resolve_symbol): Additional error check, preventing an
1836         infinite loop.
1837
1838 2009-06-11  Paul Thomas  <pault@gcc.gnu.org>
1839
1840         PR fortran/40402
1841         * resolve.c (next_data_value): It is an error if the value is
1842         not constant.
1843
1844 2009-06-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1845
1846         PR fortran/38718
1847         * intrinsic.c (add_functions): Add simplifiers for ISNAN,
1848         IS_IOSTAT_END and IS_IOSTAT_EOR.
1849         * intrinsic.h (gfc_simplify_is_iostat_end, gfc_simplify_is_iostat_eor,
1850         gfc_simplify_isnan): New prototypes.
1851         * intrinsic.c (gfc_simplify_is_iostat_end, gfc_simplify_is_iostat_eor,
1852         gfc_simplify_isnan): New functions.
1853
1854 2009-06-11  Jakub Jelinek  <jakub@redhat.com>
1855
1856         * interface.c (fold_unary): Rename to...
1857         (fold_unary_intrinsic): ... this.
1858         (gfc_extend_expr): Adjust caller.
1859         (gfc_match_generic_spec): Likewise.  Initialize *op to INTRINSIC_NONE
1860         to avoid warnings.
1861         * expr.c (gfc_simplify_expr): Initialize start and end before calling
1862         gfc_extract_int.
1863
1864 2009-06-10  Dave Korn  <dave.korn.cygwin@gmail.com>
1865
1866         * trans-decl.c (create_main_function):  Don't build main decl twice.
1867
1868 2009-06-09  Tobias Burnus  <burnus@net-b.de>
1869
1870         * trans-decl.c (gfc_generate_function_code): Use gfc_option.rtcheck
1871         instead of flag_bounds_check.
1872         * intrinsic.texi (ISO_FORTRAN_ENV): Document INT{8,16,32,64} and
1873         REAL{32,64,128}.
1874
1875 2009-06-08  Paul Thomas  <pault@gcc.gnu.org>
1876
1877         * trans-array.h : Replace prototypes for
1878         gfc_conv_descriptor_offset, gfc_conv_descriptor_stride,
1879         gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound with new
1880         prototypes of the same names with _get or _set appended.
1881         * trans-array.c : Make the originals of the above static and
1882         new functions for the _get and _set functions. Update all the
1883         references to these descriptor access functions.
1884         * trans-expr.c : Update references to the above descriptor
1885         access functions.
1886         * trans-intrinsic.c : The same.
1887         * trans-openmp.c : The same.
1888         * trans-stmt.c : The same.
1889
1890 2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
1891
1892         * options.c (gfc_post_options): Disable dump_parse_tree
1893         during -fcompare-debug-second.
1894
1895 2009-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1896
1897         PR fortran/40008
1898         * gfortran.h (gfc_open): Add newunit expression to structure.
1899         * io.c (io_tag): Add new unit tag and fix whitespace.
1900         (match_open_element): Add matching for newunit.
1901         (gfc_free_open): Free the newunit expression.
1902         (gfc_resolve_open): Add newunit to resolution and check constraints.
1903         (gfc_resolve_close): Add check for non-negative unit.
1904         (gfc_resolve_filepos): Likewise.
1905         (gfc_resolve_dt): Likewise.
1906         * trans-io.c (set_parameter_value): Build runtime checks for unit
1907         numbers within range of kind=4 integer. (gfc_trans_open) Set the
1908         newunit parameter.
1909         * ioparm.def (IOPARM): Define the newunit parameter as a pointer
1910         to GFC_INTEGER_4, pint4.
1911
1912 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
1913
1914         PR fortran/25104
1915         PR fortran/29962
1916         * array.c (gfc_append_constructor): Added NULL-check.
1917         * check.c (gfc_check_spread): Check DIM.
1918         (gfc_check_unpack): Check that the ARRAY arguments provides enough
1919         values for MASK.
1920         * intrinsic.h (gfc_simplify_spread): New prototype.
1921         (gfc_simplify_unpack): Likewise.
1922         * intrinsic.c (add_functions): Added new simplifier callbacks.
1923         * simplify.c (gfc_simplify_spread): New.
1924         (gfc_simplify_unpack): New.
1925         * expr.c (check_transformational): Allow additional transformational
1926         intrinsics in initialization expression.
1927
1928 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
1929
1930         PR fortran/25104
1931         PR fortran/29962
1932         * check.c (gfc_check_all_any): Check rank of DIM.
1933         (gfc_check_count): Likewise.
1934         * intrinsic.h (gfc_simplify_all): New prototype.
1935         (gfc_simplify_any): Likewise.
1936         (gfc_simplify_count): Likewise.
1937         (gfc_simplify_sum): Likewise.
1938         (gfc_simplify_product): Likewise.
1939         * intrinsic.c (add_functions): Added new simplifier callbacks.
1940         * simplify.c (transformational_result): New.
1941         (simplify_transformation_to_scalar): New.
1942         (simplify_transformation_to_array): New.
1943         (gfc_count): New.
1944         (gfc_simplify_all): New.
1945         (gfc_simplify_any): New.
1946         (gfc_simplify_count): New.
1947         (gfc_simplify_sum): New.
1948         (gfc_simplify_product): New.
1949         * expr.c (check_transformational): Allow additional transformational
1950         intrinsics in initialization expression.
1951
1952 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
1953
1954         * check.c (dim_rank_check): Return SUCCESS if DIM=NULL.
1955         (gfc_check_lbound): Removed (now) redundant check for DIM=NULL.
1956         (gfc_check_minloc_maxloc): Likewise.
1957         (check_reduction): Likewise.
1958         (gfc_check_size): Likewise.
1959         (gfc_check_ubound): Likewise.
1960         (gfc_check_cshift): Added missing shape-conformance checks.
1961         (gfc_check_eoshift): Likewise.
1962         * gfortran.h (gfc_check_conformance): Modified prototype to printf-style.
1963         * expr.c (gfc_check_conformance): Accept error-message chunks in 
1964         printf-style. Changed all callers.
1965
1966
1967 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
1968
1969         PR fortran/25104
1970         PR fortran/29962
1971         * intrinsic.h (gfc_simplify_dot_product): New prototype.
1972         (gfc_simplify_matmul): Likewise.
1973         (gfc_simplify_transpose): Likewise.
1974         * intrinsic.c (add_functions): Added new simplifier callbacks.
1975         * simplify.c (init_result_expr): New.
1976         (compute_dot_product): New.
1977         (gfc_simplify_dot_product): New.
1978         (gfc_simplify_matmul): New.
1979         (gfc_simplify_transpose): New.
1980         * expr.c (check_transformational): Allow transformational intrinsics
1981         with simplifier in initialization expression.
1982
1983 2009-06-06  Daniel Franke  <franke.daniel@gmail.com>
1984
1985         PR fortran/37203
1986         * simplify.c (gfc_simplify_reshape): Fixed reshaping of empty arrays
1987         without padding.
1988
1989 2009-06-06  Daniel Franke  <franke.daniel@gmail.com>
1990
1991         PR fortran/32890
1992         * intrinsic.h (gfc_simplify_pack): New prototype.
1993         * intrinsic.c (add_functions): Added
1994         simplifier-callback to PACK.
1995         * simplify.c (is_constant_array_expr): Moved
1996         to beginning of file.
1997         (gfc_simplify_pack): New.
1998         * check.c (gfc_check_pack): Check that VECTOR has enough elements.
1999         Added safeguards for empty arrays.
2000
2001 2009-06-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2002
2003         * simplify.c (call_mpc_func): Use mpc_realref/mpc_imagref
2004         instead of MPC_RE/MPC_IM.
2005
2006 2009-06-05  Alexandre Oliva  <aoliva@redhat.com>
2007
2008         * trans-decl.c (gfc_build_qualified_array): Don't skip generation
2009         of range types.
2010         * trans.h (struct lang_type): Add base_decls.
2011         (GFC_TYPE_ARRAY_BASE_DECL): New.
2012         * trans-types.c (gfc_get_array_type_bounds): Initialize base decls
2013         proactively and excessively.
2014         (gfc_get_array_descr_info): Use existing base decls if available.
2015
2016 2009-06-04  Daniel Franke  <franke.daniel@gmail.com>
2017
2018         PR fortran/37203
2019         * check.c (gfc_check_reshape): Additional checks for the
2020         SHAPE and ORDER arguments.
2021         * simplify.c (gfc_simplify_reshape): Converted argument checks
2022         to asserts.
2023
2024 2009-06-03  Tobias Burnus  <burnus@net-b.de>
2025
2026         * gfortran.texi: Add mixed-language programming, mention
2027         varying string lengths, some clean up of introduction parts.
2028         * intrinsic.texi (instrinsic modules): Create @menu for subsections.
2029         (ISO_C_BINDING): Support ISOCBINDING_INT_FAST128_T.
2030         * libgfortran.h: Comment to rember to keep gfortran.texi in sync.
2031         * iso-c-binding.def: Support ISOCBINDING_INT_FAST128_T.
2032
2033 2009-06-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2034             Tobias Burnus  <burnus@net-b.de>
2035
2036         * iso-c-binding.def: Use INTMAX_TYPE instead of intmax_type_node.
2037         * trans-types.c (init_c_interop_kinds): Remove intmax_type_node.
2038
2039 2009-06-03  Alexandre Oliva  <aoliva@redhat.com>
2040
2041         * module.c (mio_f2k_derived): Initialize cur.
2042
2043 2009-06-01  Tobias Burnus  <burnus@net-b.de>
2044
2045         PR fortran/40309
2046         * trans-decl.c (gfc_sym_identifier): Use "MAIN__" for PROGRAM "main".
2047         (create_main_function): Set main_identifier_node.
2048
2049 2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2050
2051         PR fortran/40019
2052         * trans-types.c (gfc_build_uint_type): Make nonstatic.
2053         * trans.h (gfor_fndecl_clz128, gfor_fndecl_ctz128): New prototypes.
2054         * trans-types.h (gfc_build_uint_type): Add prototype.
2055         * trans-decl.c (gfc_build_intrinsic_function_decls): Build
2056         gfor_fndecl_clz128 and gfor_fndecl_ctz128.
2057         * trans-intrinsic.c (gfc_conv_intrinsic_leadz,
2058         gfc_conv_intrinsic_trailz): Call the right builtins or library
2059         functions, and cast arguments to unsigned types first.
2060         * simplify.c (gfc_simplify_leadz): Deal with negative arguments.
2061
2062 2009-05-27  Ian Lance Taylor  <iant@google.com>
2063
2064         * Make-lang.in (gfortran$(exeext)): Change $(COMPILER) to
2065         $(LINKER).
2066         (f951$(exeext)): Likewise.
2067
2068 2009-05-27  Tobias Burnus  <burnus@net-b.de>
2069
2070         PR fortran/40270
2071         * trans-decl.c (create_main_function): Mark MAIN__ and
2072         argc/argv as TREE_USED and push/pop function_decl context
2073         if needed.
2074
2075 2009-05-26  Tobias Burnus  <burnus@net-b.de>
2076
2077         PR fortran/39178
2078         * gfortranspec.c (lang_specific_driver): Stop linking
2079         libgfortranbegin.
2080         * trans-decl.c (gfc_build_builtin_function_decls): Stop
2081         making MAIN__ publicly visible.
2082         (gfc_build_builtin_function_decls): Add
2083         gfor_fndecl_set_args.
2084         (create_main_function) New function.
2085         (gfc_generate_function_code): Use it.
2086
2087 2009-05-26  Tobias Burnus  <burnus@net-b.de>
2088
2089         PR fortran/40246
2090         * match.c (gfc_match_nullify): NULLify freed pointer.
2091
2092 2009-05-26  Ian Lance Taylor  <iant@google.com>
2093
2094         * Make-lang.in (gfortranspec.o): Use $(COMPILER).
2095         (gfortran$(exeext), f951$(exeext), fortran/cpp.o): Likewise.
2096
2097 2009-05-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2098
2099         * gfortran.h (GFC_MPC_RND_MODE): New.
2100         * simplify.c (call_mpc_func): New helper function.
2101         (gfc_simplify_cos, gfc_simplify_exp, gfc_simplify_log,
2102         gfc_simplify_sin, gfc_simplify_sqrt): Add MPC support.
2103
2104 2009-05-25  Janus Weil  <janus@gcc.gnu.org>
2105
2106         PR fortran/40176
2107         * primary.c (gfc_match_varspec): Handle procedure pointer components
2108         with array return value.
2109         * resolve.c (resolve_expr_ppc): Ditto.
2110         (resolve_symbol): Make sure the interface of a procedure pointer has
2111         been resolved.
2112         * trans-array.c (gfc_walk_function_expr): Handle procedure pointer
2113         components with array return value.
2114         * trans-expr.c (gfc_conv_component_ref,gfc_conv_procedure_call,
2115         gfc_trans_arrayfunc_assign): Ditto.
2116         (gfc_trans_pointer_assignment): Handle procedure pointer assignments,
2117         where the rhs is a dummy argument.
2118         * trans-types.c (gfc_get_ppc_type,gfc_get_derived_type): Handle
2119         procedure pointer components with array return value.
2120
2121 2009-05-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2122             Dominique Dhumieres
2123
2124         PR fortran/35732
2125         PR fortran/39872
2126         * trans-array.c (gfc_conv_ss_startstride): Add one to index.
2127
2128 2009-05-22  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2129
2130         PR fortran/40195
2131         * module.c (read_md5_from_module_file): Close file before returning.
2132
2133 2009-05-18  Janus Weil  <janus@gcc.gnu.org>
2134
2135         PR fortran/40164
2136         * primary.c (gfc_match_rvalue): Handle procedure pointer components in
2137         arrays.
2138         * resolve.c (resolve_ppc_call,resolve_expr_ppc): Resolve component and
2139         array references.
2140         (resolve_fl_derived): Procedure pointer components are not required to
2141         have constant array bounds in their return value.
2142
2143 2009-05-18  Janus Weil  <janus@gcc.gnu.org>
2144
2145         * intrinsic.c (add_sym): Fix my last commit (r147655),
2146         which broke bootstrap.
2147
2148 2009-05-18  Richard Guenther  <rguenther@suse.de>
2149
2150         PR fortran/40168
2151         * trans-expr.c (gfc_trans_zero_assign): For local array
2152         destinations use an assignment from an empty constructor.
2153
2154 2009-05-18  Janus Weil  <janus@gcc.gnu.org>
2155
2156         PR fortran/36947
2157         PR fortran/40039
2158         * expr.c (gfc_check_pointer_assign): Check intents when comparing
2159         interfaces.
2160         * gfortran.h (typedef struct gfc_intrinsic_arg): Add 'intent' member.
2161         (gfc_compare_interfaces): Additional argument.
2162         * interface.c (operator_correspondence): Add check for equality of
2163         intents, and new argument 'intent_check'.
2164         (gfc_compare_interfaces): New argument 'intent_check', which is passed
2165         on to operator_correspondence.
2166         (check_interface1): Don't check intents when comparing interfaces.
2167         (compare_parameter): Do check intents when comparing interfaces.
2168         * intrinsic.c (add_sym): Add intents for arguments of intrinsic
2169         procedures.
2170         (add_sym_1,add_sym_1s,add_sym_1m,add_sym_2,add_sym_2s,add_sym_3,
2171         add_sym_3ml,add_sym_3red,add_sym_3s,add_sym_4): Use INTENT_IN by
2172         default.
2173         (add_sym_1_intent,add_sym_1s_intent,add_sym_2s_intent,add_sym_3s_intent)
2174         : New functions to add intrinsic symbols, specifying custom intents.
2175         (add_sym_4s,add_sym_5s): Add new arguments to specify intents.
2176         (add_functions,add_subroutines): Add intents for various intrinsics.
2177         * resolve.c (check_generic_tbp_ambiguity): Don't check intents when
2178         comparing interfaces.
2179         * symbol.c (gfc_copy_formal_args_intr): Copy intent.
2180
2181 2009-05-17  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2182
2183         * iso-fortran-env.def: Define INT8, INT16, INT32, INT64, REAL32,
2184         REAL64 and REAL128.
2185         * gfortran.h (gfc_get_int_kind_from_width_isofortranenv,
2186         gfc_get_real_kind_from_width_isofortranenv): New prototypes.
2187         * iso-c-binding.def: Update definitions for the INT*_T,
2188         INT_LEAST*_T and INT_FAST*_T named parameters.
2189         * trans-types.c (get_typenode_from_name, get_int_kind_from_name,
2190         gfc_get_real_kind_from_width_isofortranenv): New functions.
2191
2192 2009-05-17  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2193
2194         PR fortran/36260
2195         * intrinsic.c (add_functions, add_subroutines): Fix argument
2196         names and wrap long lines.
2197         * intrinsic.texi: Fix documentation and argument names of
2198         LOG_GAMMA, DATAN2, DBESJN, DTIME, ETIME, FSTAT, STAT, LSTAT,
2199         GET_COMMAND, IDATE, LTIME, MOVE_ALLOC, NINT, OR, PRODUCT,
2200         SUM, RAND, RANDOM_SEED, REAL, SELECTED_INT_KIND,
2201         SELECTED_REAL_KIND and XOR.
2202
2203 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2204
2205         PR fortran/33197
2206         * intrinsic.c (add_functions): Use ERFC_SCALED simplification.
2207         * intrinsic.h (gfc_simplify_erfc_scaled): New prototype.
2208         * simplify.c (fullprec_erfc_scaled, asympt_erfc_scaled,
2209         gfc_simplify_erfc_scaled): New functions.
2210
2211 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2212
2213         PR fortran/31243
2214         * resolve.c (resolve_substring): Don't allow too large substring
2215         indexes.
2216         (gfc_resolve_substring_charlen): Fix typo.
2217         (gfc_resolve_character_operator): Fix typo.
2218         (resolve_charlen): Catch unreasonably large string lengths.
2219         * simplify.c (gfc_simplify_len): Don't error out on LEN
2220         range checks.
2221
2222 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2223
2224         PR fortran/36031
2225         * decl.c (set_enum_kind): Use global short-enums flag.
2226         * gfortran.h (gfc_option_t): Remove short_enums flag.
2227         * lang.opt (-fshort-enums): Refer to C documentation.
2228         * options.c (gfc_init_options, gfc_handle_option): Use global
2229         short-enums flag.
2230
2231 2009-05-15  Tobias Burnus  <burnus@net-b.de>
2232
2233         PR fortran/39352
2234         * f95-lang.c: Add gfc_maybe_initialize_eh.
2235         * gfortran.h: Add gfc_maybe_initialize_eh prototype.
2236         * Make-lang.in: Add new .h dendencies for f95-lang.c
2237         * openmp.c (resolve_omp_do): Call gfc_maybe_initialize_eh.
2238         * misc.c (gfc_free): Avoid #define trickery for free.
2239
2240 2009-05-14  Steven G. Kargl  <kargl@gcc.gnu.org>
2241
2242         * dump-parse-tree.c (show_code_node): Add ERRMSG to the dumping
2243         of allocate and deallocate statements.
2244
2245 2009-05-14  Ian Lance Taylor  <iant@google.com>
2246
2247         * decl.c (match_attr_spec): Change d to unsigned int.
2248         * dump-parse-tree.c (show_namespace): Change op to int.  Add cast.
2249         * interface.c (gfc_check_interfaces): Change i to int.  Add casts.
2250         * module.c (read_module): Change i to int.  Add cast.
2251         (write_module): Change i to int.
2252         * symbol.c (gfc_get_namespace): Change in to int.
2253         (gfc_free_namespace): Change i to int.
2254         * trans-io.c (gfc_build_io_library_fndecls): Change ptype to
2255         unsigned int.  Add cast.
2256         * trans-types.c (gfc_init_kinds): Change mode to unsigned int.
2257         Add casts.
2258
2259 2009-05-14  Daniel Kraft  <d@domob.eu>
2260
2261         PR fortran/40045
2262         * dump-parse-tree.c (show_typebound): Fix missing adaption to new
2263         type-bound procedure storage structure.
2264
2265 2009-05-14  Janus Weil  <janus@gcc.gnu.org>
2266
2267         PR fortran/39996
2268         * decl.c (gfc_match_function_decl): Use gfc_add_type.
2269         * symbol.c (gfc_add_type): Better checking for duplicate types in
2270         function declarations. And: Always give an error for duplicte types,
2271         not just a warning with -std=gnu.
2272
2273 2009-05-14  Jakub Jelinek  <jakub@redhat.com>
2274
2275         PR fortran/39865
2276         * io.c (resolve_tag_format): CHARACTER array in FMT= argument
2277         isn't an extension.  Reject non-CHARACTER array element of
2278         assumed shape or pointer or assumed size array.
2279         * trans-array.c (array_parameter_size): New function.
2280         (gfc_conv_array_parameter): Add size argument.  Call
2281         array_parameter_size if it is non-NULL.
2282         * trans-array.h (gfc_conv_array_parameter): Adjust prototype.
2283         * trans-expr.c (gfc_conv_function_call, gfc_trans_arrayfunc_assign):
2284         Adjust callers.
2285         * trans-intrinsic.c (gfc_conv_intrinsic_loc): Likewise.
2286         * trans-io.c (gfc_convert_array_to_string): Rewritten.
2287
2288 2009-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
2289
2290         * gfortran.h (gfc_code): Rename struct member expr to expr1.
2291         * openmp.c (resolve_omp_atomic): Update expr to expr1.
2292         * interface.c (gfc_extend_assign): Ditto.
2293         * trans-expr.c (gfc_conv_expr_reference, gfc_trans_assignment,
2294         gfc_trans_init_assign): Ditto.
2295         * dump-parse-tree.c (show_code_node): Ditto.
2296         * trans-openmp.c (gfc_trans_omp_atomic): Ditto.
2297         * trans-stmt.c ( gfc_trans_label_assign, gfc_trans_goto, gfc_trans_call,
2298         gfc_trans_return, gfc_trans_pause, gfc_trans_stop, gfc_trans_if_1,
2299         gfc_trans_arithmetic_if, gfc_trans_do_while, gfc_trans_integer_select,
2300         gfc_trans_logical_select, gfc_trans_character_select
2301         forall_make_variable_temp, check_forall_dependencies
2302         gfc_trans_forall_1, gfc_trans_where_2, gfc_trans_where_3
2303         gfc_trans_where, gfc_trans_allocate, gfc_trans_deallocate): Ditto.
2304         * io.c (match_io_element, gfc_match_inquire): Ditto.
2305         * resolve.c (resolve_typebound_call, resolve_ppc_call,
2306         resolve_allocate_expr, resolve_allocate_deallocate, resolve_select,
2307         resolve_transfer, resolve_where, gfc_resolve_assign_in_forall,
2308         gfc_resolve_blocks, resolve_code, build_init_assign): Ditto.
2309         * st.c (gfc_free_statement): Ditto.
2310         * match.c (gfc_match_assignment, gfc_match_pointer_assignment,
2311         match_arithmetic_if, gfc_match_if, gfc_match_elseif
2312         gfc_match_stopcode, gfc_match_assign, gfc_match_goto,
2313         gfc_match_nullify, match_typebound_call, gfc_match_call
2314         gfc_match_select, match_simple_where, gfc_match_where
2315         gfc_match_elsewhere, match_simple_forall, gfc_match_forall): Ditto.
2316         * trans-io.c (gfc_trans_transfer): Ditto.
2317         * parse.c (parse_where_block, parse_if_block): Ditto.
2318
2319 2009-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
2320
2321         * gfortran.h (gfc_code): Rename struct member label to label1.
2322         * dump-parse-tree.c (show_code_node): Update symbol.
2323         * trans-stmt.c (gfc_trans_label_assign, gfc_trans_goto,
2324         gfc_trans_arithmetic_if): Ditto.
2325         * resolve.c (gfc_resolve_blocks, resolve_code): Ditto.
2326         * match.c (match_arithmetic_if, gfc_match_if, gfc_reference_st_label,
2327         gfc_match_assign, gfc_match_goto): Ditto.
2328         * parse.c (parse_do_block): Ditto.
2329
2330 2009-05-13  Tobias Burnus  <burnus@net-b.de>
2331
2332         PR fortran/34153
2333         * gfortran.h (gfc_exec_op): Add EXEC_END_PROCEDURE.
2334         * dump-parse-tree.c (show_code_node): Use EXEC_END_PROCEDURE.
2335         * trans.c (gfc_trans_code): Ditto.
2336         * resolve.c (resolve_code): Ditto.
2337         * st.c (gfc_free_statement): Ditto.
2338         * parse.c (accept_statement): Ditto.
2339
2340 2009-05-12  Tobias Burnus  <burnus@net-b.de>
2341
2342         PR fortran/40110
2343         * decl.c (gfc_match_kind_spec): Turn C kind error into a warning.
2344
2345 2009-05-11  Steve Ellcey  <sje@cup.hp.com>
2346
2347         * resolve.c (check_host_association): Initialize tail.
2348
2349 2009-05-11  Janus Weil  <janus@gcc.gnu.org>
2350
2351         PR fortran/40089
2352         * resolve.c (resolve_fl_derived): Only return FAILURE if
2353         gfc_notify_std fails.
2354
2355 2009-05-10  Ian Lance Taylor  <iant@google.com>
2356
2357         * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
2358         gfc_omp_clauses.
2359         (enum gfc_omp_default_sharing): Likewise.
2360         * module.c (enum gfc_rsym_state): New enum, broken out of
2361         pointer_info.
2362         (enum gfc_wsym_state): Likewise.
2363         * parse.c (enum state_order): New enum, broken out of st_state.
2364
2365 2009-05-10  Paul Thomas  <pault@gcc.gnu.org>
2366
2367         PR fortran/40018
2368         * trans-array.c (gfc_trans_array_constructor_value): Fold
2369         convert numeric constants.
2370         (gfc_build_constant_array_constructor): The same.
2371
2372 2009-05-10  Paul Thomas  <pault@gcc.gnu.org>
2373
2374         PR fortran/38863
2375         * trans-expr.c (gfc_conv_operator_assign): Remove function.
2376         * trans.h : Remove prototype for gfc_conv_operator_assign.
2377         * trans-stmt.c (gfc_conv_elemental_dependencies): Initialize
2378         derivde types with intent(out).
2379         (gfc_trans_call): Add mask, count1 and invert arguments. Add
2380         code to use mask for WHERE assignments.
2381         (gfc_trans_forall_1): Use new arguments for gfc_trans_call.
2382         (gfc_trans_where_assign): The gfc_symbol argument is replaced
2383         by the corresponding code. If this has a resolved_sym, then
2384         gfc_trans_call is called. The call to gfc_conv_operator_assign
2385         is removed.
2386         (gfc_trans_where_2): Change the last argument in the call to
2387         gfc_trans_where_assign.
2388         * trans-stmt.h : Modify prototype for gfc_trans_call.
2389         * trans.c (gfc_trans_code): Use new args for gfc_trans_call.
2390
2391 2009-05-08  Janus Weil  <janus@gcc.gnu.org>
2392
2393         PR fortran/39876
2394         * intrinsic.c (gfc_is_intrinsic): Do not add the EXTERNAL attribute if
2395         the symbol is a module procedure.
2396
2397 2009-05-08  Tobias Burnus  <burnus@net-b.de>
2398
2399         * invoke.texi: Add do/recursion to the -fcheck= summary.
2400
2401 2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2402
2403         PR fortran/38830
2404         * gfortran.texi: Document that we don't support variable FORMAT
2405         expressions.
2406
2407 2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2408
2409         PR fortran/39576
2410         * error.c (error_print): Add missing break statement.
2411
2412 2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2413
2414         PR fortran/36382
2415         * invoke.texi: Document that -fdollar-ok does not allow $ to be
2416         used in IMPLICIT statement.
2417
2418 2009-05-06  Janus Weil  <janus@gcc.gnu.org>
2419             Paul Thomas  <pault@gcc.gnu.org>
2420
2421         PR fortran/39630
2422         * decl.c (match_procedure_interface): New function to match the
2423         interface for a PROCEDURE statement.
2424         (match_procedure_decl): Call match_procedure_interface.
2425         (match_ppc_decl): New function to match the declaration of a
2426         procedure pointer component.
2427         (gfc_match_procedure):  Call match_ppc_decl.
2428         (match_binding_attributes): Add new argument 'ppc' and handle the
2429         POINTER attribute for procedure pointer components.
2430         (match_procedure_in_type,gfc_match_generic): Added new argument to
2431         match_binding_attributes.
2432         * dump-parse-tree.c (show_expr,show_components,show_code_node): Handle
2433         procedure pointer components.
2434         * expr.c (free_expr0,gfc_copy_expr,gfc_simplify_expr): Handle EXPR_PPC.
2435         (gfc_check_pointer_assign): Handle procedure pointer components, but no
2436         full checking yet.
2437         (is_proc_ptr_comp): New function to determine if an expression is a
2438         procedure pointer component.
2439         * gfortran.h (expr_t): Add EXPR_PPC.
2440         (symbol_attribute): Add new member 'proc_pointer_comp'.
2441         (gfc_component): Add new member 'formal'.
2442         (gfc_exec_op): Add EXEC_CALL_PPC.
2443         (gfc_get_default_type): Changed first argument.
2444         (is_proc_ptr_comp): Add prototype.
2445         (gfc_match_varspec): Add new argument.
2446         * interface.c (compare_actual_formal): Handle procedure pointer
2447         components.
2448         * match.c (gfc_match_pointer_assignment,match_typebound_call): Handle
2449         procedure pointer components.
2450         * module.c (mio_expr): Handle EXPR_PPC.
2451         * parse.c (parse_derived): Handle procedure pointer components.
2452         * primary.c (gfc_match_varspec): Add new argument 'ppc_arg' and handle
2453         procedure pointer components.
2454         (gfc_variable_attr): Handle procedure pointer components.
2455         (gfc_match_rvalue): Added new argument to gfc_match_varspec and changed
2456         first argument of gfc_get_default_type.
2457         (match_variable): Added new argument to gfc_match_varspec.
2458         * resolve.c (resolve_entries,set_type,resolve_fl_parameter): Changed
2459         first argument of gfc_get_default_type.
2460         (resolve_structure_cons,resolve_actual_arglist): Handle procedure
2461         pointer components.
2462         (resolve_ppc_call): New function to resolve a call to a procedure
2463         pointer component (subroutine).
2464         (resolve_expr_ppc): New function to resolve a call to a procedure
2465         pointer component (function).
2466         (gfc_resolve_expr): Handle EXPR_PPC.
2467         (resolve_code): Handle EXEC_CALL_PPC.
2468         (resolve_fl_derived): Copy the interface for a procedure pointer
2469         component.
2470         (resolve_symbol): Fix overlong line.
2471         * st.c (gfc_free_statement): Handle EXEC_CALL_PPC.
2472         * symbol.c (gfc_get_default_type): Changed first argument.
2473         (gfc_set_default_type): Changed first argument of gfc_get_default_type.
2474         (gfc_add_component): Initialize ts.type to BT_UNKNOWN.
2475         * trans.h (gfc_conv_function_call): Renamed.
2476         * trans.c (gfc_trans_code): Handle EXEC_CALL_PPC.
2477         * trans-expr.c (gfc_conv_component_ref): Ditto.
2478         (gfc_conv_function_val): Rename to 'conv_function_val', add new
2479         argument 'expr' and handle procedure pointer components.
2480         (gfc_conv_operator_assign): Renamed gfc_conv_function_val.
2481         (gfc_apply_interface_mapping_to_expr): Handle EXPR_PPC.
2482         (gfc_conv_function_call): Rename to 'gfc_conv_procedure_call', add new
2483         argument 'expr' and handle procedure pointer components.
2484         (gfc_get_proc_ptr_comp): New function to get the backend decl for a
2485         procedure pointer component.
2486         (gfc_conv_function_expr): Renamed gfc_conv_function_call.
2487         (gfc_conv_structure): Handle procedure pointer components.
2488         * trans-intrinsic.c (gfc_conv_intrinsic_funcall,
2489         conv_generic_with_optional_char_arg): Renamed gfc_conv_function_call.
2490         * trans-stmt.h (gfc_get_proc_ptr_comp): Add prototype.
2491         * trans-stmt.c (gfc_trans_call): Renamed gfc_conv_function_call.
2492         * trans-types.h (gfc_get_ppc_type): Add prototype.
2493         * trans-types.c (gfc_get_ppc_type): New function to build a tree node
2494         for a procedure pointer component.
2495         (gfc_get_derived_type): Handle procedure pointer components.
2496
2497 2009-05-06  Tobias Burnus  <burnus@net-b.de>
2498
2499         PR fortran/40041
2500         * resolve.c (resolve_symbol): Print no warning for implicitly
2501         typed intrinsic functions.
2502
2503 2009-05-05  Janus Weil  <janus@gcc.gnu.org>
2504
2505         PR fortran/39998
2506         * expr.c (gfc_check_pointer_assign): Check for statement functions and
2507         internal procedures in procedure pointer assignments.
2508
2509 2009-04-28  Janus Weil  <janus@gcc.gnu.org>
2510
2511         PR fortran/39946
2512         * resolve.c (resolve_symbol): Correctly copy the interface of a
2513         PROCEDURE statement if the interface involves a RESULT variable.
2514
2515 2009-04-28  Janus Weil  <janus@gcc.gnu.org>
2516
2517         PR fortran/39930
2518         PR fortran/39931
2519         * expr.c (gfc_check_pointer_assign): Correctly detect if the left hand
2520         side is a pointer.
2521         * parse.c (gfc_fixup_sibling_symbols): Don't check for ambiguity.
2522
2523 2009-04-28  Paul Thomas  <pault@gcc.gnu.org>
2524
2525         PR fortran/39879
2526         * trans_expr.c (gfc_conv_procedure_call): Deep copy a derived
2527         type parentheses argument if it is a variable with allocatable
2528         components.
2529
2530 2009-04-27  Ian Lance Taylor  <iant@google.com>
2531
2532         * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum
2533         type.
2534         * trans-io.c (st_parameter_field): Add casts to enum type.
2535
2536 2009-04-26  Steven G. Kargl  <kargl@gcc.gnu.org>
2537
2538         PR fortran/39893
2539         fortran/data.c (gfc_assign_data_value): If the lvalue is an 
2540         assumed character length entity in a data statement, then 
2541         return FAILURE to prevent segmentation fault.
2542
2543 2009-04-26  Jakub Jelinek  <jakub@redhat.com>
2544
2545         * trans-decl.c: Include pointer-set.h.
2546         (nonlocal_dummy_decl_pset, tree nonlocal_dummy_decls): New variables.
2547         (gfc_nonlocal_dummy_array_decl): New function.
2548         (gfc_get_symbol_decl): Call it for non-local dummy args with saved
2549         descriptor.
2550         (gfc_get_symbol_decl): Set DECL_BY_REFERENCE when needed.
2551         (gfc_generate_function_code): Initialize nonlocal_dummy_decl{s,_pset},
2552         chain it to outermost block's vars, destroy it afterwards.
2553         * Make-lang.in (trans-decl.o): Depend on pointer-set.h.
2554
2555 2009-04-25  Janus Weil  <janus@gcc.gnu.org>
2556
2557         PR fortran/39688
2558         * decl.c (gfc_match_import): Use 'sym->name' instead of 'name'.
2559         They differ if the symbol has been use-renamed.
2560
2561 2009-04-24  Ian Lance Taylor  <iant@google.com>
2562
2563         * gfortran.h (enum gfc_symbol_type): New named enum type, broken
2564         out of struct gfc_symbol.
2565         (struct gfc_symbol): Use enum gfc_symbol_type.
2566         (enum gfc_array_ref_dimen_type): New named enum type, broken out
2567         of struct gfc_array_ref).
2568         (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
2569         (mod_pointee_as): Update declaration.
2570         * decl.c (add_global_entry): Change type to enum gfc_symbol_type.
2571         (gfc_mod_pointee_as): Change return type to "match".
2572         * module.c (mio_array_ref): Add cast to enum type.
2573         (mio_symbol): Likewise.
2574         * resolve.c (resolve_global_procedure): Change type to enum
2575         gfc_symbol_type.
2576         * trans-io.c (gfc_build_st_parameter): Change type to unsigned
2577         int.
2578
2579 2009-04-24  Daniel Kraft  <d@domob.eu>
2580
2581         * gfortran.h (gfc_get_typebound_proc): Removed as macro, now a function.
2582         (struct gfc_symtree): Moved "typebound" member inside union.
2583         (struct gfc_namespace): Add "tb_sym_root" as new symtree to sort out
2584         type-bound procedures there.
2585         (gfc_get_tbp_symtree): New procedure.
2586         * symbol.c (tentative_tbp_list): New global.
2587         (gfc_get_namespace): NULL new "tb_sym_root" member.
2588         (gfc_new_symtree): Removed initialization of "typebound" member.
2589         (gfc_undo_symbols): Process list of tentative tbp's.
2590         (gfc_commit_symbols): Ditto.
2591         (free_tb_tree): New method.
2592         (gfc_free_namespace): Call it.
2593         (gfc_get_typebound_proc): New method.
2594         (gfc_get_tbp_symtree): New method.
2595         (gfc_find_typebound_proc): Adapt to structural changes of gfc_symtree
2596         and gfc_namespace with regards to tbp's.
2597         * dump-parse-tree.c (show_typebound): Ditto.
2598         * primary.c (gfc_match_varspec): Ditto.  Don't reference tbp-symbol
2599         as it isn't a symbol any longer.
2600         * module.c (mio_typebound_symtree): Adapt to changes.
2601         (mio_typebound_proc): Ditto, create symtrees using "gfc_get_tbp_symtree"
2602         rather than "gfc_get_sym_tree".
2603         (mio_f2k_derived): Ditto.
2604         * decl.c (match_procedure_in_type): Ditto.
2605         (gfc_match_generic): Ditto.  Don't reference tbp-symbol.
2606         * resolve.c (check_typebound_override): Adapt to changes.
2607         (resolve_typebound_generic): Ditto.
2608         (resolve_typebound_procedures): Ditto.
2609         (ensure_not_abstract_walker): Ditto.
2610         (ensure_not_abstract): Ditto.
2611         (resolve_typebound_procedure): Ditto, ignore erraneous symbols (for
2612         instance, through removed tentative ones).
2613         * gfc-internals.texi (Type-bound procedures): Document changes.
2614
2615 2009-04-24  Janus Weil  <janus@gcc.gnu.org>
2616
2617         PR fortran/39861
2618         PR fortran/39864
2619         * symbol.c (gfc_copy_formal_args_intr): Set attr.flavor and attr.dummy
2620         for the formal arguments.
2621
2622 2009-04-21  Taras Glek <tglek@mozilla.com>
2623
2624         * f95-lang.c: Update GTY annotations to new syntax.
2625         * trans-intrinsic.c: Likewise.
2626         * trans-io.c: Likewise.
2627         * trans.h: Likewise.
2628
2629 2009-04-22  Janus Weil  <janus@gcc.gnu.org>
2630
2631         PR fortran/39735
2632         * decl.c (add_hidden_procptr_result): Bugfix for procptr results.
2633         (match_procedure_decl): Set if_source.
2634         * expr.c (gfc_check_pointer_assign): Bugfix: Return after error.
2635         And: Check interface also for IFSRC_UNKNOWN (return type may be known).
2636         * gfortran.h (typedef enum ifsrc): Remove IFSRC_USAGE,
2637         add documentation. Rename copy_formal_args and copy_formal_args_intr.
2638         * interface.c (gfc_compare_interfaces): Check for return types,
2639         handle IFSRC_UNKNOWN.
2640         (compare_intr_interfaces,compare_actual_formal_intr): Obsolete, removed.
2641         (gfc_procedure_use): Modified handling of intrinsics.
2642         * intrinsic.c (add_functions): Bugfix for "dim".
2643         * resolve.c (resolve_intrinsic): New function to resolve intrinsics,
2644         which copies the interface from isym to sym.
2645         (resolve_procedure_expression,resolve_function): Use new function
2646         'resolve_intrinsic'.
2647         (resolve_symbol): Add function attribute for externals with return type
2648         and use new function 'resolve_intrinsic'.
2649         * symbol.c (ifsrc_types): Remove string for IFSRC_USAGE.
2650         (copy_formal_args): Renamed to gfc_copy_formal_args.
2651         (copy_formal_args_intr): Renamed to gfc_copy_formal_args_intr.
2652         * trans-const.c (gfc_conv_const_charlen): Handle cl==NULL.
2653
2654 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
2655
2656         * ChangeLog, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004,
2657         ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008,
2658         ChangeLog.ptr, config-lang.in, ioparm.def, mathbuiltins.def: Add
2659         copyright and license notices.
2660         * ChangeLog, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
2661         ChangeLog-2008: Correct dates.
2662
2663 2009-04-20  Tobias Burnus  <burnus@net-b.de>
2664
2665         PR fortran/39811
2666         * scanner.c (load_line): Fix bogus "&" compile-time diagnostic.
2667
2668 2009-04-20  Paul Thomas  <pault@gcc.gnu.org>
2669
2670         PR fortran/39800
2671         * resolve.c (is_sym_host_assoc): New function.
2672         (resolve_fl_derived): Call it when checking PRIVATE components
2673         of PUBLIC derived types.  Change gfc_error to a gfc_notify_std
2674         with std=f2003.
2675         (resolve_fl_namelist): Call it twice to check for host
2676         association.
2677
2678 2009-04-20  Ian Lance Taylor  <iant@google.com>
2679
2680         * module.c (import_iso_c_binding_module): Add casts to enum type.
2681         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Change op to enum
2682         tree_code.
2683         (gfc_conv_intrinsic_anyall): Likewise.
2684         (gfc_conv_intrinsic_arith): Likewise.
2685         (gfc_conv_intrinsic_minmaxloc): Likewise.
2686         (gfc_conv_intrinsic_minmaxval): Likewise.
2687         (gfc_conv_intrinsic_bitop): Likewise.
2688         (gfc_conv_intrinsic_singlebitop): Likewise.
2689         (gfc_conv_intrinsic_strcmp): Likewise.
2690
2691 2009-04-20  Vasilis Liaskovitis  <vliaskov@gmail.com>
2692             Jakub Jelinek  <jakub@redhat.com>
2693
2694         PR fortran/35423
2695         * trans.h (OMPWS_WORKSHARE_FLAG, OMPWS_CURR_SINGLEUNIT,
2696         OMPWS_SCALARIZER_WS, OMPWS_NOWAIT): Define.
2697         (ompws_flags): New extern decl.
2698         * trans-array.c (gfc_trans_scalarized_loop_end): Build OMP_FOR
2699         for the outer dimension if ompws_flags allow it.
2700         * trans.c (gfc_generate_code): Clear ompws_flags.
2701         * trans-expr.c (gfc_trans_assignment_1): Allow worksharing
2702         array assignments inside of !$omp workshare.
2703         * trans-stmt.c (gfc_trans_where_3): Similarly for where statements
2704         and constructs.
2705         * trans-openmp.c (ompws_flags): New variable.
2706         (gfc_trans_omp_workshare): Rewritten.
2707
2708 2009-04-11  Daniel Kraft  <d@domob.eu>
2709
2710         PR fortran/37746
2711         * gfortran.h (struct gfc_charlen): New field "passed_length" to store
2712         the actual passed string length for dummy arguments.
2713         * trans-decl.c (gfc_create_string_length): Formatting fixes and added
2714         assertion, moved a local variable into the innermost block it is needed.
2715         (create_function_arglist): Removed TODO about the check being
2716         implemented and initialize cl->passed_length here.
2717         (add_argument_checking): New method.
2718         (gfc_generate_function_code): Call the argument checking method.
2719
2720 2009-04-11  Janus Weil  <janus@gcc.gnu.org>
2721
2722         PR fortran/39692
2723         * symbol.c (check_conflict): Reject procedure pointers for -std=f95.
2724
2725 2009-04-11  Daniel Franke  <franke.daniel@gmail.com>
2726
2727         * resolve.c (resolve_global_procedure): Enable whole-file checking for
2728         procedures that are declared later in the file.
2729         
2730 2009-04-10  Paolo Bonzini  <bonzini@gnu.org>
2731
2732         PR middle-end/39701
2733         * trans.c (gfc_allocate_with_status): Fix type mismatches
2734         on "pstat == 0".
2735
2736 2009-04-10  Daniel Franke  <franke.daniel@gmail.com>
2737
2738         PR fortran/38709
2739         * expr.c (find_array_section): Leave early on zero-sized arrays.
2740
2741 2009-04-09  Janus Weil  <janus@gcc.gnu.org>
2742
2743         PR fortran/36704
2744         * decl.c (add_hidden_procptr_result): New function for handling
2745         procedure pointer return values by adding a hidden result variable.
2746         (variable_decl,match_procedure_decl,gfc_match_function_decl,
2747         gfc_match_subroutine,gfc_match_end,attr_decl1): Handle procedure pointer
2748         return values.
2749         * parse.c (parse_interface): Add EXTERNAL attribute only after
2750         FUNCTION/SUBROUTINE declaration is complete.
2751         * primary.c (replace_hidden_procptr_result): New function for replacing
2752         function symbol by hidden result variable.
2753         (gfc_match_rvalue,match_variable): Replace symbol by hidden result
2754         variable.
2755         * resolve.c (resolve_contained_fntype,resolve_function,resolve_variable,
2756         resolve_symbol): Allow for procedure pointer function results.
2757         (resolve_fl_procedure): Conflict detection moved here from
2758         'check_conflict'.
2759         * symbol.c (gfc_check_function_type): Allow for procedure pointer
2760         function results.
2761         (check_conflict): Move some conflict detection to resolution stage.
2762         * trans-types.c (gfc_sym_type,gfc_get_function_type): Handle hidden
2763         result variables.
2764
2765 2009-04-08  Jakub Jelinek  <jakub@redhat.com>
2766
2767         * trans-types.c (gfc_init_types): Ensure gfc_integer_types doesn't
2768         contain TYPE_STRING_FLAG types.
2769
2770 2009-04-08  Janne Blomqvist  <jb@gcc.gnu.org>
2771
2772         PR fortran/39670
2773         * invoke.texi (fdollar-ok): Fix typo.
2774         
2775 2009-04-08  Daniel Franke  <franke.daniel@gmail.com>
2776
2777         PR fortran/39670
2778         * invoke.texi (fdollar-ok): Clarify limitations.
2779
2780 2009-04-08  Paul Thomas  <pault@gcc.gnu.org>
2781
2782         PR fortran/38863
2783         * trans-array.c (gfc_trans_deferred_array): Return if this
2784         is a result variable.
2785
2786 2009-04-07  Janus Weil  <janus@gcc.gnu.org>
2787
2788         PR fortran/38152
2789         * trans-decl.c (gfc_get_symbol_decl): Correctly set decl location for
2790         procedure pointer decls.
2791
2792 2009-04-07  Janus Weil  <janus@gcc.gnu.org>
2793
2794         PR fortran/38290
2795         * expr.c (gfc_check_pointer_assign): Enable interface check for
2796         procedure pointers.
2797         * gfortran.h: Add copy_formal_args_intr.
2798         * interface.c (gfc_compare_interfaces): Call gfc_compare_intr_interfaces
2799         if second argument is an intrinsic.
2800         (compare_intr_interfaces): Correctly set attr.function, attr.subroutine
2801         and ts.
2802         (compare_parameter): Call gfc_compare_interfaces also for intrinsics.
2803         * resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve
2804         intrinsic interfaces here. Must happen earlier.
2805         (resolve_symbol): Resolution of intrinsic interfaces moved here from
2806         resolve_specific_..., and formal args are now copied from intrinsic
2807         interfaces.
2808         * symbol.c (copy_formal_args_intr): New function to copy the formal
2809         arguments from an intinsic procedure.
2810
2811 2009-04-06  Paul Thomas  <pault@gcc.gnu.org>
2812
2813         PR fortran/38863
2814         * dependency.c (ref_same_as_full_array): New function.
2815         (gfc_dep_resolver): Call it.
2816
2817 2009-04-06  Janus Weil  <janus@gcc.gnu.org>
2818
2819         PR fortran/39414
2820         * decl.c (match_procedure_decl): Fix double declaration problems with
2821         PROCEDURE statements.
2822         * symbol.c (gfc_add_type): Ditto.
2823
2824 2009-04-06  Paul Thomas  <pault@gcc.gnu.org>
2825
2826         PR fortran/36091
2827         * trans-array.c (gfc_conv_array_ref): If the symbol has the
2828         temporary attribute use the array_spec for the bounds.
2829         * gfortran.h : Add the temporary field to the structure
2830         'symbol_attribute'.
2831         * trans-stmt.c (forall_make_variable_temp): Set the symbol's
2832         temporary attribute.
2833
2834 2009-04-05  Daniel Franke  <franke.daniel@gmail.com>
2835
2836         PR fortran/29458
2837         * trans-array.c (gfc_trans_array_constructor_value): Shadow
2838         implied do-loop variable to avoid spurious middle-end warnings.
2839
2840 2009-04-04  Tobias Burnus  <burnus@net-b.de>
2841
2842         PR fortran/39577
2843         * trans-decl.c (gfc_generate_function_code): Move recursive
2844         check to the right position.
2845
2846 2009-04-04  Paul Thomas  <pault@gcc.gnu.org>
2847
2848         PR fortran/37614
2849         * trans-common.c (translate_common): Do not offset the whole
2850         coomon block.
2851
2852 2009-04-03  Tobias Burnus  <burnus@net-b.de>
2853
2854         PR fortran/39594
2855         * resolve.c (resolve_common_vars): Add FL_VARIABLE to symbol
2856         if it is not a procedure pointer.
2857         * primary.c (match_actual_arg): Ditto.
2858
2859 2009-03-31  Joseph Myers  <joseph@codesourcery.com>
2860
2861         PR preprocessor/15638
2862         * cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
2863
2864 2009-03-30  Steven G. Kargl  <kargls@comcast.net>
2865
2866         PR fortran/38389
2867         * trans-stmt.c(gfc_trans_allocate): Add translation of ERRMSG.
2868         (gfc_trans_deallocate): Add translation of ERRMSG.  Remove stale
2869         comments.  Minor whitespace cleanup.
2870         * resolve.c(is_scalar_expr_ptr): Whitespace cleanup.
2871         (resolve_deallocate_expr (gfc_expr *e): Update error message.
2872         (resolve_allocate_expr):  Remove dead code.  Update error message.
2873         Move error checking to ...
2874         (resolve_allocate_deallocate): ... here.  Add additional error
2875         checking for STAT, ERRMSG, and allocate-objects.
2876         * match.c(gfc_match_allocate,gfc_match_deallocate):  Parse ERRMSG.
2877         Check for redundant uses of STAT and ERRMSG.  Reword error message
2878         and add checking for pointer, allocatable, and proc_pointer attributes.
2879
2880 2009-03-30  Paul Thomas  <pault@gcc.gnu.org>
2881
2882         PR fortran/22571
2883         PR fortran/26227
2884         PR fortran/24886
2885         * symbol.c : Add gfc_global_ns_list.
2886         * decl.c (add_global_entry): Set the namespace ('ns') field.
2887         * gfortran.h : Add the resolved field to gfc_namespace. Add the
2888         namespace ('ns') field to gfc_gsymbol.  Add flag_whole_file to
2889         gfc_option_t.  Add the prototype for gfc_free_dt_list.
2890         * lang.opt : Add the whole-file option.
2891         * invoke.texi : Document the whole-file option.
2892         * resolve.c (resolve_global_procedure): If the fwhole-file
2893         option is set, reorder gsymbols to ensure that translation is
2894         in the right order.  Resolve the gsymbol's namespace if that
2895         has not occurred and then check interfaces.
2896         (resolve_function): Move call to resolve_global_procedure.
2897         (resolve_call): The same.
2898         (resolve_codes): Store the current labels_obstack.
2899         (gfc_resolve) : Return if the namespace is already resolved.
2900         trans-decl.c (gfc_get_extern_function_decl): If the whole_file
2901         option is selected, use the backend_decl of a gsymbol, if it is
2902         available.
2903         parse.c (add_global_procedure, add_global_program): If the flag
2904         whole-file is set, add the namespace to the gsymbol.
2905         (gfc_parse_file): On -fwhole-file, put procedure namespaces on
2906         the global namespace list.  Rearrange to do resolution of all
2907         the procedures in a file, followed by their translation.
2908         * options.c (gfc_init_options): Add -fwhole-file.
2909         (gfc_handle_option): The same.
2910
2911 2009-03-30  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
2912
2913         * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
2914         family of intrinsics instead of BUILT_IN_INF family.
2915         * trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use
2916         BUILT_IN_HUGE_VAL instead of BUILT_IN_INF.
2917
2918 2009-03-30  Jakub Jelinek  <jakub@redhat.com>
2919
2920         * trans-types.c (gfc_sym_type, gfc_return_by_reference): For
2921         sym->attr.result check sym->ns->proc_name->attr.is_bind_c.
2922
2923 2009-03-30  Joseph Myers  <joseph@codesourcery.com>
2924
2925         PR rtl-optimization/323
2926         * options.c (gfc_post_options): Set
2927         flag_excess_precision_cmdline.  Give an error for
2928         -fexcess-precision=standard for processors where the option is
2929         significant.
2930
2931 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
2932
2933         PR preprocessor/34695
2934         * cpp.c (cb_cpp_error): New.
2935         (gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
2936         Don't check cpp_errors (cpp_in).
2937         (gfc_cpp_init_0): Set cb->error.
2938
2939 2009-03-29  Steven G. Kargl  <kargl@gcc.gnu.org>
2940
2941         PR fortran/38823
2942         * gfortran.h: Add ARITH_PROHIBIT to arith enum.
2943         expr.c (gfc_match_init_expr): Add global variable init_flag to
2944         flag matching an initialization expression.
2945         (check_intrinsic_op): Move no longer reachable error message to ...
2946         * arith.c (arith_power): ... here.  Remove gfc_ prefix in
2947         gfc_arith_power.  Use init_flag.  Allow constant folding of x**y
2948         when y is REAL or COMPLEX.
2949         (eval_intrinsic): Remove restriction that y in x**y must be INTEGER
2950         for constant folding.
2951         * gfc_power: Update gfc_arith_power to arith_power
2952
2953 2009-03-29  Daniel Kraft  <d@domob.eu>
2954
2955         PR fortran/37423
2956         * gfortran.h (struct gfc_typebound_proc): Added new flag "deferred" and
2957         added a comment explaining DEFERRED binding handling.
2958         * decl.c (match_binding_attributes): Really match DEFERRED attribute.
2959         (match_procedure_in_type): Really match PROCEDURE(interface) syntax
2960         and do some validity checks for DEFERRED and this construct.
2961         * module.c (binding_overriding): New string constant for DEFERRED.
2962         (mio_typebound_proc): Module-IO DEFERRED flag.
2963         * resolve.c (check_typebound_override): Ensure that a non-DEFERRED
2964         binding is not overridden by a DEFERRED one.
2965         (resolve_typebound_procedure): Allow abstract interfaces as targets
2966         for DEFERRED bindings.
2967         (ensure_not_abstract_walker), (ensure_not_abstract): New methods.
2968         (resolve_fl_derived): Use new "ensure_not_abstract" method for
2969         non-ABSTRACT types extending ABSTRACT ones to ensure each DEFERRED
2970         binding is overridden.
2971         (check_typebound_baseobject): New method.
2972         (resolve_compcall), (resolve_typebound_call): Check base-object of
2973         the type-bound procedure call.
2974         * gfc-internals.texi (Type-bound procedures): Document a little bit
2975         about internal handling of DEFERRED bindings.
2976
2977 2009-03-29  Tobias Schlüter  <tobi@gcc.gnu.org>
2978
2979         PR fortran/38507
2980         * gfortran.h (gfc_st_label): Fix comment.
2981         (gfc_exec_op): Add statement code EXEC_END_BLOCK for end of block.
2982         * parse.c (accept_statement): Use EXEC_END_BLOCK for END IF and
2983         END SELECT with labels.
2984         (check_do_closure): Fix formatting.
2985         (parse_do_block): Fix typo in error message.
2986         * resolve.c (code_stack): Remove tail member.  Update comment to
2987         new use of reachable_labels.
2988         (reachable_labels): Rename to ...
2989         (find_reachable_labels): ... this.  Overhaul.  Update preceding
2990         comment.
2991         (resolve_branch): Fix comment preceding function.  Rewrite.
2992         (resolve_code): Update call to find_reachable_labels.  Add code to
2993         deal with EXEC_END_BLOCK.
2994         * st.c (gfc_free_statement): Add code to deal with EXEC_END_BLOCK.
2995         Add 2009 to copyright years.
2996         * trans.c (gfc_trans_code): Likewise on both counts.
2997
2998 2009-03-31  Paul Thomas  <pault@gcc.gnu.org>
2999
3000         PR fortran/38917
3001         * expr.c (gfc_check_assign): Allow pointer components when
3002         checking for NULL.
3003
3004         PR fortran/38918
3005         * resolve.c (check_data_variable): Treat pointer arrays with
3006         scalars.
3007
3008 2009-03-31  Paul Thomas  <pault@gcc.gnu.org>
3009
3010         PR fortran/38915
3011         * trans-expr.c (gfc_trans_assignment_1): Ensure temporaries
3012         have a string_length.
3013
3014 2009-03-28  Tobias Burnus  <burnus@net-b.de>
3015
3016         PR fortran/34656
3017         * trans-stmt.c (gfc_trans_simple_do, gfc_trans_do):
3018         Add GFC_RTCHECK_DO support.
3019         * option.c (gfc_handle_runtime_check_option): Enable GFC_RTCHECK_DO.
3020         * invoke.texi (-fcheck): Document "do" option.
3021
3022 2009-03-28  Paul Thomas  <pault@gcc.gnu.org>
3023
3024         PR fortran/38538
3025         * trans-array.c (get_elemental_fcn_charlen): Remove.
3026         (get_array_charlen): New function to replace previous.
3027
3028 2009-03-28  Paul Thomas  <pault@gcc.gnu.org>
3029
3030         PR fortran/38765
3031         * parse.c (parse_derived): Do not break on finding pointer,
3032         allocatable or private components.
3033
3034 2009-03-28  Tobias Burnus  <burnus@net-b.de>
3035
3036         PR fortran/32626
3037         * option.c (gfc_handle_runtime_check_option): Enable recursion check.
3038         * trans-decl.c (gfc_generate_function_code): Add recursion check.
3039         * invoke.texi (-fcheck): Add recursive option.
3040
3041 2009-03-28  Tobias Burnus  <burnus@net-b.de>
3042
3043         PR fortran/38432
3044         * resolve.c (gfc_resolve_iterator): Add zero-loop warning.
3045
3046 2009-03-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3047             Paul Thomas  <pault@gcc.gnu.org>
3048             Tobias Burnus  <burnus@net-b.de>
3049
3050         * gfortran.h (gfc_option_t): Add rtcheck.
3051         * lang.opt: New option -fcheck.
3052         * libgfortran.h: Add GFC_RTCHECK_* constants.
3053         * invoke.texi: Document -fcheck.
3054         * options.c (gfc_handle_runtime_check_option): New function.
3055         (gfc_init_options,gfc_post_options,gfc_handle_option):
3056         Add -fcheck option.
3057
3058 2009-03-27  Richard Guenther  <rguenther@suse.de>
3059
3060         * trans-array.c (gfc_conv_descriptor_data_addr): Use
3061         gfc_build_addr_expr instead of build_fold_addr_expr.
3062         (gfc_trans_allocate_array_storage, gfc_trans_array_constructor_value,
3063         gfc_trans_constant_array_constructor, gfc_conv_array_data,
3064         gfc_conv_expr_descriptor, gfc_conv_array_parameter): Likewise.
3065         * trans-expr.c (gfc_conv_missing_dummy, gfc_conv_variable,
3066         gfc_conv_function_val, gfc_conv_operator_assign,
3067         gfc_conv_subref_array_arg, gfc_conv_function_call,
3068         gfc_conv_expr_reference, gfc_trans_scalar_assign): Likewise.
3069         * trans-intrinsic.c (gfc_conv_intrinsic_exponent,
3070         gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate,
3071         gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax_char,
3072         gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_spacing,
3073         gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_set_exponent,
3074         gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer,
3075         gfc_conv_intrinsic_si_kind, gfc_conv_intrinsic_trim): Likewise.
3076         * trans-io.c (gfc_trans_io_runtime_check, set_parameter_ref,
3077         gfc_convert_array_to_string, gfc_trans_open, gfc_trans_close,
3078         build_filepos, gfc_trans_inquire, gfc_trans_wait,
3079         nml_get_addr_expr, transfer_namelist_element, build_dt,
3080         gfc_trans_dt_end, transfer_array_component, transfer_expr,
3081         transfer_array_desc, gfc_trans_transfer): Likewise.
3082         * trans-stmt.c (gfc_trans_allocate, gfc_trans_deallocate): Likewise.
3083         * trans.c (gfc_build_addr_expr): Mark the base of the address
3084         TREE_ADDRESSABLE.
3085
3086 2009-03-27  Tobias Burnus  <burnus@net-b.de>
3087
3088         * gfortran.h (enum init_local_real.): Add GFC_INIT_REAL_SNAN.
3089         (gfc_expr): Add is_snan.
3090         * trans-const.c (gfc_conv_mpfr_to_tree): Support SNaN.
3091         (gfc_conv_constant_to_tree): Update call to gfc_conv_mpfr_to_tree.
3092         * trans-const.h (gfc_conv_mpfr_to_tree): Update prototype.
3093         * resolve.c (build_default_init_expr): Update call.
3094         * target-memory.c (encode_float): Ditto.
3095         * trans-intrinsic.c (gfc_conv_intrinsic_aint,gfc_conv_intrinsic_mod,
3096
3097 2009-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3098
3099         * lang.opt: Unify help texts for -I, -Wconversion, -d, -fopenmp,
3100         and -fpreprocessed.
3101
3102 2009-03-06  Alexandre Oliva <aoliva@redhat.com>
3103
3104         * simplify.c (gfc_simplify_transfer): Zero-initialize the
3105         buffer.
3106
3107 2009-02-27  Tobias Burnus  <burnus@net-b.de>
3108
3109         PR fortran/39309
3110         * module.c (read_md5_from_module_file): Add missing quote.
3111
3112 2009-02-27  Tobias Burnus  <burnus@net-b.de>
3113
3114         PR fortran/39309
3115         * module.c (read_md5_from_module_file): Include mod version
3116         in had-changed test.
3117
3118 2009-02-26  Paul Thomas  <pault@gcc.gnu.org>
3119
3120         PR fortran/39295
3121         * interface.c (compare_type_rank_if): Return 1 if the symbols
3122         are the same and deal with external procedures where one is
3123         identified to be a function or subroutine by usage but the
3124         other is not.
3125
3126 2009-02-26  Paul Thomas  <pault@gcc.gnu.org>
3127
3128         PR fortran/39292
3129         * trans-array.c (gfc_conv_array_initializer): Convert all
3130         expressions rather than ICEing.
3131
3132 2009-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
3133
3134         PR fortran/38914
3135         * array.c (ref_dimen_size):  Rename to gfc_ref_dimen_size,
3136         make global.  Change function name in error messages.
3137         (ref_size):  Change ref_dimen_size to gfc_ref_dimen_size.
3138         (gfc_array_ref_shape):  Likewise.
3139         * gfortran.h:  Add prototype for gfc_ref_dimen_size.
3140         * simplify.c (simplify_bound_dim):  Add ref argument.
3141         If the reference isn't a full array, return one for
3142         the lower bound and the extent for the upper bound.
3143         (simplify_bound):  For array sections, take as from the
3144         argument.  Add reference to all to simplify_bound_dim.
3145
3146 2009-02-19  Daniel Franke  <franke.daniel@gmail.com>
3147
3148         * scanner.c (load_line): At end of line, skip '\r' without setting
3149         the truncation flag.
3150
3151 2009-02-18  Daniel Kraft  <d@domob.eu>
3152
3153         * gfortran.texi: New chapter about compiler characteristics.
3154         (Compiler Characteristics): Document KIND type parameters here.
3155
3156 2009-02-18  Tobias Burnus  <burnus@net-b.de>
3157
3158         * intrinsic.texi (MALLOC): Make example more portable.
3159
3160 2009-02-13  Mikael Morin  <mikael.morin@tele2.fr>
3161
3162         PR fortran/38259
3163         * module.c (gfc_dump_module,gfc_use_module): Add module
3164         version number.
3165
3166 2009-02-13  Paul Thomas  <pault@gcc.gnu.org>
3167
3168         PR fortran/36703
3169         PR fortran/36528
3170         * trans-expr.c (gfc_conv_function_val): Stabilize Cray-pointer
3171         function references to ensure that a valid expression is used.
3172         (gfc_conv_function_call): Pass Cray pointers to procedures.
3173
3174 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
3175
3176         * gfortranspec.c (lang_specific_driver): Update copyright notice
3177         dates.
3178
3179 2009-01-28  Paul Thomas  <pault@gcc.gnu.org>
3180
3181         PR fortran/38852
3182         PR fortran/39006
3183         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use the array
3184         descriptor ubound for UBOUND, when the array lbound == 1.
3185
3186 2009-01-27  Daniel Kraft  <d@domob.eu>
3187
3188         PR fortran/38883
3189         * trans-stmt.c (gfc_conv_elemental_dependencies):  Create temporary
3190         for the real type needed to make it work for subcomponent-references.
3191
3192 2009-01-21  Daniel Kraft  <d@domob.eu>
3193
3194         * trans-stmt.c (gfc_conv_elemental_dependencies):  Cleaned up comment.
3195
3196 2009-01-20  Paul Thomas  <pault@gcc.gnu.org>
3197
3198         PR fortran/38907
3199         * resolve.c (check_host_association): Remove the matching to
3200         correct an incorrect host association and use manipulation of
3201         the expression instead.
3202
3203 2009-01-20  Tobias Burnus  <burnus@net-b.de>
3204
3205         * invoke.texi (RANGE): RANGE also takes INTEGER arguments.
3206
3207 2009-01-19  Mikael Morin  <mikael.morin@tele2.fr>
3208
3209         PR fortran/38859
3210         * simplify.c (simplify_bound): Don't use array specification
3211         if variable or component has subsequent references.
3212
3213 2009-01-17  Paul Thomas  <pault@gcc.gnu.org>
3214
3215         PR fortran/38657
3216         * module.c (write_common_0): Add argument 'this_module' and
3217         check that non-use associated common blocks are written first.
3218         (write_common): Call write_common_0 twice, once with true and
3219         then with false.
3220
3221 2009-01-17  Paul Thomas  <pault@gcc.gnu.org>
3222
3223         PR fortran/34955
3224         * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Has
3225         been absorbed into gfc_conv_intrinsic_transfer. All
3226         references to it in trans-intrinsic.c have been changed
3227         accordingly.  PR fixed by using a temporary for scalar
3228         character transfer, when the source is shorter than the
3229         destination.
3230
3231 2009-01-17  Paul Thomas  <pault@gcc.gnu.org>
3232
3233         PR fortran/38657
3234         * module.c (write_common_0): Revert patch of 2009-01-05.
3235
3236 2009-01-16  Janus Weil  <janus@gcc.gnu.org>
3237
3238         PR fortran/38152
3239         * expr.c (gfc_check_pointer_assign): Allow use-associated procedure
3240         pointers as lvalue.
3241         * trans-decl.c (get_proc_pointer_decl,gfc_create_module_variable):
3242         Enable procedure pointers as module variables.
3243
3244 2009-01-14  Steven G. Kargl  <kargl@gcc.gnu.org>
3245
3246         * ChangeLog-2007: Clean out svn merge droppings.
3247
3248 2009-01-10  Paul Thomas  <pault@gcc.gnu.org>
3249
3250         PR fortran/38763
3251         * target-memory.c (encode_derived): Encode NULL.
3252
3253 2009-01-10  Paul Thomas  <pault@gcc.gnu.org>
3254
3255         PR fortran/38765
3256         * resolve.c (check_host_association): Use the symtree name to
3257         search for a potential contained procedure, since this is the
3258         name by which it would be referenced.
3259
3260 2009-01-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
3261
3262         PR fortran/38220
3263         * interface.c (gfc_procedure_use):  Don't warn about functions
3264         from ISO_C_BINDING.
3265         * symbol.c (generate_isocbinding_symbol):  Mark c_loc and
3266         c_funloc as pure.
3267
3268 2009-01-05  Paul Thomas  <pault@gcc.gnu.org>
3269
3270         PR fortran/38657
3271         * module.c (write_common_0): Use the name of the symtree rather
3272         than the common block, to determine if the common has been
3273         written.
3274
3275 2009-01-05  Daniel Franke  <franke.daniel@gmail.com>
3276
3277         PR fortran/37159
3278         * check.c (gfc_check_random_seed): Added size check for GET
3279         dummy argument, reworded error messages to follow common pattern.
3280
3281 2009-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
3282
3283         PR fortran/38672
3284         * trans-types.c (gfc_get_derived_type):  Check for the
3285         presence of derived->ns->proc_name before
3286         accessing derived->ns->proc_name->attr.flavor .
3287         * resolve.c (resolve_symbol):  Likewise.
3288
3289 2009-01-05  Paul Thomas  <pault@gcc.gnu.org>
3290
3291         PR fortran/38665
3292         * gfortran.h : Add bit to gfc_expr 'user_operator'
3293         * interface.c (gfc_extend_expr): Set the above if the operator
3294         is substituted by a function. 
3295         * resolve.c (check_host_association): Return if above is set.
3296
3297 2009-01-04  Mikael Morin  <mikael.morin@tele2.fr>
3298
3299         PR fortran/35681
3300         * ChangeLog-2008: Fix function name.
3301
3302         PR fortran/38487
3303         * dependency.c (gfc_check_argument_var_dependency):
3304         Move the check for pointerness inside the if block
3305         so that it doesn't affect the return value.
3306
3307         PR fortran/38669
3308         * trans-stmt.c (gfc_trans_call):
3309         Add the dependency code after the loop bounds calculation one.
3310
3311 2009-01-04  Daniel Franke  <franke.daniel@gmail.com>
3312
3313         * intrinsic.c (do_simplify): Removed already implemented TODO.
3314
3315 2009-01-04  Daniel Franke  <franke.daniel@gmail.com>
3316
3317         PR fortran/38718
3318         * simplify.c (gfc_simplify_merge): New.
3319         * intrinsic.h (gfc_simplify_merge): New prototype.
3320         * intrinsic.c (add_functions): Added simplification for MERGE.
3321
3322 2009-01-04  Mikael Morin  <mikael.morin@tele2.fr>
3323
3324         PR fortran/38536
3325         * gfortran.h (gfc_is_data_pointer): Added prototype
3326         * resolve.c (gfc_iso_c_func_interface):
3327         Use gfc_is_data_pointer to test for pointer attribute.
3328         * dependency.c (gfc_is_data_pointer):
3329         Support pointer-returning functions.
3330
3331 2009-01-03  Daniel Franke  <franke.daniel@gmail.com>
3332
3333         * symbol.c (save_symbol): Don't SAVE function results.
3334
3335 2009-01-03  Paul Thomas  <pault@gcc.gnu.org>
3336
3337         PR fortran/38594
3338         * resolve.c (resolve_call): When searching for proper host
3339         association, use symtree rather than symbol.  For everything
3340         except generic subroutines, substitute the symtree in the call
3341         rather than the symbol.
3342
3343 \f
3344 Copyright (C) 2009 Free Software Foundation, Inc.
3345
3346 Copying and distribution of this file, with or without modification,
3347 are permitted in any medium without royalty provided the copyright
3348 notice and this notice are preserved.