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