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