OSDN Git Service

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