OSDN Git Service

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