OSDN Git Service

2010-03-12 Paul Thomas <pault@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
2
3         PR fortran/43291
4         PR fortran/43326
5         * resolve.c (resolve_compcall): Add new boolean dummy argument
6         'class_members'. Only resolve expression at end if false.
7         Remove redundant, static variable 'class_object'.
8         (check_class_members): Add extra argument to call of
9         resolve_compcall.
10         (resolve_typebound_function): Renamed resolve_class_compcall.
11         Do all the detection of class references here. Correct calls to
12         resolve_compcall for extra argument.
13         (resolve_typebound_subroutine): resolve_class_typebound_call
14         renamed. Otherwise same as resolve_typebound_function.
15         (gfc_resolve_expr): Call resolve_typebound_function.
16         (resolve_code): Call resolve_typebound_subroutine.
17
18 2010-03-10  Tobias Burnus  <burnus@net-b.de
19
20         PR fortran/43303
21         * symbol.c (get_iso_c_sym): Set sym->result.
22
23 2010-03-08  Janus Weil  <janus@gcc.gnu.org>
24
25         PR fortran/43256
26         * resolve.c (resolve_compcall): Don't set 'value.function.name' here
27         for TBPs, otherwise they will not be resolved properly.
28         (resolve_function): Use 'value.function.esym' instead of
29         'value.function.name' to check if we're dealing with a TBP.
30         (check_class_members): Set correct type of passed object for all TBPs,
31         not only generic ones, except if the type is abstract.
32
33 2010-03-04  Janus Weil  <janus@gcc.gnu.org>
34
35         PR fortran/43244
36         * decl.c (gfc_match_final_decl): Make sure variable names starting with
37         'final...' are not misinterpreted as FINAL statements.
38
39 2010-03-03  Paul Thomas  <pault@gcc.gnu.org>
40
41         PR fortran/43243
42         * trans-array.c (gfc_conv_array_parameter): Contiguous refs to
43         allocatable ultimate components do not need temporaries, whilst
44         ultimate pointer components do.
45
46 2010-03-03  Janus Weil  <janus@gcc.gnu.org>
47
48         PR fortran/43169
49         * resolve.c (resolve_code): Correctly set gfc_current_ns for
50         EXEC_SELECT_TYPE.
51         (gfc_impure_variable): Make it work with sub-namespaces (BLOCK etc).
52         (gfc_pure): Ditto.
53
54 2010-03-02  Paul Thomas  <pault@gcc.gnu.org>
55
56         PR fortran/43180
57         * trans-array.c (gfc_conv_array_parameter): A full array of
58         derived type need not be restricted to a symbol without an
59         array spec to use the call to gfc_conv_expr_descriptor.
60
61         PR fortran/43173
62         * trans-array.c (gfc_conv_array_parameter): Contiguous refs to
63         allocatable arrays do not need temporaries.
64
65 2010-03-01  Tobias Burnus  <burnus@net-b.de>
66
67         PR fortran/43199
68         * resolve.c (find_array_spec): Handle REF_COMPONENT with
69         CLASS components.
70
71 2010-02-28  Tobias Burnus  <burnus@net-b.de>
72
73         PR fortran/43205
74         * trans-expr.c (is_zero_initializer_p): Move up in the file.
75         (gfc_conv_initializer): Handle zero initializer as special case.
76
77 2010-02-27  Tobias Burnus  <burnus@net-b.de>
78
79         PR fortran/43185
80         * resolve.c (resolve_fl_variable_derived): Imply SAVE
81         for module variables for Fortran 2008.
82
83 2010-02-25  Jakub Jelinek  <jakub@redhat.com>
84
85         PR debug/43166
86         * trans-common.c (build_common_decl): Also update DECL_MODE,
87         and DECL_SIZE when encountering a larger common block and call
88         layout_decl.
89
90 2010-02-24  Tobias Burnus  <burnus@net-b.de>              
91
92         PR fortran/43042
93         * trans-expr.c (gfc_conv_initializer): Call directly
94         gfc_conv_constant for C_NULL_(FUN)PTR.              
95
96 2010-02-22  Paul Thomas  <pault@gcc.gnu.org>
97
98         PR fortran/43072
99         * dependency.c (gfc_full_array_ref_p): Check for contiguous by
100         checking the rest of the dimensions for elements.
101
102 2010-02-21  Tobias Burnus  <burnus@net-b.de>
103
104         PR fortran/35259
105         * gfortran.h (gfc_option_t): New flag -fprotect-parens.
106         * lang.opt: Ditto.
107         * option.c (gfc_init_options,gfc_handle_option): Ditto.
108         * trans-expr.c (gfc_conv_expr_op): Use the flag.
109         * invoke.texi: Document new -fno-protect-parens flag.
110
111 2010-02-20  Paul Thomas  <pault@gcc.gnu.org>
112
113         PR fortran/36932
114         PR fortran/36933
115         PR fortran/43072
116         PR fortran/43111
117         * dependency.c (gfc_check_argument_var_dependency): Use enum
118         value instead of arithmetic vaue for 'elemental'.
119         (check_data_pointer_types): New function.
120         (gfc_check_dependency): Call check_data_pointer_types.
121         * trans-array.h : Change fourth argument of
122         gfc_conv_array_parameter to boolean.
123         * trans-array.c (gfc_conv_array_parameter): A contiguous array
124         can be a dummy but it must not be assumed shape or deferred.
125         Change fourth argument to boolean. Array constructor exprs will
126         always be contiguous and do not need packing and unpacking.
127         * trans-expr.c (gfc_conv_procedure_call): Clean up some white
128         space and change fourth argument of gfc_conv_array_parameter
129         to boolean.
130         (gfc_trans_arrayfunc_assign): Change fourth argument of
131         gfc_conv_array_parameter to boolean.
132         * trans-io.c (gfc_convert_array_to_string): The same.
133         * trans-intrinsic.c (gfc_conv_intrinsic_loc): The same.
134
135 2010-02-20  Tobias Burnus  <burnus@net-b.de>
136
137         PR fortran/42958
138         * libgfortran.h: Add GFC_RTCHECK_MEM.
139         * invoke.texi (-fcheck=): Document -fcheck=mem.
140         * tranc.c (gfc_call_malloc): Remove negative-size run-time error
141         and enable malloc-success check only with -fcheck=mem.
142         * option.c (gfc_handle_runtime_check_option): Add -fcheck=mem.
143
144 2010-02-16  Tobias Burnus  <burnus@net-b.de>
145
146         PR fortran/43040
147         * gfortran.h (gfc_isym_id): Rename GFS_ISYM_GAMMA to GFS_ISYM_TGAMMA.
148         * intrinsic.c (add_functions): Ditto.
149         * iresolve.c (gfc_resolve_gamma): Call tgamma instead of gamma.
150         * mathbuiltins.def: Use TGAMMA instead of GAMMA with "tgamma".
151
152 2010-02-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
153
154         PR fortran/32382
155         * trans-stmt.h: Add prototype for gfc_trans_code_cond. Add tree cond to
156         gfc_trans_do prototype.
157         * trans-stmt.c (gfc_trans_simple_do): Add optional argument to pass in
158         a loop exit condition.  If exit condition is given, build the loop exit
159         code, checking IO results of implied do loops in READ and WRITE.
160         (gfc_trans_do): Likewise.
161         * trans.c (trans_code): New static work function, previously
162         gfc_trans_code. Passes exit condition to gfc_trans_do.
163         (gfc_trans_code): Calls trans_code with NULL_TREE condition.
164         (gfc_trans_code_cond): Calls trans_code with loop exit condition.
165         * trans-io.c (build_dt): Build an exit condition to allow checking IO
166         result status bits in the dtparm structure. Use this condition in call
167         to gfc_trans_code_cond.
168
169 2010-02-13  Paul Thomas  <pault@gcc.gnu.org>
170
171         PR fortran/41113
172         PR fortran/41117
173         * trans-array.c (gfc_conv_array_parameter): Use
174         gfc_full_array_ref_p to detect full and contiguous variable
175         arrays. Full array components and contiguous arrays do not need
176         internal_pack and internal_unpack.
177
178 2010-02-11  Jakub Jelinek  <jakub@redhat.com>
179
180         PR fortran/43030
181         * resolve.c (gfc_resolve_dim_arg): Call gfc_clear_ts.
182
183         PR fortran/43029
184         * decl.c (enumerator_decl): Don't call gfc_free_enum_history
185         here.
186         (gfc_match_enumerator_def): But here whenever enumerator_decl returns
187         MATCH_ERROR.
188
189 2010-02-10  Joost VandeVondele <jv244@cam.ac.uk>
190             Tobias Burnus <burnus@net-b.de>
191
192         PR fortran/40823
193         * decl.c (gfc_match_subroutine): Explicitly set sym->declared_at.
194
195 2010-02-10  Tobias Burnus  <burnus@net-b.de>
196
197         PR fortran/43015
198         * trans-decl.c (gfc_generate_function_code): Only check
199         actual-vs.-dummy character bounds if not bind(C).
200
201 2010-02-10  Jakub Jelinek  <jakub@redhat.com>
202
203         PR fortran/42309
204         * trans-expr.c (gfc_conv_subref_array_arg): Avoid accessing
205         info->dimen after info has been freed.
206
207 2010-02-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
208
209         PR fortran/42999
210         * array.c (gfc_constant_ac): Do not prevent expansion of constructors
211         with iterators.
212
213 2010-02-09  Jakub Jelinek  <jakub@redhat.com>
214
215         * module.c (fix_mio_expr): Declare sym.
216
217 2010-02-09  Paul Thomas  <pault@gcc.gnu.org>
218
219         PR fortran/41869
220         * module.c (fix_mio_expr): Fix for private generic procedures.
221
222 2010-02-09  Daniel Kraft  <d@domob.eu>
223
224         PR fortran/39171
225         * resolve.c (resolve_charlen): Change warning about negative CHARACTER
226         length to be correct and issue only with -Wsurprising.
227         * invoke.texi (Wsurprising): Mention this new warning that is
228         turned on by -Wsurprising.
229
230 2010-02-09  Daniel Kraft  <d@domob.eu>
231
232         PR fortran/41507
233         * intrinsic.texi (MAXVAL): Remove wrong claim that array argument
234         can be CHARACTER type.
235         (MINVAL), (MAXLOC), (MINLOC): Ditto.
236
237 2010-02-05  Paul Thomas  <pault@gcc.gnu.org>
238
239         PR fortran/42309
240         * trans-expr.c (gfc_conv_subref_array_arg): Add new argument
241         'formal_ptr'. If this is true, give returned descriptor unity
242         lbounds, in all dimensions, and the appropriate offset.
243         (gfc_conv_procedure_call); If formal is a pointer, set the last
244         argument of gfc_conv_subref_array_arg to true.
245         * trans.h : Add last argument for gfc_conv_subref_array_arg.
246         * trans-io.c (set_internal_unit, gfc_trans_transfer): Set the
247         new arg of gfc_conv_subref_array_arg to false.
248         * trans-stmt.c (forall_make_variable_temp): The same.
249
250 2010-02-03  Tobias Burnus  <burnus@net-b.de>
251
252         PR fortran/42936
253         * interface.c (compare_parameter): Disable rank-checking
254         for NULL().
255
256 2010-02-02  Tobias Burnus  <burnus@net-b.de>
257
258         PR fortran/42650
259         * parse.c (decode_specification_statement): Use sym->result not sym.
260
261 2010-02-01  Tobias Burnus  <burnus@net-b.de>
262
263         PR fortran/42922
264         * decl.c (variable_decl): Allow default initializer in
265         TYPE declarations in PURE functions.
266
267 2010-01-31  Janus Weil  <janus@gcc.gnu.org>
268
269         PR fortran/42888
270         * resolve.c (resolve_allocate_expr): Move default initialization code
271         here from gfc_trans_allocate.
272         * trans.c (gfc_trans_code): Call gfc_trans_class_assign also for
273         EXEC_INIT_ASSIGN.
274         * trans-expr.c (gfc_trans_class_assign): Handle default initialization
275         of CLASS variables via memcpy.
276         * trans-stmt.c (gfc_trans_allocate): Move default initialization code
277         to resolve_allocate_expr.
278
279 2010-01-31  Paul Thomas  <pault@gcc.gnu.org>
280
281         PR fortran/38324
282         * expr.c (gfc_get_full_arrayspec_from_expr): New function.
283         * gfortran.h : Add prototype for above.
284         * trans-expr.c (gfc_trans_alloc_subarray_assign): New function.
285         (gfc_trans_subcomponent_assign): Call new function to replace
286         the code to deal with allocatable components.
287         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Call
288         gfc_get_full_arrayspec_from_expr to replace existing code.
289
290 2010-01-25  Tobias Burnus  <burnus@net-b.de>
291
292         PR fortran/42858
293         * array.c (gfc_array_dimen_size): Fix intrinsic procedure
294         check.
295
296 2010-01-24  Paul Thomas  <pault@gcc.gnu.org>
297
298         PR fortran/41044
299         PR fortran/41167
300         * expr.c (remove_subobject_ref): If the constructor is NULL use
301         the expression as the source.
302         (simplify_const_ref): Change the type of expression if
303         there are component references.  Allow for substring to be at
304         the end of an arbitrarily long chain of references.  If an
305         element is found that is not in an EXPR_ARRAY, assume that this
306         is scalar initialization of array. Call remove_subobject_ref in
307         this case with NULL second argument.
308
309 2010-01-24  Tobias Burnus  <burnus@net-b.de>
310
311         PR fortran/39304
312         * array.c (gfc_array_dimen_size): Use correct specific
313         function in the check.
314
315 2010-01-21  Paul Thomas  <pault@gcc.gnu.org>
316
317         PR fortran/42736
318         * trans-stmt.c (gfc_conv_elemental_dependencies): If temporary
319         is required, turn any trailing array elements after a range
320         into ranges so that offsets can be calculated.
321
322 2010-01-20  Joern Rennecke  <amylaar@spamcop.net>
323
324         * module.c (mio_f2k_derived): Use enumerator as initializer of
325         enum variable.
326
327         PR bootstrap/42812
328         * gfortran.h  (struct gfc_namespace) <resolved>: Change to signed
329         bitfield of width 2.
330
331 2010-01-19  Janus Weil  <janus@gcc.gnu.org>
332
333         PR fortran/42804
334         * resolve.c (extract_compcall_passed_object): Set locus for
335         passed-object argument.
336         (extract_ppc_passed_object): Set locus and correctly remove PPC
337         reference.
338
339 2010-01-19  Paul Thomas  <pault@gcc.gnu.org>
340
341         PR fortran/42783
342         * trans-decl.c (add_argument_checking): Do not use the backend
343         decl directly to test for the presence of an optional dummy
344         argument.  Use gfc_conv_expr_present, remembering to set the
345         symbol referenced.
346
347         PR fortran/42772
348         * trans-decl.c (gfc_generate_function_code): Small white space
349         changes. If 'recurcheckvar' is NULL do not try to reset it.
350
351 2010-01-19  Janus Weil  <janus@gcc.gnu.org>
352
353         PR fortran/42545
354         * resolve.c (resolve_fl_derived): Set the accessibility of the parent
355         component for extended types.
356         * symbol.c (gfc_find_component): Remove a wrongly-worded error message
357         and take care of parent component accessibility.
358
359 2010-01-17  Janus Weil  <janus@gcc.gnu.org>
360
361         PR fortran/42677
362         * gfortran.h (symbol_attribute): Remove 'ambiguous_interfaces'.
363         * interface.c (check_interface1): Move a warning message here from
364         resolve_fl_procedure.
365         (check_sym_interfaces): Removed 'attr.ambiguous_interfaces'.
366         * module.c (read_module): Remove call to gfc_check_interfaces, since
367         this comes too early here.
368         * resolve.c (resolve_fl_procedure): Move warning message to
369         check_interface1.
370
371 2010-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
372
373         PR fortran/42684
374         * interface.c (check_interface1): Pass symbol name rather than NULL to
375         gfc_compare_interfaces. (gfc_compare_interfaces): Add assert to
376         trap MULL.
377         * resolve.c (check_generic_tbp_ambiguity): Pass symbol name rather
378         than NULL to gfc_compare_interfaces.
379
380 2010-01-14  Paul Thomas  <pault@gcc.gnu.org>
381
382         PR fortran/41478
383         * trans-array.c (duplicate_allocatable):  Static version of
384         gfc_duplicate_allocatable with provision to handle scalar
385         components. New boolean argument to switch off call to malloc
386         if true.
387         (gfc_duplicate_allocatable): New function to call above with
388         new argument false.
389         (gfc_copy_allocatable_data): New function to call above with
390         new argument true.
391         (structure_alloc_comps): Do not apply indirect reference to
392         scalar pointers. Add new section to copy allocatable components
393         of arrays. Extend copying of allocatable components to include
394         scalars.
395         (gfc_copy_only_alloc_comp): New function to copy allocatable
396         component derived types, without allocating the base structure.
397         * trans-array.h : Add primitive for gfc_copy_allocatable_data.
398         Add primitive for gfc_copy_only_alloc_comp.
399         * trans-expr.c (gfc_conv_procedure_call): After calls to
400         transformational functions with results that are derived types
401         with allocatable components, copy the components in the result.
402         (gfc_trans_arrayfunc_assign): Deallocate allocatable components
403         of lhs derived types before allocation.
404         
405 2010-01-14  Paul Thomas  <pault@gcc.gnu.org>
406
407         PR fortran/42481
408         * module.c (load_generic_interfaces): If a procedure that is
409         use associated but not generic is given an interface that
410         includes itself, then make it generic.
411
412 2010-01-11  Joseph Myers  <joseph@codesourcery.com>  
413             Shujing Zhao  <pearly.zhao@oracle.com>
414
415         PR translation/42469
416         * lang.opt (fblas-matmul-limit=, finit-character=, finit-integer=,
417         finit-logical=, finit-real=, fmax-array-constructor=): Use tab
418         character between option name and help text.
419
420 2010-01-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
421
422         PR fortran/20923
423         PR fortran/32489
424         * trans-array.c (gfc_conv_array_initializer): Change call to
425         gfc_error_now to call to gfc_fatal_error.
426         * array.c (count_elements): Whitespace. (extract_element): Whitespace.
427         (is_constant_element): Changed name from constant_element.
428         (gfc_constant_ac): Only use expand_construuctor for expression
429         types of EXPR_ARRAY.  If expression type is EXPR_CONSTANT, no need to
430         call gfc_is_constant_expr.
431         * expr.c (gfc_reduce_init_expr): Adjust conditionals and delete error
432         message.
433         * resolve.c (gfc_is_expandable_expr): New function that determiners if
434         array expressions should have their constructors expanded.
435         (gfc_resolve_expr): Use new function to determine whether or not to call
436         gfc_expand_constructor.
437
438 2010-01-09  Tobias Burnus  <burnus@net-b.de>
439
440         PR fortran/41298
441         * trans-expr.c (gfc_trans_structure_assign): Handle
442         c_null_(fun)ptr.
443         * symbol.c (gen_special_c_interop_ptr): Add NULL_EXPR
444         to the constructor for c_null_(fun)ptr.
445         * resolve.c (resolve_structure_cons): Add special case
446         for c_null_(fun)ptr.
447
448 2010-01-09  Jakub Jelinek  <jakub@redhat.com>
449
450         * gfortranspec.c (lang_specific_driver): Update copyright notice
451         dates.
452
453 2010-01-08  Tobias Burnus  <burnus@net-b.de>
454
455         PR/fortran 25829
456         * symbol.c (check_conflict, gfc_copy_attr): Add
457         ASYNCHRONOUS support.
458         (gfc_add_asynchronous): New function.
459         * decl.c (match_attr_spec): Add ASYNCHRONOUS support.
460         (gfc_match_asynchronous): New function.
461         * dump-parse-tree.c (show_attr): Add ASYNCHRONOUS support.
462         * gfortran.h (symbol_attribute): New ASYNCHRONOUS bit.
463         (gfc_add_asynchronous): New Prototype.
464         * module.c (ab_attribute, mio_symbol_attribute): Add
465         ASYNCHRONOUS support.
466         * resolve.c (was_declared): Ditto.
467         * match.h (gfc_match_asynchronous): New prototype.
468         * parse.c (decode_specification_statement,decode_statement):
469         Add ASYNCHRONOUS support.
470
471 2010-01-07  Tobias Burnus  <burnus@net-b.de>
472
473         PR fortran/42597
474         * trans-decl.c (get_proc_pointer_decl): Fix call to
475         gfc_conv_initializer for array-valued proc-pointer funcs.
476
477 2010-01-07  Tobias Burnus  <burnus@net-b.de>
478
479         PR fortran/41872
480         * trans-decl.c (gfc_trans_deferred_vars): Don't initialize
481         allocatable scalars with SAVE attribute.
482
483 2010-01-05  Tobias Burnus  <burnus@net-b.de>
484
485         PR fortran/42517
486         * options.c (gfc_post_options): Set -frecursion
487         when -fopenmp is used.
488
489 2010-01-05  Tobias Burnus  <burnus@net-b.de>
490
491         PR fortran/41872
492         * trans-expr.c (gfc_conv_procedure_call): Nullify
493         return value for allocatable-scalar character functions.
494
495 2010-01-04  Tobias Burnus  <burnus@net-b.de>
496
497         PR fortran/36161
498         * error.c (error_printf, gfc_warning, gfc_notify_std,
499         gfc_warning_now, gfc_error, gfc_error_now,
500         gfc_fatal_error): Change argument name from nocmsgid to
501         gmsgid to enable (x)gettext's % checking.
502
503 2010-01-04  Tobias Burnus  <burnus@net-b.de>
504         
505         * trans-decl.c (gfc_trans_deferred_vars): Fix spelling.
506
507 2010-01-04  Tobias Burnus  <burnus@net-b.de>
508
509         PR fortran/41872
510         * trans-expr.c (gfc_conv_procedure_call): Add indirect ref
511         for functions returning allocatable scalars.
512         * trans-stmt.c (gfc_trans_allocate): Emmit error when
513         reallocating an allocatable scalar.
514         * trans.c (gfc_allocate_with_status): Fix pseudocode syntax
515         in comment.
516         * trans-decl.c (gfc_trans_deferred_vars): Nullify local
517         allocatable scalars.
518         (gfc_generate_function_code): Nullify result variable for
519         allocatable scalars.
520         
521         PR fortran/40849
522         * module.c (gfc_use_module): Fix warning string to allow
523         for translation.
524
525         PR fortran/42517
526         * invoke.texi (-fcheck=recursion): Mention that the checking
527         is also disabled for -frecursive.
528         * trans-decl.c (gfc_generate_function_code): Disable
529         -fcheck=recursion when -frecursive is used.
530
531         * intrinsic.texi (iso_c_binding): Improve wording.
532
533 \f
534 Copyright (C) 2010 Free Software Foundation, Inc.
535
536 Copying and distribution of this file, with or without modification,
537 are permitted in any medium without royalty provided the copyright
538 notice and this notice are preserved.