OSDN Git Service

a9a610e69c3088912e6b5786fc6e5a71a1546f32
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2006-02-03  Steven G. Kargl  <kargls@comcast>
2             Paul Thomas  <pault@gcc.gnu.org>
3
4         * resolve.c (resolve_symbol): Default initialization of derived type
5         component reguires the SAVE attribute.
6
7 2006-02-02  Steven G. Kargl  <kargls@comcast>
8
9         PR fortran/24958
10         match.c (gfc_match_nullify):  Free the list from head not tail.
11
12         PR fortran/25072
13         * match.c (match_forall_header): Fix internal error caused by bogus
14         gfc_epxr pointers.
15
16
17 2006-01-31  Thomas Koenig  <Thomas.Koenig@online.de>
18
19         PR fortran/26039
20         expr.c (gfc_check_conformance):  Reorder error message
21         to avoid plural.
22         check.c(gfc_check_minloc_maxloc):  Call gfc_check_conformance
23         for checking arguments array and mask.
24         (check_reduction):  Likewise.
25
26 2005-01-30  Erik Edelmann  <eedelman@gcc.gnu.org>
27
28         PR fortran/24266
29         * trans-io.c (set_internal_unit): Check the rank of the
30         expression node itself instead of its symbol.
31
32 2006-01-29  Paul Thomas  <pault@gcc.gnu.org>
33
34         PR fortran/18578
35         PR fortran/18579
36         PR fortran/20857
37         PR fortran/20885
38         * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
39         if actual argument is not a variable.
40
41 2006-01-28  Paul Thomas  <pault@gcc.gnu.org>
42
43         PR fortran/17911
44         * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
45         the lvalue is a use associated procedure.
46
47         PR fortran/20895
48         PR fortran/25030
49         * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
50         character lengths are not the same.  Use gfc_dep_compare_expr for the
51         comparison.
52         * gfortran.h: Add prototype for gfc_dep_compare_expr.
53         * dependency.h: Remove prototype for gfc_dep_compare_expr.
54
55 2005-01-27  Paul Thomas  <pault@gcc.gnu.org>
56
57         PR fortran/25964
58         * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
59         generic_ids exempted from assumed size checking.
60
61 2006-01-27  Jakub Jelinek  <jakub@redhat.com>
62
63         PR fortran/25324
64         * Make-lang.in (fortran/scanner.o): Depend on toplev.h.
65         * lang.opt (fpreprocessed): New option.
66         * scanner.c: Include toplev.h.
67         (gfc_src_file, gfc_src_preprocessor_lines): New variables.
68         (preprocessor_line): Unescape filename if there were any
69         backslashes.
70         (load_file): If initial and gfc_src_file is not NULL,
71         use it rather than opening the file.  If gfc_src_preprocessor_lines
72         has non-NULL elements, pass it to preprocessor_line.
73         (unescape_filename, gfc_read_orig_filename): New functions.
74         * gfortran.h (gfc_option_t): Add flag_preprocessed.
75         (gfc_read_orig_filename): New prototype.
76         * options.c (gfc_init_options): Clear flag_preprocessed.
77         (gfc_post_options): If flag_preprocessed, call
78         gfc_read_orig_filename.
79         (gfc_handle_option): Handle OPT_fpreprocessed.
80         * lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
81         sources.
82
83 2005-01-27  Erik Edelmann  <eedelman@gcc.gnu.org>
84
85         * symbol.c (free_old_symbol): Fix confusing comment, and add code
86           to free old_symbol->formal.
87
88 2005-01-26  Paul Thomas  <pault@gcc.gnu.org>
89
90         PR fortran/25964
91         * resolve.c (resolve_function): Exclude statement functions from
92         global reference checking.
93
94         PR fortran/25084
95         PR fortran/20852
96         PR fortran/25085
97         PR fortran/25086
98         * resolve.c (resolve_function): Declare a gfc_symbol to replace the
99         references through the symtree to the symbol associated with the
100         function expresion. Give error on reference to an assumed character
101         length function is defined in an interface or an external function
102         that is not a dummy argument.
103         (resolve_symbol): Give error if an assumed character length function
104         is array-valued, pointer-valued, pure or recursive. Emit warning
105         that character(*) value functions are obsolescent in F95.
106
107         PR fortran/25416
108         * trans-expr.c (gfc_conv_function_call): The above patch to resolve.c
109         prevents any assumed character length function call from getting here
110         except intrinsics such as SPREAD. In this case, ensure that no
111         segfault occurs from referencing non-existent charlen->length->
112         expr_type and provide a backend_decl for the charlen from the charlen
113         of the first actual argument.
114
115         Cure temp name confusion.
116         * trans-expr.c (gfc_get_interface_mapping_array): Change name of
117         temporary from "parm" to "ifm" to avoid clash with temp coming from
118         trans-array.c.
119
120 2005-01-25  Erik Edelmann  <eedelman@gcc.gnu.org>
121
122         PR fortran/25716
123         * symbol.c (free_old_symbol): New function.
124         (gfc_commit_symbols): Use it.
125         (gfc_commit_symbol): New function.
126         (gfc_use_derived): Use it.
127         * gfortran.h: Add prototype for gfc_commit_symbol.
128         * intrinsic.c (gfc_find_function): Search in 'conversion'
129         if not found in 'functions'.
130         (gfc_convert_type_warn): Add a symtree to the new
131         expression node, and commit the new symtree->n.sym.
132         * resolve.c (gfc_resolve_index): Make sure typespec is
133         properly initialized.
134
135 2005-01-23  Paul Thomas  <pault@gcc.gnu.org>
136
137         PR fortran/25901
138         * decl.c (get_proc_name): Replace subroutine and function attributes
139         in "already defined" test by the formal arglist pointer being non-NULL.
140
141         Fix regression in testing of admissability of attributes.
142         * symbol.c (gfc_add_attribute): If the current_attr has non-zero
143         intent, do not do the check for a dummy being used.
144         * decl.c (attr_decl1): Add current_attr.intent as the third argument
145         in the call to gfc_add_attribute.
146         * gfortran.h: Add the third argument to the prototype for
147         gfc_add_attribute.
148
149 2006-01-21  Joseph S. Myers  <joseph@codesourcery.com>
150
151         * gfortranspec.c (lang_specific_driver): Update copyright notice
152         date.
153
154 2005-01-21  Paul Thomas  <pault@gcc.gnu.org>
155
156         PR fortran/25124
157         PR fortran/25625
158         * decl.c (get_proc_name): If there is an existing
159         symbol in the encompassing namespace, call errors
160         if it is a procedure of the same name or the kind
161         field is set, indicating a type declaration.
162
163         PR fortran/20881
164         PR fortran/23308
165         PR fortran/25538
166         PR fortran/25710
167         * decl.c (add_global_entry): New function to check
168         for existing global symbol with this name and to
169         create new one if none exists.
170         (gfc_match_entry): Call add_global_entry before
171         matching argument lists for subroutine and function
172         entries.
173         * gfortran.h: Prototype for existing function,
174         global_used.
175         * resolve.c (resolve_global_procedure): New function
176         to check global symbols for procedures.
177         (resolve_call, resolve_function): Calls to this
178         new function for non-contained and non-module
179         procedures.
180         * match.c (match_common): Add check for existing
181         global symbol, creat one if none exists and emit
182         error if there is a clash.
183         * parse.c (global_used): Remove static and use the
184         gsymbol name rather than the new_block name, so that
185         the function can be called from resolve.c.
186         (parse_block_data, parse_module, add_global_procedure):
187         Improve checks for existing gsymbols.  Emit error if
188         already defined or if references were to another type.
189         Set defined flag.
190
191         PR fortran/PR24276
192         * trans-expr.c (gfc_conv_aliased_arg): New function called by 
193         gfc_conv_function_call that coverts an expression for an aliased
194         component reference to a derived type array into a temporary array
195         of the same type as the component.  The temporary is passed as an
196         actual argument for the procedure call and is copied back to the
197         derived type after the call.
198         (is_aliased_array): New function that detects an array reference
199         that is followed by a component reference.
200         (gfc_conv_function_call): Detect an aliased actual argument with
201         is_aliased_array and convert it to a temporary and back again
202         using gfc_conv_aliased_arg.
203
204 2006-01-19  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
205
206         * gfortranspec.c: Update copyright years.
207         * trans.c: Likewise.
208         * trans-array.c: Likewise.
209         * trans-array.h: Likewise.
210         * trans-decl.c: Likewise.
211         * trans-stmt.c: Likewise.
212         * trans-stmt.h: Likewise.
213         * trans-types.c: Likewise.
214
215 2006-01-18  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
216
217         PR fortran/18540
218         PR fortran/18937
219         * gfortran.h (BBT_HEADER): Move definition up.
220         (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'.
221         * io.c (format_asterisk): Adapt initializer.
222         * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
223         as extension.
224         (warn_unused_label): Take gfc_st_label label as argument, adapt to
225         new data structure.
226         (gfc_resolve): Adapt call to warn_unused_label.
227         * symbol.c (compare_st_labels): New function.
228         (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to
229         using balanced binary tree.
230         * decl.c (match_char_length, gfc_match_old_kind_spec): Do away
231         with 'cnt'.
232         (warn_unused_label): Adapt to binary tree.
233         * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL.
234         * primary.c (match_kind_param): Do away with cnt.
235
236 2006-01-18  Paul Thomas  <pault@gcc.gnu.org>
237
238         PR fortran/20869
239         PR fortran/20875
240         PR fortran/25024
241         * symbol.c (check_conflict): Add pointer valued elemental
242         functions and internal procedures with the external attribute
243         to the list of conflicts.
244         (gfc_add_attribute): New catch-all function to perform the
245         checking of symbol attributes for attribute declaration
246         statements.
247         * decl.c (attr_decl1): Call gfc_add_attribute for each of -
248         (gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
249         gfc_match_pointer, gfc_match_dimension, gfc_match_target):
250         Remove spurious calls to checks in symbol.c.  Set the
251         attribute directly and use the call to attr_decl() for
252         checking.
253         * gfortran.h:  Add prototype for gfc_add_attribute.
254
255         PR fortran/25785
256         * resolve.c (resolve_function): Exclude PRESENT from assumed size
257         argument checking. Replace strcmp's with comparisons with generic
258         codes.
259
260 2006-01-16  Rafael \81Ávila de Esp\81índola  <rafael.espindola@gmail.com>
261
262         * gfortranspec.c (lang_specific_spec_functions): Remove.
263
264 2006-01-16  Richard Guenther  <rguenther@suse.de>
265
266         * trans-stmt.c (gfc_trans_if_1): Use fold_buildN and build_int_cst.
267         (gfc_trans_arithmetic_if): Likewise.
268         (gfc_trans_simple_do): Likewise.
269         (gfc_trans_do): Likewise.
270         (gfc_trans_do_while): Likewise.
271         (gfc_trans_logical_select): Likewise.
272         (gfc_trans_forall_loop): Likewise.
273         (generate_loop_for_temp_to_lhs): Likewise.
274         (generate_loop_for_rhs_to_temp): Likewise.
275         (gfc_trans_allocate): Likewise.
276         * trans.c (gfc_add_expr_to_block): Do not fold expr again.
277
278 2006-01-16  Richard Guenther  <rguenther@suse.de>
279
280         * trans-expr.c (gfc_conv_function_call): Use fold_build2.
281         * trans-stmt.c (gfc_trans_goto): Likewise.  Use build_int_cst.
282         * trans.c (gfc_trans_runtime_check): Don't fold the condition
283         again.
284
285 2006-01-13  Steven G. Kargl  <kargls@comcast.net>
286
287         PR fortran/25756
288         * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove
289         unneeded parenthesis. Fix-up the head of the list (2 lines gleaned
290         from g95).
291
292 2006-01-13  Diego Novillo  <dnovillo@redhat.com>
293
294         * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement
295         nodes.
296
297 2006-01-11  Tobias Schl\81üter  <tobias.schlueter@physik.uni-muenchen.de>
298
299         * parse.c (next_fixed): Remove superfluous string concatenation.
300
301 2006-01-11  Bernhard Fischer  <rep.nop@aon.at>
302
303         PR fortran/25486
304         * scanner.c (load_line): use maxlen to determine the line-length used
305         for padding lines in fixed form.
306
307 2005-01-11  Paul Thomas  <pault@gcc.gnu.org>
308
309         PR fortran/25730
310         * trans-types.c (copy_dt_decls_ifequal): Copy backend decl for
311         character lengths.
312
313 2006-01-09  Andrew Pinski  <pinskia@physics.uc.edu>
314
315         fortran/24936
316         * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
317         to avoid type mismatch.
318
319 2006-01-09  Andrew Pinski  <pinskia@physics.uc.edu>
320
321         PR fortran/21977
322         * trans-decl.c (gfc_generate_function_code): Move the NULLing of
323         current_fake_result_decl down to below generate_local_vars.
324
325 2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>
326
327         PR fortran/12456
328         * trans-expr.c (gfc_to_single_character): New function that converts
329         string to single character if its length is 1.
330         (gfc_build_compare_string):New function that compare string and handle
331         single character specially.
332         (gfc_conv_expr_op): Use gfc_build_compare_string.
333         (gfc_trans_string_copy): Use gfc_to_single_character.
334         * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
335         gfc_build_compare_string.
336         * trans.h (gfc_build_compare_string): Add prototype.
337
338 2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>
339
340         * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
341         constant.
342         (gfc_simplify_ichar): Get the result from unsinged char and in the
343         range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.
344
345 2005-01-08  Erik Edelmann  <eedelman@gcc.gnu.org>
346
347         PR fortran/25093
348         * resolve.c (resolve_fntype): Check that PUBLIC functions
349         aren't of PRIVATE type.
350
351 2005-01-07  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
352
353         * decl.c (gfc_match_function_decl): Correctly error out in case of
354         omitted function argument list.
355
356 2006-01-07  Paul Thomas  <pault@gcc.gnu.org>
357
358         PR fortran/22146
359         * trans-array.c (gfc_reverse_ss): Remove static attribute.
360         (gfc_walk_elemental_function_args): Replace gfc_expr * argument for
361         the function call with the corresponding gfc_actual_arglist*.  Change
362         code accordingly.
363         (gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
364         now requires the actual argument list instead of the expression for
365         the function call.
366         * trans-array.h: Modify the prototype for gfc_walk_elemental_function_args
367         and provide a prototype for gfc_reverse_ss.
368         * trans-stmt.h (gfc_trans_call): Add the scalarization code for the case
369         where an elemental subroutine has array valued actual arguments.
370
371         PR fortran/25029
372         PR fortran/21256
373         PR fortran/20868
374         PR fortran/20870
375         * resolve.c (check_assumed_size_reference): New function to check for upper
376         bound in assumed size array references.
377         (resolve_assumed_size_actual): New function to do a very restricted scan
378         of actual argument expressions of those procedures for which incomplete
379         assumed size array references are not allowed.
380         (resolve_function, resolve_call): Switch off assumed size checking of
381         actual arguments, except for elemental procedures and intrinsic
382         inquiry functions, in some circumstances.
383         (resolve_variable): Call check_assumed_size_reference.
384
385 2006-01-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
386
387         PR fortran/24268
388         * io.c (next_char_not_space): New function that returns the next
389         character that is not white space.
390         (format_lex): Use the new function to skip whitespace within
391         a format string.
392
393 2006-01-05  Erik Edelmann  <eedelman@gcc.gnu.org>
394
395         PR fortran/23675
396         * expr.c (gfc_expr_set_symbols_referenced): New function.
397         * gfortran.h: Add a function prototype for it.
398         * resolve.c (resolve_function): Use it for
399         use associated character functions lengths.
400         * expr.c, gfortran.h, resolve.c: Updated copyright years.
401
402 2006-01-03  Steven G. Kargl  <kargls@comcast.net>
403
404         PR fortran/25101
405         * resolve.c (resolve_forall_iterators):  Check for scalar variables;
406         Check stride is nonzero.
407
408 2006-01-02  Steven G. Kargl  <kargls@comcast.net>
409
410         PR fortran/24640
411         * parse.c (next_free): Check for whitespace after the label.
412         * match.c (gfc_match_small_literal_int): Initialize cnt variable.
413
414 2006-01-01  Steven G. Kargl  <kargls@comcast.net>
415
416         * ChangeLog: Split previous years into ...
417         * ChangeLog-2002: here.
418         * ChangeLog-2003: here.
419         * ChangeLog-2004: here.
420         * ChangeLog-2005: here.