OSDN Git Service

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