OSDN Git Service

2009-07-15 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2009-07-15  Janus Weil  <janus@gcc.gnu.org>
2
3         PR fortran/40743
4         * resolve.c (resolve_symbol): Don't resolve the formal namespace of a
5         contained procedure.
6
7 2009-07-14  Taras Glek  <tglek@mozilla.com>
8             Rafael Espindola  <espindola@google.com>
9
10         * Make-lang.in (fortran.install-plugin): New target for
11         installing plugin headers.
12
13 2009-07-13  H.J. Lu  <hongjiu.lu@intel.com>
14
15         * module.c (mio_symbol): Remove the unused variable, formal.
16
17 2009-07-13  Janus Weil  <janus@gcc.gnu.org>
18
19         PR fortran/40646
20         * module.c (mio_symbol): If the symbol has formal arguments,
21         the formal namespace will be present.
22         * resolve.c (resolve_actual_arglist): Correctly handle 'called'
23         procedure pointer components as actual arguments.
24         (resolve_fl_derived,resolve_symbol): Make sure the formal namespace
25         is present.
26         * trans-expr.c (gfc_conv_procedure_call): Correctly handle the formal
27         arguments of procedure pointer components.
28
29 2009-07-12  Tobias Burnus  <burnus@net-b.de>
30             Philippe Marguinaud <philippe.marguinaud@meteo.fr>
31
32         PR fortran/40588
33         * primary.c (match_charkind_name): Fix condition for $ matching.
34
35         PR libfortran/22423
36         * libgfortran.h: Typedef the GFC_DTYPE_* enum.
37
38 2009-07-11  Tobias Burnus  <burnus@net-b.de>
39
40         PR fortran/33197
41         * check.c (gfc_check_fn_rc2008): New function.
42         * intrinsic.h (gfc_check_fn_rc2008): New prototype.
43         * intrinsic.c (add_functions): Add complex tan, cosh, sinh,
44         and tanh.
45
46 2009-07-10  Paul Thomas  <pault@gcc.gnu.org>
47
48         PR fortran/39334
49         * primary.c (match_kind_param): Return MATCH_NO if the symbol
50         has no value.
51
52 2008-07-09  Paul Thomas  <pault@gcc.gnu.org>
53
54         PR fortran/40629
55         * resolve.c (check_host_association):  Use the existing
56         accessible symtree and treat function expressions with
57         symbols that have procedure flavor.
58
59 2009-07-09  Janus Weil  <janus@gcc.gnu.org>
60
61         PR fortran/40646
62         * dump-parse-tree.c (show_expr): Renamed 'is_proc_ptr_comp'.
63         * expr.c (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'.
64         (gfc_check_pointer_assign): Renamed 'is_proc_ptr_comp'.
65         (replace_comp,gfc_expr_replace_comp): New functions, analogous
66         to 'replace_symbol' and 'gfc_expr_replace_symbol', just with components
67         instead of symbols.
68         * gfortran.h (gfc_expr_replace_comp): New prototype.
69         (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'.
70         * interface.c (compare_actual_formal): Renamed 'is_proc_ptr_comp'.
71         * match.c (gfc_match_pointer_assignment): Ditto.
72         * primary.c (gfc_match_varspec): Handle array-valued procedure pointers
73         and procedure pointer components. Renamed 'is_proc_ptr_comp'.
74         * resolve.c (resolve_fl_derived): Correctly handle interfaces with
75         RESULT statement, and handle array-valued procedure pointer components.
76         (resolve_actual_arglist,resolve_ppc_call,resolve_expr_ppc): Renamed
77         'is_proc_ptr_comp'.
78         * trans-array.c (gfc_walk_function_expr): Ditto.
79         * trans-decl.c (gfc_get_symbol_decl): Security check for presence of
80         ns->proc_name.
81         * trans-expr.c (gfc_conv_procedure_call): Handle array-valued procedure
82         pointer components. Renamed 'is_proc_ptr_comp'.
83         (conv_function_val,gfc_trans_arrayfunc_assign): Renamed
84         'is_proc_ptr_comp'.
85         (gfc_get_proc_ptr_comp): Do not modify the argument 'e', but instead
86         make a copy of it.
87         * trans-io.c (gfc_trans_transfer): Handle array-valued procedure
88         pointer components.
89
90 2009-07-09  Tobias Burnus  <burnus@net-b.de>
91
92         PR fortran/40604
93         * intrinsic.c (gfc_convert_type_warn): Set sym->result.
94         * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer
95         for optional arguments.
96
97 2009-07-08  Tobias Burnus  <burnus@net-b.de>
98
99         PR fortran/40675
100         * simplify.c (gfc_simplify_sign): Handle signed zero correctly.
101         * trans-intrinsic.c (gfc_conv_intrinsic_sign): Support
102         -fno-sign-zero.
103         * invoke.texi (-fno-sign-zero): Add text regarding SIGN intrinsic.
104
105 2008-07-08  Paul Thomas  <pault@gcc.gnu.org>
106
107         PR fortran/40591
108         * decl.c (match_procedure_interface):  Correct the association
109         or creation of the interface procedure's symbol.
110
111 2009-07-04  Jakub Jelinek  <jakub@redhat.com>
112
113         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): For integer
114         maxloc initialize limit to -huge-1 rather than just -huge.
115
116 2009-07-04  Janus Weil  <janus@gcc.gnu.org>
117
118         PR fortran/40593
119         * interface.c (compare_actual_formal): Take care of proc-pointer-valued
120         functions as actual arguments.
121         * trans-expr.c (gfc_conv_procedure_call): Ditto.
122         * resolve.c (resolve_specific_f0): Use the correct ts.
123
124 2009-07-02  Michael Matz  <matz@suse.de>
125
126         PR fortran/32131
127         * trans-array.c (gfc_conv_descriptor_stride_get): Return
128         constant one for strides in the first dimension of ALLOCATABLE
129         arrays.
130
131 2009-06-30  Janus Weil  <janus@gcc.gnu.org>
132
133         PR fortran/40594
134         * trans-types.c (gfc_get_derived_type): Bugfix, reverting one hunk from
135         r147206.
136
137 2009-06-29  Tobias Burnus  <burnus@net-b.de>
138
139         PR fortran/40580
140         * trans-expr.c  (gfc_conv_procedure_call): Add -fcheck=pointer check.
141         * libgfortran.h: Add GFC_RTCHECK_POINTER.
142         * invoke.texi (-fcheck): Document new pointer option.
143         * options.c (gfc_handle_runtime_check_option): Handle pointer option.
144
145         * gfortran.texi (C Binding): Improve wording.
146         * iso-c-binding.def: Remove obsolete comment.
147
148 2009-06-29  Paul Thomas  <pault@gcc.gnu.org>
149
150         PR fortran/40551
151         * dependency.h : Add second bool* argument to prototype of
152         gfc_full_array_ref_p.
153         * dependency.c (gfc_full_array_ref_p): If second argument is
154         present, return true if last dimension of reference is an
155         element or has unity stride.
156         * trans-array.c : Add NULL second argument to references to
157         gfc_full_array_ref_p.
158         * trans-expr.c : The same, except for;
159         (gfc_trans_arrayfunc_assign): Return fail if lhs reference
160         is not a full array or a contiguous section.
161
162 2009-06-28  Tobias Burnus  <burnus@net-b.de>
163             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
164
165         PR fortran/34112
166         * symbol.c (gfc_add_ext_attribute): New function.
167         (gfc_get_sym_tree): New argument allow_subroutine.
168         (gfc_get_symbol,gfc_get_ha_sym_tree,gen_cptr_param,gen_fptr_param
169         gen_shape_param,generate_isocbinding_symbol): Use it.
170         * decl.c (find_special): New argument allow_subroutine.
171         (add_init_expr_to_sym,add_hidden_procptr_result,attr_decl1,
172         match_procedure_in_type,gfc_match_final_decl): Use it.
173         (gfc_match_gcc_attributes): New function.
174         * gfortran.texi (Mixed-Language Programming): New section
175         "GNU Fortran Compiler Directives".
176         * gfortran.h (ext_attr_t): New struct.
177         (symbol_attributes): Use it.
178         (gfc_add_ext_attribute): New prototype.
179         (gfc_get_sym_tree): Update pototype.
180         * expr.c (gfc_check_pointer_assign): Check whether call
181         convention is the same.
182         * module.c (import_iso_c_binding_module, create_int_parameter,
183         use_iso_fortran_env_module): Update gfc_get_sym_tree call.
184         * scanner.c (skip_gcc_attribute): New function.
185         (skip_free_comments,skip_fixed_comments): Use it.
186         (gfc_next_char_literal): Support !GCC$ lines.
187         * resolve.c (check_host_association): Update
188         gfc_get_sym_tree call.
189         * match.c (gfc_match_sym_tree,gfc_match_call): Update
190         gfc_get_sym_tree call.
191         * trans-decl.c (add_attributes_to_decl): New function.
192         (gfc_get_symbol_decl,get_proc_pointer_decl,
193         gfc_get_extern_function_decl,build_function_decl: Use it.
194         * match.h (gfc_match_gcc_attributes): Add prototype.
195         * parse.c (decode_gcc_attribute): New function.
196         (next_free,next_fixed): Support !GCC$ lines.
197         * primary.c (match_actual_arg,check_for_implicit_index,
198         gfc_match_rvalue,gfc_match_rvalue): Update
199         gfc_get_sym_tree call.
200
201 2009-06-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
202
203         * gfortran.h: Define HAVE_mpc_pow.
204         * arith.c (complex_reciprocal, complex_pow): If HAVE_mpc_pow,
205         don't define these functions.
206         (arith_power): If HAVE_mpc_pow, use mpc_pow.
207
208 2009-06-26  Janus Weil  <janus@gcc.gnu.org>
209
210         PR fortran/39997
211         PR fortran/40541
212         * decl.c (add_hidden_procptr_result): Copy the typespec to the hidden
213         result.
214         * expr.c (gfc_check_pointer_assign): Enable interface check for
215         procedure pointer assignments where the rhs is a function returning a
216         procedure pointer.
217         * resolve.c (resolve_symbol): If an external procedure with unspecified
218         return type can not be implicitly typed, it must be a subroutine.
219
220 2009-06-24  Janus Weil  <janus@gcc.gnu.org>
221
222         PR fortran/40427
223         * gfortran.h (gfc_component): New member 'formal_ns'.
224         (gfc_copy_formal_args_ppc,void gfc_ppc_use): New.
225         * interface.c (gfc_ppc_use): New function, analogous to
226         gfc_procedure_use, but for procedure pointer components.
227         * module.c (MOD_VERSION): Bump module version.
228         (mio_component): Treat formal arguments.
229         (mio_formal_arglist): Changed argument from gfc_symbol to
230         gfc_formal_arglist.
231         (mio_symbol): Changed argument of mio_formal_arglist.
232         * resolve.c (resolve_ppc_call,resolve_expr_ppc): Call gfc_ppc_use,
233         to check actual arguments and treat formal args correctly.
234         (resolve_fl_derived): Copy formal args of procedure pointer components
235         from their interface.
236         * symbol.c (gfc_copy_formal_args_ppc): New function, analogous to
237         gfc_copy_formal_args, but for procedure pointer components.
238
239 2009-06-22  Janus Weil  <janus@gcc.gnu.org>
240
241         PR fortran/37254
242         PR fortran/39850
243         * interface.c (compare_parameter): Set implicit type for function
244         actual arguments with BT_UNKNOWN.
245
246 2009-06-22  Tobias Burnus  <burnus@net-b.de>
247
248         PR fortran/40472
249         PR fortran/50520
250         * simplify.c (gfc_simplify_spread): Fix the case that source=
251         is a scalar.
252
253 2009-06-22  Paul Thomas  <pault@gcc.gnu.org>
254
255         PR fortran/40443
256         * interface.c (gfc_search_interface): Hold back a match to an
257         elementary procedure until all other possibilities are
258         exhausted.
259
260 2009-06-22  Paul Thomas  <pault@gcc.gnu.org>
261
262         PR fortran/40472
263         * simplify.c (gfc_simplify_spread): Restrict the result size to
264         the limit for an array constructor.
265
266 2009-06-21  Janus Weil  <janus@gcc.gnu.org>
267
268         PR fortran/39850
269         * interface.c (gfc_compare_interfaces): Take care of implicit typing
270         when checking the function attribute. Plus another bugfix.
271         (compare_parameter): Set attr.function and attr.subroutine according
272         to the usage of a procedure as actual argument.
273
274 2009-06-20  Tobias Burnus  <burnus@net-b.de>
275
276         PR fortran/40452
277         * trans-decl.c (add_argument_checking): Disable bounds check
278         for allowed argument storage association.
279
280 2009-06-19  Paul Thomas  <pault@gcc.gnu.org>
281
282         PR fortran/40440
283         * trans-expr.c (gfc_conv_procedure_call): Do not deallocate
284         allocatable components if the argument is a pointer.
285
286 2009-06-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
287
288         * gfortran.h (gfc_expr): Use mpc_t to represent complex numbers.
289
290         * arith.c, dump-parse-tree.c, expr.c, module.c, resolve.c,
291         simplify.c, target-memory.c, target-memory.h, trans-const.c,
292         trans-expr.c: Convert to mpc_t throughout.
293
294 2009-06-19  Ian Lance Taylor  <iant@google.com>
295
296         * cpp.c (struct gfc_cpp_option_data): Give this struct, used for
297         the global variable gfc_cpp_option, a name.
298
299 2009-06-19  Janus Weil  <janus@gcc.gnu.org>
300
301         PR fortran/40450
302         * trans-expr.c (gfc_conv_procedure_call): Only add an extra addr_expr
303         to a procedure pointer actual argument, if it is not itself a
304         dummy arg.
305
306 2009-06-18  Janus Weil  <janus@gcc.gnu.org>
307
308         PR fortran/40451
309         * resolve.c (resolve_contained_fntype): Prevent implicit typing for
310         procedures with explicit interface.
311         * symbol.c (gfc_check_function_type): Ditto.
312
313 2009-06-16  Ian Lance Taylor  <iant@google.com>
314
315         * decl.c (build_struct): Rewrite loop over constructor elements.
316
317 2009-06-16  Janus Weil  <janus@gcc.gnu.org>
318
319         PR fortran/36947
320         PR fortran/40039
321         * expr.c (gfc_check_pointer_assign): Call 'gfc_compare_interfaces' with
322         error message.
323         * gfortran.h (gfc_compare_interfaces): Additional argument.
324         * interface.c (operator_correspondence): Removed.
325         (gfc_compare_interfaces): Additional argument to return error message.
326         Directly use the code from 'operator_correspondence' instead of calling
327         the function. Check for OPTIONAL. Some rearrangements.
328         (check_interface1): Call 'gfc_compare_interfaces' without error message.
329         (compare_parameter): Call 'gfc_compare_interfaces' with error message.
330         * resolve.c (check_generic_tbp_ambiguity): Call 'gfc_compare_interfaces'
331         without error message.
332
333 2009-06-16  Tobias Burnus  <burnus@net-b.de>
334
335         PR fortran/40383
336         * trans-decl.c (create_function_arglist): Copy formal charlist to
337         have a proper passed_length for -fcheck=bounds.
338
339 2009-06-12  Steven G. Kargl  <kargls@comcast.net>
340
341         * arith.c (gfc_enum_initializer): Move function ...
342         * decl.c: ... here.  Remove gfc_ prefix and make static.
343         (enumerator_decl): Update function call.
344         * gfortran.h:  Remove gfc_enum_initializer prototype.
345
346 2009-06-12  Aldy Hernandez  <aldyh@redhat.com>
347
348         * trans-array.c (gfc_trans_allocate_array_storage): Pass
349         location on down.
350         (gfc_trans_array_constructor_value): Same.
351         (gfc_trans_scalarized_loop_end): Same.
352         (gfc_conv_ss_startstride): Same.
353         (gfc_trans_g77_array): Same.
354         (gfc_trans_dummy_array_bias): Same.
355         (gfc_conv_array_parameter): Same.
356         (structure_alloc_comps): Same.
357         * trans-expr.c (gfc_conv_function_call): Same.
358         (fill_with_spaces): Same.
359         (gfc_trans_string_copy): Same.
360         (gfc_trans_scalar_assign): Same.
361         * trans-stmt.c (gfc_trans_goto): Same.
362         (gfc_trans_if_1): Same.
363         (gfc_trans_simple_do): Same.
364         (gfc_trans_do): Same.
365         (gfc_trans_do_while): Same.
366         (gfc_trans_logical_select): Same.
367         (gfc_trans_select): Same.
368         (gfc_trans_forall_loop): Same.
369         (gfc_trans_nested_forall_loop): Same.
370         (generate_loop_for_temp_to_lhs): Same.
371         (generate_loop_for_rhs_to_temp): Same.
372         (gfc_trans_forall_1): Same.
373         (gfc_trans_where_assign): Same.
374         (gfc_trans_where_3): Same.
375         (gfc_trans_allocate): Same.
376         * trans.c (gfc_finish_block): Same.
377         (gfc_trans_runtime_check): Same.
378         (gfc_call_malloc): Same.
379         (gfc_allocate_with_status): Same.
380         (gfc_call_free): Same.
381         (gfc_deallocate_with_status): Same.
382         (gfc_call_realloc): Same.
383         (gfc_trans_code): Same.
384         * trans-decl.c (gfc_init_default_dt): Same.
385         (gfc_generate_constructors): Same.
386         * trans-io.c (gfc_trans_io_runtime_check): Same.
387         * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
388         (gfc_conv_intrinsic_fdate): Same.
389         (gfc_conv_intrinsic_ttynam): Same.
390         (gfc_conv_intrinsic_minmax): Same.
391         (gfc_conv_intrinsic_minmax_char): Same.
392         (gfc_conv_intrinsic_anyall): Same.
393         (gfc_conv_intrinsic_count): Same.
394         (gfc_conv_intrinsic_arith): Same.
395         (gfc_conv_intrinsic_minmaxloc): Same.
396         (gfc_conv_intrinsic_minmaxval): Same.
397         (gfc_conv_intrinsic_rrspacing): Same.
398         (gfc_conv_intrinsic_array_transfer): Same.
399         (gfc_conv_intrinsic_trim): Same.
400         (gfc_conv_intrinsic_repeat): Same.
401         
402 2009-06-12  Janus Weil  <janus@gcc.gnu.org>
403
404         PR fortran/40176
405         * resolve.c (resolve_symbol): Additional error check, preventing an
406         infinite loop.
407
408 2009-06-11  Paul Thomas  <pault@gcc.gnu.org>
409
410         PR fortran/40402
411         * resolve.c (next_data_value): It is an error if the value is
412         not constant.
413
414 2009-06-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
415
416         PR fortran/38718
417         * intrinsic.c (add_functions): Add simplifiers for ISNAN,
418         IS_IOSTAT_END and IS_IOSTAT_EOR.
419         * intrinsic.h (gfc_simplify_is_iostat_end, gfc_simplify_is_iostat_eor,
420         gfc_simplify_isnan): New prototypes.
421         * intrinsic.c (gfc_simplify_is_iostat_end, gfc_simplify_is_iostat_eor,
422         gfc_simplify_isnan): New functions.
423
424 2009-06-11  Jakub Jelinek  <jakub@redhat.com>
425
426         * interface.c (fold_unary): Rename to...
427         (fold_unary_intrinsic): ... this.
428         (gfc_extend_expr): Adjust caller.
429         (gfc_match_generic_spec): Likewise.  Initialize *op to INTRINSIC_NONE
430         to avoid warnings.
431         * expr.c (gfc_simplify_expr): Initialize start and end before calling
432         gfc_extract_int.
433
434 2009-06-10  Dave Korn  <dave.korn.cygwin@gmail.com>
435
436         * trans-decl.c (create_main_function):  Don't build main decl twice.
437
438 2009-06-09  Tobias Burnus  <burnus@net-b.de>
439
440         * trans-decl.c (gfc_generate_function_code): Use gfc_option.rtcheck
441         instead of flag_bounds_check.
442         * intrinsic.texi (ISO_FORTRAN_ENV): Document INT{8,16,32,64} and
443         REAL{32,64,128}.
444
445 2009-06-08  Paul Thomas  <pault@gcc.gnu.org>
446
447         * trans-array.h : Replace prototypes for
448         gfc_conv_descriptor_offset, gfc_conv_descriptor_stride,
449         gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound with new
450         prototypes of the same names with _get or _set appended.
451         * trans-array.c : Make the originals of the above static and
452         new functions for the _get and _set functions. Update all the
453         references to these descriptor access functions.
454         * trans-expr.c : Update references to the above descriptor
455         access functions.
456         * trans-intrinsic.c : The same.
457         * trans-openmp.c : The same.
458         * trans-stmt.c : The same.
459
460 2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
461
462         * options.c (gfc_post_options): Disable dump_parse_tree
463         during -fcompare-debug-second.
464
465 2009-06-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
466
467         PR fortran/40008
468         * gfortran.h (gfc_open): Add newunit expression to structure.
469         * io.c (io_tag): Add new unit tag and fix whitespace.
470         (match_open_element): Add matching for newunit.
471         (gfc_free_open): Free the newunit expression.
472         (gfc_resolve_open): Add newunit to resolution and check constraints.
473         (gfc_resolve_close): Add check for non-negative unit.
474         (gfc_resolve_filepos): Likewise.
475         (gfc_resolve_dt): Likewise.
476         * trans-io.c (set_parameter_value): Build runtime checks for unit
477         numbers within range of kind=4 integer. (gfc_trans_open) Set the
478         newunit parameter.
479         * ioparm.def (IOPARM): Define the newunit parameter as a pointer
480         to GFC_INTEGER_4, pint4.
481
482 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
483
484         PR fortran/25104
485         PR fortran/29962
486         * array.c (gfc_append_constructor): Added NULL-check.
487         * check.c (gfc_check_spread): Check DIM.
488         (gfc_check_unpack): Check that the ARRAY arguments provides enough
489         values for MASK.
490         * intrinsic.h (gfc_simplify_spread): New prototype.
491         (gfc_simplify_unpack): Likewise.
492         * intrinsic.c (add_functions): Added new simplifier callbacks.
493         * simplify.c (gfc_simplify_spread): New.
494         (gfc_simplify_unpack): New.
495         * expr.c (check_transformational): Allow additional transformational
496         intrinsics in initialization expression.
497
498 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
499
500         PR fortran/25104
501         PR fortran/29962
502         * check.c (gfc_check_all_any): Check rank of DIM.
503         (gfc_check_count): Likewise.
504         * intrinsic.h (gfc_simplify_all): New prototype.
505         (gfc_simplify_any): Likewise.
506         (gfc_simplify_count): Likewise.
507         (gfc_simplify_sum): Likewise.
508         (gfc_simplify_product): Likewise.
509         * intrinsic.c (add_functions): Added new simplifier callbacks.
510         * simplify.c (transformational_result): New.
511         (simplify_transformation_to_scalar): New.
512         (simplify_transformation_to_array): New.
513         (gfc_count): New.
514         (gfc_simplify_all): New.
515         (gfc_simplify_any): New.
516         (gfc_simplify_count): New.
517         (gfc_simplify_sum): New.
518         (gfc_simplify_product): New.
519         * expr.c (check_transformational): Allow additional transformational
520         intrinsics in initialization expression.
521
522 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
523
524         * check.c (dim_rank_check): Return SUCCESS if DIM=NULL.
525         (gfc_check_lbound): Removed (now) redundant check for DIM=NULL.
526         (gfc_check_minloc_maxloc): Likewise.
527         (check_reduction): Likewise.
528         (gfc_check_size): Likewise.
529         (gfc_check_ubound): Likewise.
530         (gfc_check_cshift): Added missing shape-conformance checks.
531         (gfc_check_eoshift): Likewise.
532         * gfortran.h (gfc_check_conformance): Modified prototype to printf-style.
533         * expr.c (gfc_check_conformance): Accept error-message chunks in 
534         printf-style. Changed all callers.
535
536
537 2009-06-07  Daniel Franke  <franke.daniel@gmail.com>
538
539         PR fortran/25104
540         PR fortran/29962
541         * intrinsic.h (gfc_simplify_dot_product): New prototype.
542         (gfc_simplify_matmul): Likewise.
543         (gfc_simplify_transpose): Likewise.
544         * intrinsic.c (add_functions): Added new simplifier callbacks.
545         * simplify.c (init_result_expr): New.
546         (compute_dot_product): New.
547         (gfc_simplify_dot_product): New.
548         (gfc_simplify_matmul): New.
549         (gfc_simplify_transpose): New.
550         * expr.c (check_transformational): Allow transformational intrinsics
551         with simplifier in initialization expression.
552
553 2009-06-06  Daniel Franke  <franke.daniel@gmail.com>
554
555         PR fortran/37203
556         * simplify.c (gfc_simplify_reshape): Fixed reshaping of empty arrays
557         without padding.
558
559 2009-06-06  Daniel Franke  <franke.daniel@gmail.com>
560
561         PR fortran/32890
562         * intrinsic.h (gfc_simplify_pack): New prototype.
563         * intrinsic.c (add_functions): Added
564         simplifier-callback to PACK.
565         * simplify.c (is_constant_array_expr): Moved
566         to beginning of file.
567         (gfc_simplify_pack): New.
568         * check.c (gfc_check_pack): Check that VECTOR has enough elements.
569         Added safeguards for empty arrays.
570
571 2009-06-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
572
573         * simplify.c (call_mpc_func): Use mpc_realref/mpc_imagref
574         instead of MPC_RE/MPC_IM.
575
576 2009-06-05  Alexandre Oliva  <aoliva@redhat.com>
577
578         * trans-decl.c (gfc_build_qualified_array): Don't skip generation
579         of range types.
580         * trans.h (struct lang_type): Add base_decls.
581         (GFC_TYPE_ARRAY_BASE_DECL): New.
582         * trans-types.c (gfc_get_array_type_bounds): Initialize base decls
583         proactively and excessively.
584         (gfc_get_array_descr_info): Use existing base decls if available.
585
586 2009-06-04  Daniel Franke  <franke.daniel@gmail.com>
587
588         PR fortran/37203
589         * check.c (gfc_check_reshape): Additional checks for the
590         SHAPE and ORDER arguments.
591         * simplify.c (gfc_simplify_reshape): Converted argument checks
592         to asserts.
593
594 2009-06-03  Tobias Burnus  <burnus@net-b.de>
595
596         * gfortran.texi: Add mixed-language programming, mention
597         varying string lengths, some clean up of introduction parts.
598         * intrinsic.texi (instrinsic modules): Create @menu for subsections.
599         (ISO_C_BINDING): Support ISOCBINDING_INT_FAST128_T.
600         * libgfortran.h: Comment to rember to keep gfortran.texi in sync.
601         * iso-c-binding.def: Support ISOCBINDING_INT_FAST128_T.
602
603 2009-06-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
604             Tobias Burnus  <burnus@net-b.de>
605
606         * iso-c-binding.def: Use INTMAX_TYPE instead of intmax_type_node.
607         * trans-types.c (init_c_interop_kinds): Remove intmax_type_node.
608
609 2009-06-03  Alexandre Oliva  <aoliva@redhat.com>
610
611         * module.c (mio_f2k_derived): Initialize cur.
612
613 2009-06-01  Tobias Burnus  <burnus@net-b.de>
614
615         PR fortran/40309
616         * trans-decl.c (gfc_sym_identifier): Use "MAIN__" for PROGRAM "main".
617         (create_main_function): Set main_identifier_node.
618
619 2009-05-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
620
621         PR fortran/40019
622         * trans-types.c (gfc_build_uint_type): Make nonstatic.
623         * trans.h (gfor_fndecl_clz128, gfor_fndecl_ctz128): New prototypes.
624         * trans-types.h (gfc_build_uint_type): Add prototype.
625         * trans-decl.c (gfc_build_intrinsic_function_decls): Build
626         gfor_fndecl_clz128 and gfor_fndecl_ctz128.
627         * trans-intrinsic.c (gfc_conv_intrinsic_leadz,
628         gfc_conv_intrinsic_trailz): Call the right builtins or library
629         functions, and cast arguments to unsigned types first.
630         * simplify.c (gfc_simplify_leadz): Deal with negative arguments.
631
632 2009-05-27  Ian Lance Taylor  <iant@google.com>
633
634         * Make-lang.in (gfortran$(exeext)): Change $(COMPILER) to
635         $(LINKER).
636         (f951$(exeext)): Likewise.
637
638 2009-05-27  Tobias Burnus  <burnus@net-b.de>
639
640         PR fortran/40270
641         * trans-decl.c (create_main_function): Mark MAIN__ and
642         argc/argv as TREE_USED and push/pop function_decl context
643         if needed.
644
645 2009-05-26  Tobias Burnus  <burnus@net-b.de>
646
647         PR fortran/39178
648         * gfortranspec.c (lang_specific_driver): Stop linking
649         libgfortranbegin.
650         * trans-decl.c (gfc_build_builtin_function_decls): Stop
651         making MAIN__ publicly visible.
652         (gfc_build_builtin_function_decls): Add
653         gfor_fndecl_set_args.
654         (create_main_function) New function.
655         (gfc_generate_function_code): Use it.
656
657 2009-05-26  Tobias Burnus  <burnus@net-b.de>
658
659         PR fortran/40246
660         * match.c (gfc_match_nullify): NULLify freed pointer.
661
662 2009-05-26  Ian Lance Taylor  <iant@google.com>
663
664         * Make-lang.in (gfortranspec.o): Use $(COMPILER).
665         (gfortran$(exeext), f951$(exeext), fortran/cpp.o): Likewise.
666
667 2009-05-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
668
669         * gfortran.h (GFC_MPC_RND_MODE): New.
670         * simplify.c (call_mpc_func): New helper function.
671         (gfc_simplify_cos, gfc_simplify_exp, gfc_simplify_log,
672         gfc_simplify_sin, gfc_simplify_sqrt): Add MPC support.
673
674 2009-05-25  Janus Weil  <janus@gcc.gnu.org>
675
676         PR fortran/40176
677         * primary.c (gfc_match_varspec): Handle procedure pointer components
678         with array return value.
679         * resolve.c (resolve_expr_ppc): Ditto.
680         (resolve_symbol): Make sure the interface of a procedure pointer has
681         been resolved.
682         * trans-array.c (gfc_walk_function_expr): Handle procedure pointer
683         components with array return value.
684         * trans-expr.c (gfc_conv_component_ref,gfc_conv_procedure_call,
685         gfc_trans_arrayfunc_assign): Ditto.
686         (gfc_trans_pointer_assignment): Handle procedure pointer assignments,
687         where the rhs is a dummy argument.
688         * trans-types.c (gfc_get_ppc_type,gfc_get_derived_type): Handle
689         procedure pointer components with array return value.
690
691 2009-05-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
692             Dominique Dhumieres
693
694         PR fortran/35732
695         PR fortran/39872
696         * trans-array.c (gfc_conv_ss_startstride): Add one to index.
697
698 2009-05-22  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
699
700         PR fortran/40195
701         * module.c (read_md5_from_module_file): Close file before returning.
702
703 2009-05-18  Janus Weil  <janus@gcc.gnu.org>
704
705         PR fortran/40164
706         * primary.c (gfc_match_rvalue): Handle procedure pointer components in
707         arrays.
708         * resolve.c (resolve_ppc_call,resolve_expr_ppc): Resolve component and
709         array references.
710         (resolve_fl_derived): Procedure pointer components are not required to
711         have constant array bounds in their return value.
712
713 2009-05-18  Janus Weil  <janus@gcc.gnu.org>
714
715         * intrinsic.c (add_sym): Fix my last commit (r147655),
716         which broke bootstrap.
717
718 2009-05-18  Richard Guenther  <rguenther@suse.de>
719
720         PR fortran/40168
721         * trans-expr.c (gfc_trans_zero_assign): For local array
722         destinations use an assignment from an empty constructor.
723
724 2009-05-18  Janus Weil  <janus@gcc.gnu.org>
725
726         PR fortran/36947
727         PR fortran/40039
728         * expr.c (gfc_check_pointer_assign): Check intents when comparing
729         interfaces.
730         * gfortran.h (typedef struct gfc_intrinsic_arg): Add 'intent' member.
731         (gfc_compare_interfaces): Additional argument.
732         * interface.c (operator_correspondence): Add check for equality of
733         intents, and new argument 'intent_check'.
734         (gfc_compare_interfaces): New argument 'intent_check', which is passed
735         on to operator_correspondence.
736         (check_interface1): Don't check intents when comparing interfaces.
737         (compare_parameter): Do check intents when comparing interfaces.
738         * intrinsic.c (add_sym): Add intents for arguments of intrinsic
739         procedures.
740         (add_sym_1,add_sym_1s,add_sym_1m,add_sym_2,add_sym_2s,add_sym_3,
741         add_sym_3ml,add_sym_3red,add_sym_3s,add_sym_4): Use INTENT_IN by
742         default.
743         (add_sym_1_intent,add_sym_1s_intent,add_sym_2s_intent,add_sym_3s_intent)
744         : New functions to add intrinsic symbols, specifying custom intents.
745         (add_sym_4s,add_sym_5s): Add new arguments to specify intents.
746         (add_functions,add_subroutines): Add intents for various intrinsics.
747         * resolve.c (check_generic_tbp_ambiguity): Don't check intents when
748         comparing interfaces.
749         * symbol.c (gfc_copy_formal_args_intr): Copy intent.
750
751 2009-05-17  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
752
753         * iso-fortran-env.def: Define INT8, INT16, INT32, INT64, REAL32,
754         REAL64 and REAL128.
755         * gfortran.h (gfc_get_int_kind_from_width_isofortranenv,
756         gfc_get_real_kind_from_width_isofortranenv): New prototypes.
757         * iso-c-binding.def: Update definitions for the INT*_T,
758         INT_LEAST*_T and INT_FAST*_T named parameters.
759         * trans-types.c (get_typenode_from_name, get_int_kind_from_name,
760         gfc_get_real_kind_from_width_isofortranenv): New functions.
761
762 2009-05-17  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
763
764         PR fortran/36260
765         * intrinsic.c (add_functions, add_subroutines): Fix argument
766         names and wrap long lines.
767         * intrinsic.texi: Fix documentation and argument names of
768         LOG_GAMMA, DATAN2, DBESJN, DTIME, ETIME, FSTAT, STAT, LSTAT,
769         GET_COMMAND, IDATE, LTIME, MOVE_ALLOC, NINT, OR, PRODUCT,
770         SUM, RAND, RANDOM_SEED, REAL, SELECTED_INT_KIND,
771         SELECTED_REAL_KIND and XOR.
772
773 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
774
775         PR fortran/33197
776         * intrinsic.c (add_functions): Use ERFC_SCALED simplification.
777         * intrinsic.h (gfc_simplify_erfc_scaled): New prototype.
778         * simplify.c (fullprec_erfc_scaled, asympt_erfc_scaled,
779         gfc_simplify_erfc_scaled): New functions.
780
781 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
782
783         PR fortran/31243
784         * resolve.c (resolve_substring): Don't allow too large substring
785         indexes.
786         (gfc_resolve_substring_charlen): Fix typo.
787         (gfc_resolve_character_operator): Fix typo.
788         (resolve_charlen): Catch unreasonably large string lengths.
789         * simplify.c (gfc_simplify_len): Don't error out on LEN
790         range checks.
791
792 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
793
794         PR fortran/36031
795         * decl.c (set_enum_kind): Use global short-enums flag.
796         * gfortran.h (gfc_option_t): Remove short_enums flag.
797         * lang.opt (-fshort-enums): Refer to C documentation.
798         * options.c (gfc_init_options, gfc_handle_option): Use global
799         short-enums flag.
800
801 2009-05-15  Tobias Burnus  <burnus@net-b.de>
802
803         PR fortran/39352
804         * f95-lang.c: Add gfc_maybe_initialize_eh.
805         * gfortran.h: Add gfc_maybe_initialize_eh prototype.
806         * Make-lang.in: Add new .h dendencies for f95-lang.c
807         * openmp.c (resolve_omp_do): Call gfc_maybe_initialize_eh.
808         * misc.c (gfc_free): Avoid #define trickery for free.
809
810 2009-05-14  Steven G. Kargl  <kargl@gcc.gnu.org>
811
812         * dump-parse-tree.c (show_code_node): Add ERRMSG to the dumping
813         of allocate and deallocate statements.
814
815 2009-05-14  Ian Lance Taylor  <iant@google.com>
816
817         * decl.c (match_attr_spec): Change d to unsigned int.
818         * dump-parse-tree.c (show_namespace): Change op to int.  Add cast.
819         * interface.c (gfc_check_interfaces): Change i to int.  Add casts.
820         * module.c (read_module): Change i to int.  Add cast.
821         (write_module): Change i to int.
822         * symbol.c (gfc_get_namespace): Change in to int.
823         (gfc_free_namespace): Change i to int.
824         * trans-io.c (gfc_build_io_library_fndecls): Change ptype to
825         unsigned int.  Add cast.
826         * trans-types.c (gfc_init_kinds): Change mode to unsigned int.
827         Add casts.
828
829 2009-05-14  Daniel Kraft  <d@domob.eu>
830
831         PR fortran/40045
832         * dump-parse-tree.c (show_typebound): Fix missing adaption to new
833         type-bound procedure storage structure.
834
835 2009-05-14  Janus Weil  <janus@gcc.gnu.org>
836
837         PR fortran/39996
838         * decl.c (gfc_match_function_decl): Use gfc_add_type.
839         * symbol.c (gfc_add_type): Better checking for duplicate types in
840         function declarations. And: Always give an error for duplicte types,
841         not just a warning with -std=gnu.
842
843 2009-05-14  Jakub Jelinek  <jakub@redhat.com>
844
845         PR fortran/39865
846         * io.c (resolve_tag_format): CHARACTER array in FMT= argument
847         isn't an extension.  Reject non-CHARACTER array element of
848         assumed shape or pointer or assumed size array.
849         * trans-array.c (array_parameter_size): New function.
850         (gfc_conv_array_parameter): Add size argument.  Call
851         array_parameter_size if it is non-NULL.
852         * trans-array.h (gfc_conv_array_parameter): Adjust prototype.
853         * trans-expr.c (gfc_conv_function_call, gfc_trans_arrayfunc_assign):
854         Adjust callers.
855         * trans-intrinsic.c (gfc_conv_intrinsic_loc): Likewise.
856         * trans-io.c (gfc_convert_array_to_string): Rewritten.
857
858 2009-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
859
860         * gfortran.h (gfc_code): Rename struct member expr to expr1.
861         * openmp.c (resolve_omp_atomic): Update expr to expr1.
862         * interface.c (gfc_extend_assign): Ditto.
863         * trans-expr.c (gfc_conv_expr_reference, gfc_trans_assignment,
864         gfc_trans_init_assign): Ditto.
865         * dump-parse-tree.c (show_code_node): Ditto.
866         * trans-openmp.c (gfc_trans_omp_atomic): Ditto.
867         * trans-stmt.c ( gfc_trans_label_assign, gfc_trans_goto, gfc_trans_call,
868         gfc_trans_return, gfc_trans_pause, gfc_trans_stop, gfc_trans_if_1,
869         gfc_trans_arithmetic_if, gfc_trans_do_while, gfc_trans_integer_select,
870         gfc_trans_logical_select, gfc_trans_character_select
871         forall_make_variable_temp, check_forall_dependencies
872         gfc_trans_forall_1, gfc_trans_where_2, gfc_trans_where_3
873         gfc_trans_where, gfc_trans_allocate, gfc_trans_deallocate): Ditto.
874         * io.c (match_io_element, gfc_match_inquire): Ditto.
875         * resolve.c (resolve_typebound_call, resolve_ppc_call,
876         resolve_allocate_expr, resolve_allocate_deallocate, resolve_select,
877         resolve_transfer, resolve_where, gfc_resolve_assign_in_forall,
878         gfc_resolve_blocks, resolve_code, build_init_assign): Ditto.
879         * st.c (gfc_free_statement): Ditto.
880         * match.c (gfc_match_assignment, gfc_match_pointer_assignment,
881         match_arithmetic_if, gfc_match_if, gfc_match_elseif
882         gfc_match_stopcode, gfc_match_assign, gfc_match_goto,
883         gfc_match_nullify, match_typebound_call, gfc_match_call
884         gfc_match_select, match_simple_where, gfc_match_where
885         gfc_match_elsewhere, match_simple_forall, gfc_match_forall): Ditto.
886         * trans-io.c (gfc_trans_transfer): Ditto.
887         * parse.c (parse_where_block, parse_if_block): Ditto.
888
889 2009-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
890
891         * gfortran.h (gfc_code): Rename struct member label to label1.
892         * dump-parse-tree.c (show_code_node): Update symbol.
893         * trans-stmt.c (gfc_trans_label_assign, gfc_trans_goto,
894         gfc_trans_arithmetic_if): Ditto.
895         * resolve.c (gfc_resolve_blocks, resolve_code): Ditto.
896         * match.c (match_arithmetic_if, gfc_match_if, gfc_reference_st_label,
897         gfc_match_assign, gfc_match_goto): Ditto.
898         * parse.c (parse_do_block): Ditto.
899
900 2009-05-13  Tobias Burnus  <burnus@net-b.de>
901
902         PR fortran/34153
903         * gfortran.h (gfc_exec_op): Add EXEC_END_PROCEDURE.
904         * dump-parse-tree.c (show_code_node): Use EXEC_END_PROCEDURE.
905         * trans.c (gfc_trans_code): Ditto.
906         * resolve.c (resolve_code): Ditto.
907         * st.c (gfc_free_statement): Ditto.
908         * parse.c (accept_statement): Ditto.
909
910 2009-05-12  Tobias Burnus  <burnus@net-b.de>
911
912         PR fortran/40110
913         * decl.c (gfc_match_kind_spec): Turn C kind error into a warning.
914
915 2009-05-11  Steve Ellcey  <sje@cup.hp.com>
916
917         * resolve.c (check_host_association): Initialize tail.
918
919 2009-05-11  Janus Weil  <janus@gcc.gnu.org>
920
921         PR fortran/40089
922         * resolve.c (resolve_fl_derived): Only return FAILURE if
923         gfc_notify_std fails.
924
925 2009-05-10  Ian Lance Taylor  <iant@google.com>
926
927         * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
928         gfc_omp_clauses.
929         (enum gfc_omp_default_sharing): Likewise.
930         * module.c (enum gfc_rsym_state): New enum, broken out of
931         pointer_info.
932         (enum gfc_wsym_state): Likewise.
933         * parse.c (enum state_order): New enum, broken out of st_state.
934
935 2009-05-10  Paul Thomas  <pault@gcc.gnu.org>
936
937         PR fortran/40018
938         * trans-array.c (gfc_trans_array_constructor_value): Fold
939         convert numeric constants.
940         (gfc_build_constant_array_constructor): The same.
941
942 2009-05-10  Paul Thomas  <pault@gcc.gnu.org>
943
944         PR fortran/38863
945         * trans-expr.c (gfc_conv_operator_assign): Remove function.
946         * trans.h : Remove prototype for gfc_conv_operator_assign.
947         * trans-stmt.c (gfc_conv_elemental_dependencies): Initialize
948         derivde types with intent(out).
949         (gfc_trans_call): Add mask, count1 and invert arguments. Add
950         code to use mask for WHERE assignments.
951         (gfc_trans_forall_1): Use new arguments for gfc_trans_call.
952         (gfc_trans_where_assign): The gfc_symbol argument is replaced
953         by the corresponding code. If this has a resolved_sym, then
954         gfc_trans_call is called. The call to gfc_conv_operator_assign
955         is removed.
956         (gfc_trans_where_2): Change the last argument in the call to
957         gfc_trans_where_assign.
958         * trans-stmt.h : Modify prototype for gfc_trans_call.
959         * trans.c (gfc_trans_code): Use new args for gfc_trans_call.
960
961 2009-05-08  Janus Weil  <janus@gcc.gnu.org>
962
963         PR fortran/39876
964         * intrinsic.c (gfc_is_intrinsic): Do not add the EXTERNAL attribute if
965         the symbol is a module procedure.
966
967 2009-05-08  Tobias Burnus  <burnus@net-b.de>
968
969         * invoke.texi: Add do/recursion to the -fcheck= summary.
970
971 2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
972
973         PR fortran/38830
974         * gfortran.texi: Document that we don't support variable FORMAT
975         expressions.
976
977 2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
978
979         PR fortran/39576
980         * error.c (error_print): Add missing break statement.
981
982 2009-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
983
984         PR fortran/36382
985         * invoke.texi: Document that -fdollar-ok does not allow $ to be
986         used in IMPLICIT statement.
987
988 2009-05-06  Janus Weil  <janus@gcc.gnu.org>
989             Paul Thomas  <pault@gcc.gnu.org>
990
991         PR fortran/39630
992         * decl.c (match_procedure_interface): New function to match the
993         interface for a PROCEDURE statement.
994         (match_procedure_decl): Call match_procedure_interface.
995         (match_ppc_decl): New function to match the declaration of a
996         procedure pointer component.
997         (gfc_match_procedure):  Call match_ppc_decl.
998         (match_binding_attributes): Add new argument 'ppc' and handle the
999         POINTER attribute for procedure pointer components.
1000         (match_procedure_in_type,gfc_match_generic): Added new argument to
1001         match_binding_attributes.
1002         * dump-parse-tree.c (show_expr,show_components,show_code_node): Handle
1003         procedure pointer components.
1004         * expr.c (free_expr0,gfc_copy_expr,gfc_simplify_expr): Handle EXPR_PPC.
1005         (gfc_check_pointer_assign): Handle procedure pointer components, but no
1006         full checking yet.
1007         (is_proc_ptr_comp): New function to determine if an expression is a
1008         procedure pointer component.
1009         * gfortran.h (expr_t): Add EXPR_PPC.
1010         (symbol_attribute): Add new member 'proc_pointer_comp'.
1011         (gfc_component): Add new member 'formal'.
1012         (gfc_exec_op): Add EXEC_CALL_PPC.
1013         (gfc_get_default_type): Changed first argument.
1014         (is_proc_ptr_comp): Add prototype.
1015         (gfc_match_varspec): Add new argument.
1016         * interface.c (compare_actual_formal): Handle procedure pointer
1017         components.
1018         * match.c (gfc_match_pointer_assignment,match_typebound_call): Handle
1019         procedure pointer components.
1020         * module.c (mio_expr): Handle EXPR_PPC.
1021         * parse.c (parse_derived): Handle procedure pointer components.
1022         * primary.c (gfc_match_varspec): Add new argument 'ppc_arg' and handle
1023         procedure pointer components.
1024         (gfc_variable_attr): Handle procedure pointer components.
1025         (gfc_match_rvalue): Added new argument to gfc_match_varspec and changed
1026         first argument of gfc_get_default_type.
1027         (match_variable): Added new argument to gfc_match_varspec.
1028         * resolve.c (resolve_entries,set_type,resolve_fl_parameter): Changed
1029         first argument of gfc_get_default_type.
1030         (resolve_structure_cons,resolve_actual_arglist): Handle procedure
1031         pointer components.
1032         (resolve_ppc_call): New function to resolve a call to a procedure
1033         pointer component (subroutine).
1034         (resolve_expr_ppc): New function to resolve a call to a procedure
1035         pointer component (function).
1036         (gfc_resolve_expr): Handle EXPR_PPC.
1037         (resolve_code): Handle EXEC_CALL_PPC.
1038         (resolve_fl_derived): Copy the interface for a procedure pointer
1039         component.
1040         (resolve_symbol): Fix overlong line.
1041         * st.c (gfc_free_statement): Handle EXEC_CALL_PPC.
1042         * symbol.c (gfc_get_default_type): Changed first argument.
1043         (gfc_set_default_type): Changed first argument of gfc_get_default_type.
1044         (gfc_add_component): Initialize ts.type to BT_UNKNOWN.
1045         * trans.h (gfc_conv_function_call): Renamed.
1046         * trans.c (gfc_trans_code): Handle EXEC_CALL_PPC.
1047         * trans-expr.c (gfc_conv_component_ref): Ditto.
1048         (gfc_conv_function_val): Rename to 'conv_function_val', add new
1049         argument 'expr' and handle procedure pointer components.
1050         (gfc_conv_operator_assign): Renamed gfc_conv_function_val.
1051         (gfc_apply_interface_mapping_to_expr): Handle EXPR_PPC.
1052         (gfc_conv_function_call): Rename to 'gfc_conv_procedure_call', add new
1053         argument 'expr' and handle procedure pointer components.
1054         (gfc_get_proc_ptr_comp): New function to get the backend decl for a
1055         procedure pointer component.
1056         (gfc_conv_function_expr): Renamed gfc_conv_function_call.
1057         (gfc_conv_structure): Handle procedure pointer components.
1058         * trans-intrinsic.c (gfc_conv_intrinsic_funcall,
1059         conv_generic_with_optional_char_arg): Renamed gfc_conv_function_call.
1060         * trans-stmt.h (gfc_get_proc_ptr_comp): Add prototype.
1061         * trans-stmt.c (gfc_trans_call): Renamed gfc_conv_function_call.
1062         * trans-types.h (gfc_get_ppc_type): Add prototype.
1063         * trans-types.c (gfc_get_ppc_type): New function to build a tree node
1064         for a procedure pointer component.
1065         (gfc_get_derived_type): Handle procedure pointer components.
1066
1067 2009-05-06  Tobias Burnus  <burnus@net-b.de>
1068
1069         PR fortran/40041
1070         * resolve.c (resolve_symbol): Print no warning for implicitly
1071         typed intrinsic functions.
1072
1073 2009-05-05  Janus Weil  <janus@gcc.gnu.org>
1074
1075         PR fortran/39998
1076         * expr.c (gfc_check_pointer_assign): Check for statement functions and
1077         internal procedures in procedure pointer assignments.
1078
1079 2009-04-28  Janus Weil  <janus@gcc.gnu.org>
1080
1081         PR fortran/39946
1082         * resolve.c (resolve_symbol): Correctly copy the interface of a
1083         PROCEDURE statement if the interface involves a RESULT variable.
1084
1085 2009-04-28  Janus Weil  <janus@gcc.gnu.org>
1086
1087         PR fortran/39930
1088         PR fortran/39931
1089         * expr.c (gfc_check_pointer_assign): Correctly detect if the left hand
1090         side is a pointer.
1091         * parse.c (gfc_fixup_sibling_symbols): Don't check for ambiguity.
1092
1093 2009-04-28  Paul Thomas  <pault@gcc.gnu.org>
1094
1095         PR fortran/39879
1096         * trans_expr.c (gfc_conv_procedure_call): Deep copy a derived
1097         type parentheses argument if it is a variable with allocatable
1098         components.
1099
1100 2009-04-27  Ian Lance Taylor  <iant@google.com>
1101
1102         * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum
1103         type.
1104         * trans-io.c (st_parameter_field): Add casts to enum type.
1105
1106 2009-04-26  Steven G. Kargl  <kargl@gcc.gnu.org>
1107
1108         PR fortran/39893
1109         fortran/data.c (gfc_assign_data_value): If the lvalue is an 
1110         assumed character length entity in a data statement, then 
1111         return FAILURE to prevent segmentation fault.
1112
1113 2009-04-26  Jakub Jelinek  <jakub@redhat.com>
1114
1115         * trans-decl.c: Include pointer-set.h.
1116         (nonlocal_dummy_decl_pset, tree nonlocal_dummy_decls): New variables.
1117         (gfc_nonlocal_dummy_array_decl): New function.
1118         (gfc_get_symbol_decl): Call it for non-local dummy args with saved
1119         descriptor.
1120         (gfc_get_symbol_decl): Set DECL_BY_REFERENCE when needed.
1121         (gfc_generate_function_code): Initialize nonlocal_dummy_decl{s,_pset},
1122         chain it to outermost block's vars, destroy it afterwards.
1123         * Make-lang.in (trans-decl.o): Depend on pointer-set.h.
1124
1125 2009-04-25  Janus Weil  <janus@gcc.gnu.org>
1126
1127         PR fortran/39688
1128         * decl.c (gfc_match_import): Use 'sym->name' instead of 'name'.
1129         They differ if the symbol has been use-renamed.
1130
1131 2009-04-24  Ian Lance Taylor  <iant@google.com>
1132
1133         * gfortran.h (enum gfc_symbol_type): New named enum type, broken
1134         out of struct gfc_symbol.
1135         (struct gfc_symbol): Use enum gfc_symbol_type.
1136         (enum gfc_array_ref_dimen_type): New named enum type, broken out
1137         of struct gfc_array_ref).
1138         (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
1139         (mod_pointee_as): Update declaration.
1140         * decl.c (add_global_entry): Change type to enum gfc_symbol_type.
1141         (gfc_mod_pointee_as): Change return type to "match".
1142         * module.c (mio_array_ref): Add cast to enum type.
1143         (mio_symbol): Likewise.
1144         * resolve.c (resolve_global_procedure): Change type to enum
1145         gfc_symbol_type.
1146         * trans-io.c (gfc_build_st_parameter): Change type to unsigned
1147         int.
1148
1149 2009-04-24  Daniel Kraft  <d@domob.eu>
1150
1151         * gfortran.h (gfc_get_typebound_proc): Removed as macro, now a function.
1152         (struct gfc_symtree): Moved "typebound" member inside union.
1153         (struct gfc_namespace): Add "tb_sym_root" as new symtree to sort out
1154         type-bound procedures there.
1155         (gfc_get_tbp_symtree): New procedure.
1156         * symbol.c (tentative_tbp_list): New global.
1157         (gfc_get_namespace): NULL new "tb_sym_root" member.
1158         (gfc_new_symtree): Removed initialization of "typebound" member.
1159         (gfc_undo_symbols): Process list of tentative tbp's.
1160         (gfc_commit_symbols): Ditto.
1161         (free_tb_tree): New method.
1162         (gfc_free_namespace): Call it.
1163         (gfc_get_typebound_proc): New method.
1164         (gfc_get_tbp_symtree): New method.
1165         (gfc_find_typebound_proc): Adapt to structural changes of gfc_symtree
1166         and gfc_namespace with regards to tbp's.
1167         * dump-parse-tree.c (show_typebound): Ditto.
1168         * primary.c (gfc_match_varspec): Ditto.  Don't reference tbp-symbol
1169         as it isn't a symbol any longer.
1170         * module.c (mio_typebound_symtree): Adapt to changes.
1171         (mio_typebound_proc): Ditto, create symtrees using "gfc_get_tbp_symtree"
1172         rather than "gfc_get_sym_tree".
1173         (mio_f2k_derived): Ditto.
1174         * decl.c (match_procedure_in_type): Ditto.
1175         (gfc_match_generic): Ditto.  Don't reference tbp-symbol.
1176         * resolve.c (check_typebound_override): Adapt to changes.
1177         (resolve_typebound_generic): Ditto.
1178         (resolve_typebound_procedures): Ditto.
1179         (ensure_not_abstract_walker): Ditto.
1180         (ensure_not_abstract): Ditto.
1181         (resolve_typebound_procedure): Ditto, ignore erraneous symbols (for
1182         instance, through removed tentative ones).
1183         * gfc-internals.texi (Type-bound procedures): Document changes.
1184
1185 2009-04-24  Janus Weil  <janus@gcc.gnu.org>
1186
1187         PR fortran/39861
1188         PR fortran/39864
1189         * symbol.c (gfc_copy_formal_args_intr): Set attr.flavor and attr.dummy
1190         for the formal arguments.
1191
1192 2009-04-21  Taras Glek <tglek@mozilla.com>
1193
1194         * f95-lang.c: Update GTY annotations to new syntax.
1195         * trans-intrinsic.c: Likewise.
1196         * trans-io.c: Likewise.
1197         * trans.h: Likewise.
1198
1199 2009-04-22  Janus Weil  <janus@gcc.gnu.org>
1200
1201         PR fortran/39735
1202         * decl.c (add_hidden_procptr_result): Bugfix for procptr results.
1203         (match_procedure_decl): Set if_source.
1204         * expr.c (gfc_check_pointer_assign): Bugfix: Return after error.
1205         And: Check interface also for IFSRC_UNKNOWN (return type may be known).
1206         * gfortran.h (typedef enum ifsrc): Remove IFSRC_USAGE,
1207         add documentation. Rename copy_formal_args and copy_formal_args_intr.
1208         * interface.c (gfc_compare_interfaces): Check for return types,
1209         handle IFSRC_UNKNOWN.
1210         (compare_intr_interfaces,compare_actual_formal_intr): Obsolete, removed.
1211         (gfc_procedure_use): Modified handling of intrinsics.
1212         * intrinsic.c (add_functions): Bugfix for "dim".
1213         * resolve.c (resolve_intrinsic): New function to resolve intrinsics,
1214         which copies the interface from isym to sym.
1215         (resolve_procedure_expression,resolve_function): Use new function
1216         'resolve_intrinsic'.
1217         (resolve_symbol): Add function attribute for externals with return type
1218         and use new function 'resolve_intrinsic'.
1219         * symbol.c (ifsrc_types): Remove string for IFSRC_USAGE.
1220         (copy_formal_args): Renamed to gfc_copy_formal_args.
1221         (copy_formal_args_intr): Renamed to gfc_copy_formal_args_intr.
1222         * trans-const.c (gfc_conv_const_charlen): Handle cl==NULL.
1223
1224 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
1225
1226         * ChangeLog, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004,
1227         ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008,
1228         ChangeLog.ptr, config-lang.in, ioparm.def, mathbuiltins.def: Add
1229         copyright and license notices.
1230         * ChangeLog, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1231         ChangeLog-2008: Correct dates.
1232
1233 2009-04-20  Tobias Burnus  <burnus@net-b.de>
1234
1235         PR fortran/39811
1236         * scanner.c (load_line): Fix bogus "&" compile-time diagnostic.
1237
1238 2009-04-20  Paul Thomas  <pault@gcc.gnu.org>
1239
1240         PR fortran/39800
1241         * resolve.c (is_sym_host_assoc): New function.
1242         (resolve_fl_derived): Call it when checking PRIVATE components
1243         of PUBLIC derived types.  Change gfc_error to a gfc_notify_std
1244         with std=f2003.
1245         (resolve_fl_namelist): Call it twice to check for host
1246         association.
1247
1248 2009-04-20  Ian Lance Taylor  <iant@google.com>
1249
1250         * module.c (import_iso_c_binding_module): Add casts to enum type.
1251         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Change op to enum
1252         tree_code.
1253         (gfc_conv_intrinsic_anyall): Likewise.
1254         (gfc_conv_intrinsic_arith): Likewise.
1255         (gfc_conv_intrinsic_minmaxloc): Likewise.
1256         (gfc_conv_intrinsic_minmaxval): Likewise.
1257         (gfc_conv_intrinsic_bitop): Likewise.
1258         (gfc_conv_intrinsic_singlebitop): Likewise.
1259         (gfc_conv_intrinsic_strcmp): Likewise.
1260
1261 2009-04-20  Vasilis Liaskovitis  <vliaskov@gmail.com>
1262             Jakub Jelinek  <jakub@redhat.com>
1263
1264         PR fortran/35423
1265         * trans.h (OMPWS_WORKSHARE_FLAG, OMPWS_CURR_SINGLEUNIT,
1266         OMPWS_SCALARIZER_WS, OMPWS_NOWAIT): Define.
1267         (ompws_flags): New extern decl.
1268         * trans-array.c (gfc_trans_scalarized_loop_end): Build OMP_FOR
1269         for the outer dimension if ompws_flags allow it.
1270         * trans.c (gfc_generate_code): Clear ompws_flags.
1271         * trans-expr.c (gfc_trans_assignment_1): Allow worksharing
1272         array assignments inside of !$omp workshare.
1273         * trans-stmt.c (gfc_trans_where_3): Similarly for where statements
1274         and constructs.
1275         * trans-openmp.c (ompws_flags): New variable.
1276         (gfc_trans_omp_workshare): Rewritten.
1277
1278 2009-04-11  Daniel Kraft  <d@domob.eu>
1279
1280         PR fortran/37746
1281         * gfortran.h (struct gfc_charlen): New field "passed_length" to store
1282         the actual passed string length for dummy arguments.
1283         * trans-decl.c (gfc_create_string_length): Formatting fixes and added
1284         assertion, moved a local variable into the innermost block it is needed.
1285         (create_function_arglist): Removed TODO about the check being
1286         implemented and initialize cl->passed_length here.
1287         (add_argument_checking): New method.
1288         (gfc_generate_function_code): Call the argument checking method.
1289
1290 2009-04-11  Janus Weil  <janus@gcc.gnu.org>
1291
1292         PR fortran/39692
1293         * symbol.c (check_conflict): Reject procedure pointers for -std=f95.
1294
1295 2009-04-11  Daniel Franke  <franke.daniel@gmail.com>
1296
1297         * resolve.c (resolve_global_procedure): Enable whole-file checking for
1298         procedures that are declared later in the file.
1299         
1300 2009-04-10  Paolo Bonzini  <bonzini@gnu.org>
1301
1302         PR middle-end/39701
1303         * trans.c (gfc_allocate_with_status): Fix type mismatches
1304         on "pstat == 0".
1305
1306 2009-04-10  Daniel Franke  <franke.daniel@gmail.com>
1307
1308         PR fortran/38709
1309         * expr.c (find_array_section): Leave early on zero-sized arrays.
1310
1311 2009-04-09  Janus Weil  <janus@gcc.gnu.org>
1312
1313         PR fortran/36704
1314         * decl.c (add_hidden_procptr_result): New function for handling
1315         procedure pointer return values by adding a hidden result variable.
1316         (variable_decl,match_procedure_decl,gfc_match_function_decl,
1317         gfc_match_subroutine,gfc_match_end,attr_decl1): Handle procedure pointer
1318         return values.
1319         * parse.c (parse_interface): Add EXTERNAL attribute only after
1320         FUNCTION/SUBROUTINE declaration is complete.
1321         * primary.c (replace_hidden_procptr_result): New function for replacing
1322         function symbol by hidden result variable.
1323         (gfc_match_rvalue,match_variable): Replace symbol by hidden result
1324         variable.
1325         * resolve.c (resolve_contained_fntype,resolve_function,resolve_variable,
1326         resolve_symbol): Allow for procedure pointer function results.
1327         (resolve_fl_procedure): Conflict detection moved here from
1328         'check_conflict'.
1329         * symbol.c (gfc_check_function_type): Allow for procedure pointer
1330         function results.
1331         (check_conflict): Move some conflict detection to resolution stage.
1332         * trans-types.c (gfc_sym_type,gfc_get_function_type): Handle hidden
1333         result variables.
1334
1335 2009-04-08  Jakub Jelinek  <jakub@redhat.com>
1336
1337         * trans-types.c (gfc_init_types): Ensure gfc_integer_types doesn't
1338         contain TYPE_STRING_FLAG types.
1339
1340 2009-04-08  Janne Blomqvist  <jb@gcc.gnu.org>
1341
1342         PR fortran/39670
1343         * invoke.texi (fdollar-ok): Fix typo.
1344         
1345 2009-04-08  Daniel Franke  <franke.daniel@gmail.com>
1346
1347         PR fortran/39670
1348         * invoke.texi (fdollar-ok): Clarify limitations.
1349
1350 2009-04-08  Paul Thomas  <pault@gcc.gnu.org>
1351
1352         PR fortran/38863
1353         * trans-array.c (gfc_trans_deferred_array): Return if this
1354         is a result variable.
1355
1356 2009-04-07  Janus Weil  <janus@gcc.gnu.org>
1357
1358         PR fortran/38152
1359         * trans-decl.c (gfc_get_symbol_decl): Correctly set decl location for
1360         procedure pointer decls.
1361
1362 2009-04-07  Janus Weil  <janus@gcc.gnu.org>
1363
1364         PR fortran/38290
1365         * expr.c (gfc_check_pointer_assign): Enable interface check for
1366         procedure pointers.
1367         * gfortran.h: Add copy_formal_args_intr.
1368         * interface.c (gfc_compare_interfaces): Call gfc_compare_intr_interfaces
1369         if second argument is an intrinsic.
1370         (compare_intr_interfaces): Correctly set attr.function, attr.subroutine
1371         and ts.
1372         (compare_parameter): Call gfc_compare_interfaces also for intrinsics.
1373         * resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve
1374         intrinsic interfaces here. Must happen earlier.
1375         (resolve_symbol): Resolution of intrinsic interfaces moved here from
1376         resolve_specific_..., and formal args are now copied from intrinsic
1377         interfaces.
1378         * symbol.c (copy_formal_args_intr): New function to copy the formal
1379         arguments from an intinsic procedure.
1380
1381 2009-04-06  Paul Thomas  <pault@gcc.gnu.org>
1382
1383         PR fortran/38863
1384         * dependency.c (ref_same_as_full_array): New function.
1385         (gfc_dep_resolver): Call it.
1386
1387 2009-04-06  Janus Weil  <janus@gcc.gnu.org>
1388
1389         PR fortran/39414
1390         * decl.c (match_procedure_decl): Fix double declaration problems with
1391         PROCEDURE statements.
1392         * symbol.c (gfc_add_type): Ditto.
1393
1394 2009-04-06  Paul Thomas  <pault@gcc.gnu.org>
1395
1396         PR fortran/36091
1397         * trans-array.c (gfc_conv_array_ref): If the symbol has the
1398         temporary attribute use the array_spec for the bounds.
1399         * gfortran.h : Add the temporary field to the structure
1400         'symbol_attribute'.
1401         * trans-stmt.c (forall_make_variable_temp): Set the symbol's
1402         temporary attribute.
1403
1404 2009-04-05  Daniel Franke  <franke.daniel@gmail.com>
1405
1406         PR fortran/29458
1407         * trans-array.c (gfc_trans_array_constructor_value): Shadow
1408         implied do-loop variable to avoid spurious middle-end warnings.
1409
1410 2009-04-04  Tobias Burnus  <burnus@net-b.de>
1411
1412         PR fortran/39577
1413         * trans-decl.c (gfc_generate_function_code): Move recursive
1414         check to the right position.
1415
1416 2009-04-04  Paul Thomas  <pault@gcc.gnu.org>
1417
1418         PR fortran/37614
1419         * trans-common.c (translate_common): Do not offset the whole
1420         coomon block.
1421
1422 2009-04-03  Tobias Burnus  <burnus@net-b.de>
1423
1424         PR fortran/39594
1425         * resolve.c (resolve_common_vars): Add FL_VARIABLE to symbol
1426         if it is not a procedure pointer.
1427         * primary.c (match_actual_arg): Ditto.
1428
1429 2009-03-31  Joseph Myers  <joseph@codesourcery.com>
1430
1431         PR preprocessor/15638
1432         * cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
1433
1434 2009-03-30  Steven G. Kargl  <kargls@comcast.net>
1435
1436         PR fortran/38389
1437         * trans-stmt.c(gfc_trans_allocate): Add translation of ERRMSG.
1438         (gfc_trans_deallocate): Add translation of ERRMSG.  Remove stale
1439         comments.  Minor whitespace cleanup.
1440         * resolve.c(is_scalar_expr_ptr): Whitespace cleanup.
1441         (resolve_deallocate_expr (gfc_expr *e): Update error message.
1442         (resolve_allocate_expr):  Remove dead code.  Update error message.
1443         Move error checking to ...
1444         (resolve_allocate_deallocate): ... here.  Add additional error
1445         checking for STAT, ERRMSG, and allocate-objects.
1446         * match.c(gfc_match_allocate,gfc_match_deallocate):  Parse ERRMSG.
1447         Check for redundant uses of STAT and ERRMSG.  Reword error message
1448         and add checking for pointer, allocatable, and proc_pointer attributes.
1449
1450 2009-03-30  Paul Thomas  <pault@gcc.gnu.org>
1451
1452         PR fortran/22571
1453         PR fortran/26227
1454         PR fortran/24886
1455         * symbol.c : Add gfc_global_ns_list.
1456         * decl.c (add_global_entry): Set the namespace ('ns') field.
1457         * gfortran.h : Add the resolved field to gfc_namespace. Add the
1458         namespace ('ns') field to gfc_gsymbol.  Add flag_whole_file to
1459         gfc_option_t.  Add the prototype for gfc_free_dt_list.
1460         * lang.opt : Add the whole-file option.
1461         * invoke.texi : Document the whole-file option.
1462         * resolve.c (resolve_global_procedure): If the fwhole-file
1463         option is set, reorder gsymbols to ensure that translation is
1464         in the right order.  Resolve the gsymbol's namespace if that
1465         has not occurred and then check interfaces.
1466         (resolve_function): Move call to resolve_global_procedure.
1467         (resolve_call): The same.
1468         (resolve_codes): Store the current labels_obstack.
1469         (gfc_resolve) : Return if the namespace is already resolved.
1470         trans-decl.c (gfc_get_extern_function_decl): If the whole_file
1471         option is selected, use the backend_decl of a gsymbol, if it is
1472         available.
1473         parse.c (add_global_procedure, add_global_program): If the flag
1474         whole-file is set, add the namespace to the gsymbol.
1475         (gfc_parse_file): On -fwhole-file, put procedure namespaces on
1476         the global namespace list.  Rearrange to do resolution of all
1477         the procedures in a file, followed by their translation.
1478         * options.c (gfc_init_options): Add -fwhole-file.
1479         (gfc_handle_option): The same.
1480
1481 2009-03-30  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1482
1483         * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
1484         family of intrinsics instead of BUILT_IN_INF family.
1485         * trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use
1486         BUILT_IN_HUGE_VAL instead of BUILT_IN_INF.
1487
1488 2009-03-30  Jakub Jelinek  <jakub@redhat.com>
1489
1490         * trans-types.c (gfc_sym_type, gfc_return_by_reference): For
1491         sym->attr.result check sym->ns->proc_name->attr.is_bind_c.
1492
1493 2009-03-30  Joseph Myers  <joseph@codesourcery.com>
1494
1495         PR rtl-optimization/323
1496         * options.c (gfc_post_options): Set
1497         flag_excess_precision_cmdline.  Give an error for
1498         -fexcess-precision=standard for processors where the option is
1499         significant.
1500
1501 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
1502
1503         PR preprocessor/34695
1504         * cpp.c (cb_cpp_error): New.
1505         (gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
1506         Don't check cpp_errors (cpp_in).
1507         (gfc_cpp_init_0): Set cb->error.
1508
1509 2009-03-29  Steven G. Kargl  <kargl@gcc.gnu.org>
1510
1511         PR fortran/38823
1512         * gfortran.h: Add ARITH_PROHIBIT to arith enum.
1513         expr.c (gfc_match_init_expr): Add global variable init_flag to
1514         flag matching an initialization expression.
1515         (check_intrinsic_op): Move no longer reachable error message to ...
1516         * arith.c (arith_power): ... here.  Remove gfc_ prefix in
1517         gfc_arith_power.  Use init_flag.  Allow constant folding of x**y
1518         when y is REAL or COMPLEX.
1519         (eval_intrinsic): Remove restriction that y in x**y must be INTEGER
1520         for constant folding.
1521         * gfc_power: Update gfc_arith_power to arith_power
1522
1523 2009-03-29  Daniel Kraft  <d@domob.eu>
1524
1525         PR fortran/37423
1526         * gfortran.h (struct gfc_typebound_proc): Added new flag "deferred" and
1527         added a comment explaining DEFERRED binding handling.
1528         * decl.c (match_binding_attributes): Really match DEFERRED attribute.
1529         (match_procedure_in_type): Really match PROCEDURE(interface) syntax
1530         and do some validity checks for DEFERRED and this construct.
1531         * module.c (binding_overriding): New string constant for DEFERRED.
1532         (mio_typebound_proc): Module-IO DEFERRED flag.
1533         * resolve.c (check_typebound_override): Ensure that a non-DEFERRED
1534         binding is not overridden by a DEFERRED one.
1535         (resolve_typebound_procedure): Allow abstract interfaces as targets
1536         for DEFERRED bindings.
1537         (ensure_not_abstract_walker), (ensure_not_abstract): New methods.
1538         (resolve_fl_derived): Use new "ensure_not_abstract" method for
1539         non-ABSTRACT types extending ABSTRACT ones to ensure each DEFERRED
1540         binding is overridden.
1541         (check_typebound_baseobject): New method.
1542         (resolve_compcall), (resolve_typebound_call): Check base-object of
1543         the type-bound procedure call.
1544         * gfc-internals.texi (Type-bound procedures): Document a little bit
1545         about internal handling of DEFERRED bindings.
1546
1547 2009-03-29  Tobias Schlueter  <tobi@gcc.gnu.org>
1548
1549         PR fortran/38507
1550         * gfortran.h (gfc_st_label): Fix comment.
1551         (gfc_exec_op): Add statement code EXEC_END_BLOCK for end of block.
1552         * parse.c (accept_statement): Use EXEC_END_BLOCK for END IF and
1553         END SELECT with labels.
1554         (check_do_closure): Fix formatting.
1555         (parse_do_block): Fix typo in error message.
1556         * resolve.c (code_stack): Remove tail member.  Update comment to
1557         new use of reachable_labels.
1558         (reachable_labels): Rename to ...
1559         (find_reachable_labels): ... this.  Overhaul.  Update preceding
1560         comment.
1561         (resolve_branch): Fix comment preceding function.  Rewrite.
1562         (resolve_code): Update call to find_reachable_labels.  Add code to
1563         deal with EXEC_END_BLOCK.
1564         * st.c (gfc_free_statement): Add code to deal with EXEC_END_BLOCK.
1565         Add 2009 to copyright years.
1566         * trans.c (gfc_trans_code): Likewise on both counts.
1567
1568 2009-03-31  Paul Thomas  <pault@gcc.gnu.org>
1569
1570         PR fortran/38917
1571         * expr.c (gfc_check_assign): Allow pointer components when
1572         checking for NULL.
1573
1574         PR fortran/38918
1575         * resolve.c (check_data_variable): Treat pointer arrays with
1576         scalars.
1577
1578 2009-03-31  Paul Thomas  <pault@gcc.gnu.org>
1579
1580         PR fortran/38915
1581         * trans-expr.c (gfc_trans_assignment_1): Ensure temporaries
1582         have a string_length.
1583
1584 2009-03-28  Tobias Burnus  <burnus@net-b.de>
1585
1586         PR fortran/34656
1587         * trans-stmt.c (gfc_trans_simple_do, gfc_trans_do):
1588         Add GFC_RTCHECK_DO support.
1589         * option.c (gfc_handle_runtime_check_option): Enable GFC_RTCHECK_DO.
1590         * invoke.texi (-fcheck): Document "do" option.
1591
1592 2009-03-28  Paul Thomas  <pault@gcc.gnu.org>
1593
1594         PR fortran/38538
1595         * trans-array.c (get_elemental_fcn_charlen): Remove.
1596         (get_array_charlen): New function to replace previous.
1597
1598 2009-03-28  Paul Thomas  <pault@gcc.gnu.org>
1599
1600         PR fortran/38765
1601         * parse.c (parse_derived): Do not break on finding pointer,
1602         allocatable or private components.
1603
1604 2009-03-28  Tobias Burnus  <burnus@net-b.de>
1605
1606         PR fortran/32626
1607         * option.c (gfc_handle_runtime_check_option): Enable recursion check.
1608         * trans-decl.c (gfc_generate_function_code): Add recursion check.
1609         * invoke.texi (-fcheck): Add recursive option.
1610
1611 2009-03-28  Tobias Burnus  <burnus@net-b.de>
1612
1613         PR fortran/38432
1614         * resolve.c (gfc_resolve_iterator): Add zero-loop warning.
1615
1616 2009-03-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1617             Paul Thomas  <pault@gcc.gnu.org>
1618             Tobias Burnus  <burnus@net-b.de>
1619
1620         * gfortran.h (gfc_option_t): Add rtcheck.
1621         * lang.opt: New option -fcheck.
1622         * libgfortran.h: Add GFC_RTCHECK_* constants.
1623         * invoke.texi: Document -fcheck.
1624         * options.c (gfc_handle_runtime_check_option): New function.
1625         (gfc_init_options,gfc_post_options,gfc_handle_option):
1626         Add -fcheck option.
1627
1628 2009-03-27  Richard Guenther  <rguenther@suse.de>
1629
1630         * trans-array.c (gfc_conv_descriptor_data_addr): Use
1631         gfc_build_addr_expr instead of build_fold_addr_expr.
1632         (gfc_trans_allocate_array_storage, gfc_trans_array_constructor_value,
1633         gfc_trans_constant_array_constructor, gfc_conv_array_data,
1634         gfc_conv_expr_descriptor, gfc_conv_array_parameter): Likewise.
1635         * trans-expr.c (gfc_conv_missing_dummy, gfc_conv_variable,
1636         gfc_conv_function_val, gfc_conv_operator_assign,
1637         gfc_conv_subref_array_arg, gfc_conv_function_call,
1638         gfc_conv_expr_reference, gfc_trans_scalar_assign): Likewise.
1639         * trans-intrinsic.c (gfc_conv_intrinsic_exponent,
1640         gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate,
1641         gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax_char,
1642         gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_spacing,
1643         gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_set_exponent,
1644         gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer,
1645         gfc_conv_intrinsic_si_kind, gfc_conv_intrinsic_trim): Likewise.
1646         * trans-io.c (gfc_trans_io_runtime_check, set_parameter_ref,
1647         gfc_convert_array_to_string, gfc_trans_open, gfc_trans_close,
1648         build_filepos, gfc_trans_inquire, gfc_trans_wait,
1649         nml_get_addr_expr, transfer_namelist_element, build_dt,
1650         gfc_trans_dt_end, transfer_array_component, transfer_expr,
1651         transfer_array_desc, gfc_trans_transfer): Likewise.
1652         * trans-stmt.c (gfc_trans_allocate, gfc_trans_deallocate): Likewise.
1653         * trans.c (gfc_build_addr_expr): Mark the base of the address
1654         TREE_ADDRESSABLE.
1655
1656 2009-03-27  Tobias Burnus  <burnus@net-b.de>
1657
1658         * gfortran.h (enum init_local_real.): Add GFC_INIT_REAL_SNAN.
1659         (gfc_expr): Add is_snan.
1660         * trans-const.c (gfc_conv_mpfr_to_tree): Support SNaN.
1661         (gfc_conv_constant_to_tree): Update call to gfc_conv_mpfr_to_tree.
1662         * trans-const.h (gfc_conv_mpfr_to_tree): Update prototype.
1663         * resolve.c (build_default_init_expr): Update call.
1664         * target-memory.c (encode_float): Ditto.
1665         * trans-intrinsic.c (gfc_conv_intrinsic_aint,gfc_conv_intrinsic_mod,
1666
1667 2009-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1668
1669         * lang.opt: Unify help texts for -I, -Wconversion, -d, -fopenmp,
1670         and -fpreprocessed.
1671
1672 2009-03-06  Alexandre Oliva <aoliva@redhat.com>
1673
1674         * simplify.c (gfc_simplify_transfer): Zero-initialize the
1675         buffer.
1676
1677 2009-02-27  Tobias Burnus  <burnus@net-b.de>
1678
1679         PR fortran/39309
1680         * module.c (read_md5_from_module_file): Add missing quote.
1681
1682 2009-02-27  Tobias Burnus  <burnus@net-b.de>
1683
1684         PR fortran/39309
1685         * module.c (read_md5_from_module_file): Include mod version
1686         in had-changed test.
1687
1688 2009-02-26  Paul Thomas  <pault@gcc.gnu.org>
1689
1690         PR fortran/39295
1691         * interface.c (compare_type_rank_if): Return 1 if the symbols
1692         are the same and deal with external procedures where one is
1693         identified to be a function or subroutine by usage but the
1694         other is not.
1695
1696 2009-02-26  Paul Thomas  <pault@gcc.gnu.org>
1697
1698         PR fortran/39292
1699         * trans-array.c (gfc_conv_array_initializer): Convert all
1700         expressions rather than ICEing.
1701
1702 2009-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1703
1704         PR fortran/38914
1705         * array.c (ref_dimen_size):  Rename to gfc_ref_dimen_size,
1706         make global.  Change function name in error messages.
1707         (ref_size):  Change ref_dimen_size to gfc_ref_dimen_size.
1708         (gfc_array_ref_shape):  Likewise.
1709         * gfortran.h:  Add prototype for gfc_ref_dimen_size.
1710         * simplify.c (simplify_bound_dim):  Add ref argument.
1711         If the reference isn't a full array, return one for
1712         the lower bound and the extent for the upper bound.
1713         (simplify_bound):  For array sections, take as from the
1714         argument.  Add reference to all to simplify_bound_dim.
1715
1716 2009-02-19  Daniel Franke  <franke.daniel@gmail.com>
1717
1718         * scanner.c (load_line): At end of line, skip '\r' without setting
1719         the truncation flag.
1720
1721 2009-02-18  Daniel Kraft  <d@domob.eu>
1722
1723         * gfortran.texi: New chapter about compiler characteristics.
1724         (Compiler Characteristics): Document KIND type parameters here.
1725
1726 2009-02-18  Tobias Burnus  <burnus@net-b.de>
1727
1728         * intrinsic.texi (MALLOC): Make example more portable.
1729
1730 2009-02-13  Mikael Morin  <mikael.morin@tele2.fr>
1731
1732         PR fortran/38259
1733         * module.c (gfc_dump_module,gfc_use_module): Add module
1734         version number.
1735
1736 2009-02-13  Paul Thomas  <pault@gcc.gnu.org>
1737
1738         PR fortran/36703
1739         PR fortran/36528
1740         * trans-expr.c (gfc_conv_function_val): Stabilize Cray-pointer
1741         function references to ensure that a valid expression is used.
1742         (gfc_conv_function_call): Pass Cray pointers to procedures.
1743
1744 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
1745
1746         * gfortranspec.c (lang_specific_driver): Update copyright notice
1747         dates.
1748
1749 2009-01-28  Paul Thomas  <pault@gcc.gnu.org>
1750
1751         PR fortran/38852
1752         PR fortran/39006
1753         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use the array
1754         descriptor ubound for UBOUND, when the array lbound == 1.
1755
1756 2009-01-27  Daniel Kraft  <d@domob.eu>
1757
1758         PR fortran/38883
1759         * trans-stmt.c (gfc_conv_elemental_dependencies):  Create temporary
1760         for the real type needed to make it work for subcomponent-references.
1761
1762 2009-01-21  Daniel Kraft  <d@domob.eu>
1763
1764         * trans-stmt.c (gfc_conv_elemental_dependencies):  Cleaned up comment.
1765
1766 2009-01-20  Paul Thomas  <pault@gcc.gnu.org>
1767
1768         PR fortran/38907
1769         * resolve.c (check_host_association): Remove the matching to
1770         correct an incorrect host association and use manipulation of
1771         the expression instead.
1772
1773 2009-01-20  Tobias Burnus  <burnus@net-b.de>
1774
1775         * invoke.texi (RANGE): RANGE also takes INTEGER arguments.
1776
1777 2009-01-19  Mikael Morin  <mikael.morin@tele2.fr>
1778
1779         PR fortran/38859
1780         * simplify.c (simplify_bound): Don't use array specification
1781         if variable or component has subsequent references.
1782
1783 2009-01-17  Paul Thomas  <pault@gcc.gnu.org>
1784
1785         PR fortran/38657
1786         * module.c (write_common_0): Add argument 'this_module' and
1787         check that non-use associated common blocks are written first.
1788         (write_common): Call write_common_0 twice, once with true and
1789         then with false.
1790
1791 2009-01-17  Paul Thomas  <pault@gcc.gnu.org>
1792
1793         PR fortran/34955
1794         * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Has
1795         been absorbed into gfc_conv_intrinsic_transfer. All
1796         references to it in trans-intrinsic.c have been changed
1797         accordingly.  PR fixed by using a temporary for scalar
1798         character transfer, when the source is shorter than the
1799         destination.
1800
1801 2009-01-17  Paul Thomas  <pault@gcc.gnu.org>
1802
1803         PR fortran/38657
1804         * module.c (write_common_0): Revert patch of 2009-01-05.
1805
1806 2009-01-16  Janus Weil  <janus@gcc.gnu.org>
1807
1808         PR fortran/38152
1809         * expr.c (gfc_check_pointer_assign): Allow use-associated procedure
1810         pointers as lvalue.
1811         * trans-decl.c (get_proc_pointer_decl,gfc_create_module_variable):
1812         Enable procedure pointers as module variables.
1813
1814 2009-01-14  Steven G. Kargl  <kargl@gcc.gnu.org>
1815
1816         * ChangeLog-2007: Clean out svn merge droppings.
1817
1818 2009-01-10  Paul Thomas  <pault@gcc.gnu.org>
1819
1820         PR fortran/38763
1821         * target-memory.c (encode_derived): Encode NULL.
1822
1823 2009-01-10  Paul Thomas  <pault@gcc.gnu.org>
1824
1825         PR fortran/38765
1826         * resolve.c (check_host_association): Use the symtree name to
1827         search for a potential contained procedure, since this is the
1828         name by which it would be referenced.
1829
1830 2009-01-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
1831
1832         PR fortran/38220
1833         * interface.c (gfc_procedure_use):  Don't warn about functions
1834         from ISO_C_BINDING.
1835         * symbol.c (generate_isocbinding_symbol):  Mark c_loc and
1836         c_funloc as pure.
1837
1838 2009-01-05  Paul Thomas  <pault@gcc.gnu.org>
1839
1840         PR fortran/38657
1841         * module.c (write_common_0): Use the name of the symtree rather
1842         than the common block, to determine if the common has been
1843         written.
1844
1845 2009-01-05  Daniel Franke  <franke.daniel@gmail.com>
1846
1847         PR fortran/37159
1848         * check.c (gfc_check_random_seed): Added size check for GET
1849         dummy argument, reworded error messages to follow common pattern.
1850
1851 2009-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
1852
1853         PR fortran/38672
1854         * trans-types.c (gfc_get_derived_type):  Check for the
1855         presence of derived->ns->proc_name before
1856         accessing derived->ns->proc_name->attr.flavor .
1857         * resolve.c (resolve_symbol):  Likewise.
1858
1859 2009-01-05  Paul Thomas  <pault@gcc.gnu.org>
1860
1861         PR fortran/38665
1862         * gfortran.h : Add bit to gfc_expr 'user_operator'
1863         * interface.c (gfc_extend_expr): Set the above if the operator
1864         is substituted by a function. 
1865         * resolve.c (check_host_association): Return if above is set.
1866
1867 2009-01-04  Mikael Morin  <mikael.morin@tele2.fr>
1868
1869         PR fortran/35681
1870         * ChangeLog-2008: Fix function name.
1871
1872         PR fortran/38487
1873         * dependency.c (gfc_check_argument_var_dependency):
1874         Move the check for pointerness inside the if block
1875         so that it doesn't affect the return value.
1876
1877         PR fortran/38669
1878         * trans-stmt.c (gfc_trans_call):
1879         Add the dependency code after the loop bounds calculation one.
1880
1881 2009-01-04  Daniel Franke  <franke.daniel@gmail.com>
1882
1883         * intrinsic.c (do_simplify): Removed already implemented TODO.
1884
1885 2009-01-04  Daniel Franke  <franke.daniel@gmail.com>
1886
1887         PR fortran/38718
1888         * simplify.c (gfc_simplify_merge): New.
1889         * intrinsic.h (gfc_simplify_merge): New prototype.
1890         * intrinsic.c (add_functions): Added simplification for MERGE.
1891
1892 2009-01-04  Mikael Morin  <mikael.morin@tele2.fr>
1893
1894         PR fortran/38536
1895         * gfortran.h (gfc_is_data_pointer): Added prototype
1896         * resolve.c (gfc_iso_c_func_interface):
1897         Use gfc_is_data_pointer to test for pointer attribute.
1898         * dependency.c (gfc_is_data_pointer):
1899         Support pointer-returning functions.
1900
1901 2009-01-03  Daniel Franke  <franke.daniel@gmail.com>
1902
1903         * symbol.c (save_symbol): Don't SAVE function results.
1904
1905 2009-01-03  Paul Thomas  <pault@gcc.gnu.org>
1906
1907         PR fortran/38594
1908         * resolve.c (resolve_call): When searching for proper host
1909         association, use symtree rather than symbol.  For everything
1910         except generic subroutines, substitute the symtree in the call
1911         rather than the symbol.
1912
1913 \f
1914 Copyright (C) 2009 Free Software Foundation, Inc.
1915
1916 Copying and distribution of this file, with or without modification,
1917 are permitted in any medium without royalty provided the copyright
1918 notice and this notice are preserved.