1 2017-01-02 Thomas Koenig <tkoenig@gcc.gnu.org>
4 * intrinsic.c (add_function): Add gfc_simplify_maxloc and
5 gfc_simplify_minloc to maxloc and minloc, respectively.
6 * intrinsic.h: Add prototypes for gfc_simplify_minloc
7 and gfc_simplify_maxloc.
8 * simplify.c (min_max_chose): Adjust prototype. Modify function
9 to have a return value which indicates if the extremum was found.
10 (is_constant_array_expr): Fix typo in comment.
11 (simplify_minmaxloc_to_scalar): New function.
12 (simplify_minmaxloc_nodim): New function.
13 (new_array): New function.
14 (simplify_minmaxloc_to_array): New function.
15 (gfc_simplify_minmaxloc): New function.
16 (simplify_minloc): New function.
17 (simplify_maxloc): New function.
19 2018-01-02 Thomas Koenig <tkoenig@gcc.gnu.org>
23 * simplify.c (gfc_simplify_cshift): Re-implement to allow full
26 2018-01-01 Paul Thomas <pault@gcc.gnu.org>
29 * resolve.c (resolve_fl_derived0): Add caf_token fields for
30 allocatable and pointer scalars, when -fcoarray selected.
31 * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
32 field as well as the backend_decl.
33 (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
34 derived types that are not vtypes. Components with caf_token
35 attribute are pvoid types. For a component requiring it, find
36 the caf_token field and have the component token field point to
40 *trans-types.c (gfc_get_array_descriptor_base): Add the token
41 field to the descriptor even when codimen not set.
43 2017-12-28 Steven G. Kargl <kargl@gcc.gnu.org>
46 * match.c (gfc_match_type_spec): Check for LOGICAL conflict in
47 type-spec versus LOGICAL intrinsic subprogram.
49 2017-12-28 Janne Blomqvist <jb@gcc.gnu.org>
52 * resolve.c (resolve_assoc_var): Don't set the constant value
53 unless the target is a constant expression.
55 2017-12-28 Paul Thomas <pault@gcc.gnu.org>
58 * trans-expr.c (gfc_trans_assignment_1): Free parameterized
59 components of the lhs if dealloc is set.
60 *trans-decl.c (gfc_trans_deferred_vars): Do not free the
61 parameterized components of function results on leaving scope.
63 2017_12_27 Louis Krupp <louis.krupp@zoho.com>
66 * expr.c (gfc_apply_init): Check that typespec has character type
67 before using character length field.
69 2017-12-26 Thomas Koenig <tkoenig@gcc.gnu.org>
72 * frontend-passes.c (create_var): If an array to be created
73 has unknown size and -fno-realloc-lhs is in effect,
76 2017-12-22 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
77 Eric Botcazou <ebotcazou@adacore.com>
79 * array.c (gfc_copy_iterator): Copy unroll field.
80 * decl.c (directive_unroll): New global variable.
81 (gfc_match_gcc_unroll): New function.
82 * gfortran.h (gfc_iterator]): Add unroll field.
83 (directive_unroll): Declare:
84 * match.c (gfc_match_do): Use memset to initialize the iterator.
85 * match.h (gfc_match_gcc_unroll): New prototype.
86 * parse.c (decode_gcc_attribute): Match "unroll".
87 (parse_do_block): Set iterator's unroll.
88 (parse_executable): Diagnose misplaced unroll directive.
89 * trans-stmt.c (gfc_trans_simple_do) Annotate loop condition with
90 annot_expr_unroll_kind.
91 (gfc_trans_do): Likewise.
92 * gfortran.texi (GNU Fortran Compiler Directives): Split section into
93 subections 'ATTRIBUTES directive' and 'UNROLL directive'.
95 2017-12-19 Jakub Jelinek <jakub@redhat.com>
97 * scanner.c (preprocessor_line): Replace Yoda conditions with typical
99 * dependency.c (check_section_vs_section): Likewise.
100 * trans-array.c (gfc_conv_expr_descriptor): Likewise.
102 2017-12-17 Janne Blomqvist <jb@gcc.gnu.org>
104 * decl.c (gfc_match_implicit_none): Use GFC_STD_F2018 instead of
106 * error.c (gfc_notify_std): Add GFC_STD_F2018{_DEL,_OBS} to
108 * gfortran.texi: Document -std=f2018.
109 * interface.c (compare_parameter): Fix comment.
110 * invoke.texi: Document -std=f2018.
111 * lang.opt: Add -std=f2018 argumnet.
112 * libgfortran.h (GFC_STD_F2015): Rename to GFC_STD_F0218, use
114 (GFC_STD_F2018_DEL): New macro.
115 (GFC_STD_F2018_OBS): Likewise.
116 * match.c (gfc_match_stopcode): Use GFC_STD_F2018.
117 * options.c (set_default_std_flags): Add F2018 flags to defaults.
118 (gfc_handle_option): Set options for -std=f2018.
120 2017-12-15 Jakub Jelinek <jakub@redhat.com>
122 * f95-lang.c (gfc_attribute_table): Swap affects_type_identity
123 and handler fields, adjust comments.
125 2017-12-14 Qing Zhao <qing.zhao@oracle.com>
128 * class.c (gfc_build_class_symbol): Replace call to
129 sprintf with xasprintf to avoid format-overflow warning.
130 (generate_finalization_wrapper): Likewise.
131 (gfc_find_derived_vtab): Likewise.
132 (find_intrinsic_vtab): Likewise.
134 2017-12-12 Thomas Koenig <tkoenig@gcc.gnu.org>
136 * intrinsic.texi (MAXLOC): Remove double description
140 2017-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
142 * intrinsic.texi (MAXLOC): Update documentation for
143 character arrays and KIND argument.
146 2017-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
149 * simplify.c (min_max_choose): Add prototype.
150 (gfc_count): Format correctly.
151 (simplify_transformation): Pass array argument to init_result_expr.
152 (gfc_simplify_minval_maxval): Remove.
153 (gfc_min): New function.
154 (gfc_simplify_minval): Call simplify_transformation.
155 (gfc_max): New function.
156 (gfc_simplify_maxval): Call simplify_transformation.
158 2017-12-10 Dominique d'Humieres <dominiq@lps.ens.fr>
161 * gfortran.h (gfc_find_case_gsymbol): New prototype.
162 * symbol.c (gfc_find_case_gsymbol): New procedure, case
163 insensistive version of gfc_find_gsymbol.
164 * resolve.c (resolve_common_blocks): Use it.
165 Replace %s with %qs where needed.
167 2017-12-09 Steven G. Kargl <kargl@gcc.gnu.org>
171 * match.c (gfc_match_allocate): Enforce F2008:C631.
173 2017-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
176 * arith.c (gfc_character2character): New function.
177 * arith.h: Add prototype.
178 * simplify.c (gfc_convert_constant): Handle character type.
180 2017-12-07 Martin Sebor <msebor@redhat.com>
183 * f95-lang.c (gfc_attribute_table): Initialize new member of struct
186 2017-12-03 Thomas Koenig <tkoenig@gcc.gnu.org>
189 * check.c (gfc_check_minval_maxval): Use
190 int_orLreal_or_char_check_f2003 for array argument.
191 * iresolve.c (gfc_resolve_maxval): Insert number in
192 function name for character arguments.
193 (gfc_resolve_minval): Likewise.
194 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
196 (gfc_conv_intrinsic_minmaxval): Resort arguments and call library
197 function if dealing with a character function.
199 2017-12-01 Qing Zhao <qing.zhao@oracle.com>
201 * decl.c (gfc_get_pdt_instance): Adjust the call to sprintf
202 to avoid the same buffer being both source and destination.
204 2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
207 * frontend-passes.c (create_var): Also handle
208 character arrays, handling deferred lenghts.
210 2017-12-01 Paul Thomas <pault@gcc.gnu.org>
213 * resolve.c (get_pdt_constructor): Initialize 'cons' to NULL.
214 (resolve_pdt): Correct typo in prior comment. Emit an error if
215 any parameters are deferred and the object is neither pointer
219 * decl.c (gfc_get_pdt_instance): Continue if the parameter sym
220 is not present or has no name. Select the parameter by name
221 of component, rather than component order. Remove all the other
222 manipulations of 'tail' when building the pdt instance.
223 (gfc_match_formal_arglist): Emit and error if a star is picked
224 up in a PDT decl parameter list.
227 * trans-array.c (set_loop_bounds): If a GFC_SS_COMPONENT has an
228 info->end, use it rather than falling through to
230 (structure_alloc_comps): Check that param->name is non-null
231 before comparing with the component name.
232 * trans-decl.c (gfc_get_symbol_decl): Do not use the static
233 initializer for PDT symbols.
234 (gfc_init_default_dt): Do nothing for PDT symbols.
235 * trans-io.c (transfer_array_component): Parameterized array
236 components use the descriptor ubound since the shape is not
241 * trans-expr.c (gfc_conv_component_ref): Do not use the charlen
242 backend_decl of pdt strings. Use the hidden component instead.
243 * trans-io.c (transfer_expr): Do not do IO on "hidden" string
244 lengths. Use the hidden string length for pdt string transfers
245 by adding it to the se structure. When finished nullify the
249 * decl.c (gfc_match_formal_arglist): If a name is not found or
250 star is found, while reading a type parameter list, emit an
252 (gfc_match_derived_decl): On reading a PDT parameter list, on
253 failure to match call gfc_error_recovery.
256 * decl.c (build_struct): Character kind defaults to 1, so use
257 kind_expr whatever is the set value.
258 (gfc_get_pdt_instance): Ditto.
259 * trans-array.c (structure_alloc_comps): Copy the expression
260 for the PDT string length before parameter substitution. Use
261 this expression for evaluation and free it after use.
263 2017-12-01 Jakub Jelinek <jakub@redhat.com>
266 * match.c (gfc_match): Add FALLTHRU comment to avoid
267 -Wimplicit-fallthrough warning.
269 2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
272 * frontend-passes.c (realloc_string_callback): Handle
273 case for which the RHS is an array expression.
275 2017-11-28 Janne Blomqvist <jb@gcc.gnu.org>
278 * gfortran.texi: Remove mentions of GFORTRAN_DEFAULT_RECL.
280 2017-11-28 Paul Thomas <pault@gcc.gnu.org>
283 * resolve.c (resolve_component): Only escape for use assciated
284 vtypes if the current namespace has no proc_name and is most
285 particularly block data.
287 2017-11-28 Jakub Jelinek <jakub@redhat.com>
289 * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR
290 using fold_build2_loc instead of fold_build3_loc.
291 * trans-io.c (io_result): Likewise.
292 * trans-stmt.c (gfc_trans_integer_select, gfc_trans_character_select):
295 2017-11-24 Jakub Jelinek <jakub@redhat.com>
298 * trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
299 attr.implicit_type in intrinsic_sym to avoid undesirable warning.
301 2017-11-23 Dirk Broemmel <d.broemmel@fz-juelich.de>
302 Jakub Jelinek <jakub@redhat.com>
305 * parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
308 2017-11-23 Mike Stump <mikestump@comcast.net>
309 Eric Botcazou <ebotcazou@adacore.com>
311 * trans-stmt.c (gfc_trans_forall_loop): Pass 3rd operand to
314 2017-11-23 Paul Thomas <pault@gcc.gnu.org>
317 * trans-types.c (gfc_sym_type): If a character function result
318 is missing the charlen backend_decl, use the one from the name-
319 space procedure symbol, if present.
321 2017-11-22 David Malcolm <dmalcolm@redhat.com>
324 * error.c (gfc_notify_std): Convert "quoted" param from bool to
327 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org>
330 * check.c (int_or_real_or_char_check_f2003): New function.
331 * iresolve.c (gfc_resolve_maxloc): Add number "2" for
332 character arguments and rank-zero return value.
333 (gfc_resolve_minloc): Likewise.
334 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of
335 character arguments and rank-zero return value by removing
336 unneeded arguments and calling the library function.
338 2017-11-22 Paul Thomas <pault@gcc.gnu.org>
341 * trans-stmt.c (trans_associate_var): Weaken the over strong
342 condition for using the fake result decl.
344 2017-11-20 Paul Thomas <pault@gcc.gnu.org>
347 * trans-expr.c (trans_class_vptr_len_assignment): Set from_len
348 if the temporary is unlimited polymorphic.
349 * trans-stmt.c (trans_associate_var): Use the fake result decl
350 to obtain the 'len' field from an explicit function result when
351 in that function scope.
353 2017-11-19 Paul Thomas <pault@gcc.gnu.org>
356 * expr.c (gfc_is_class_array_function): Renamed from
357 'gfc_is_alloc_class_array_function' and modified to return true
358 for pointers as well as allocatable results.
359 * gfortran.h : Change of name for prototype of above function.
360 * trans-array.c (gfc_add_loop_ss_code): Force finalization of
362 (build_class_array_ref): Change assertion into a condition.
363 (build_class_array_ref): Set the se class_vptr for class array
365 (gfc_walk_function_expr): Reference gfc_is_class_array_function
367 * trans-decl.c (get_proc_result): Move it up before
368 gfc_trans_deferred_vars.
369 (gfc_trans_deferred_vars): Nullify explicit return class arrays
371 * trans-expr.c (gfc_conv_class_to_class): Allow conversion of
372 class array functions that have an se class_vptr and use it
374 (gfc_conv_subref_array_arg): Rename reference to the above
376 (gfc_conv_procedure_call): Ditto. Add the se pre block to the
377 loop pre block before the function is evaluated. Do not
378 finalize class pointer results.
379 (arrayfunc_assign_needs_temporary, gfc_trans_assignment_1) More
381 * trans-intrinsic.c (gfc_conv_intrinsic_size): Ditto.
383 2017-11-18 Janne Blomqvist <jb@gcc.gnu.org>
386 * ioparm.def (IOPARM): Make nextrec a pintio.
388 2017-11-18 Janne Blomqvist <jb@gcc.gnu.org>
391 * ioparm.def (IOPARM): Make recl_in intio, and recl_out pintio.
393 2017-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
396 * expr.c (gfc_is_simply_contiguous): If a function call through a
397 class variable is done through a reference, check the function's
400 2017-11-17 Richard Biener <rguenther@suse.de>
403 * trans-stmt.c (gfc_trans_forall_loop): Annotate DO CONCURRENT
404 loops with annot_expr_parallel_kind instead of just
405 annot_expr_ivdep_kind.
407 2017-11-15 Martin Liska <mliska@suse.cz>
409 * options.c (gfc_post_options):
410 Do not set default value of warn_return_type.
411 * trans-decl.c (gfc_trans_deferred_vars):
412 Compare warn_return_type for greater than zero.
413 (generate_local_decl): Likewise
414 (gfc_generate_function_code): Likewise.
416 2017-11-13 Fritz Reese <fritzoreese@gmail.com>
419 * decl.c (match_clist_expr): Replace gcc_assert with proper
420 handling of bad result from spec_size().
421 * resolve.c (check_data_variable): Avoid NULL dereference when passing
424 2017-11-11 Janus Weil <janus@gcc.gnu.org>
427 * resolve.c (update_compcall_arglist): Improve error recovery,
430 2017-11-10 Fritz Reese <fritzoreese@gmail.com>
433 * gfortran.h (gfc_build_init_expr): New prototype.
434 * invoke.texi (finit-derived): Update documentation.
435 * expr.c (gfc_build_init_expr): New, from gfc_build_default_init_expr.
436 (gfc_build_default_init_expr): Redirect to gfc_build_init_expr(,,false)
437 (component_initializer): Force building initializers using
438 gfc_build_init_expr(,,true).
440 2017-11-10 Martin Sebor <msebor@redhat.com>
443 * gcc/fortran/decl.c (build_sym): Use strcpy instead of strncpy.
445 2017-11-10 Paul Thomas <pault@gcc.gnu.org>
448 * trans-stmt.c (gfc_trans_allocate): Remove the gcc_assert on
449 null string length for assumed length typespec and set
450 expr3_esize to NULL_TREE;
452 2017-11-09 Paul Thomas <pault@gcc.gnu.org>
455 * check.c (same_type_check): Introduce a new argument 'assoc'
456 with default value false. If this is true, use the symbol type
457 spec of BT_PROCEDURE expressions.
458 (gfc_check_associated): Set 'assoc' true in the call to
461 2017-11-09 Steven G. Kargl <kargl@gcc.gnu.org>
464 * interface.c (symbol_rank): Check for NULL pointer.
466 2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
469 * simplify.c(gfc_simplify_transfer): Do not dereference a NULL pointer.
472 2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
475 * arith.c (gfc_hollerith2character): Clear pad.
477 2017-11-08 Janne Blomqvist <jb@gcc.gnu.org>
480 * convert.c (truthvalue_conversion): Use logical_type_node.
481 * trans-array.c (gfc_trans_allocate_array_storage): Likewise.
482 (gfc_trans_create_temp_array): Likewise.
483 (gfc_trans_array_ctor_element): Likewise.
484 (gfc_trans_array_constructor_value): Likewise.
485 (trans_array_constructor): Likewise.
486 (trans_array_bound_check): Likewise.
487 (gfc_conv_array_ref): Likewise.
488 (gfc_trans_scalarized_loop_end): Likewise.
489 (gfc_conv_array_extent_dim): Likewise.
490 (gfc_array_init_size): Likewise.
491 (gfc_array_allocate): Likewise.
492 (gfc_trans_array_bounds): Likewise.
493 (gfc_trans_dummy_array_bias): Likewise.
494 (gfc_conv_array_parameter): Likewise.
495 (duplicate_allocatable): Likewise.
496 (duplicate_allocatable_coarray): Likewise.
497 (structure_alloc_comps): Likewise
498 (get_std_lbound): Likewise
499 (gfc_alloc_allocatable_for_assignment): Likewise
500 * trans-decl.c (add_argument_checking): Likewise
501 (gfc_generate_function_code): Likewise
502 * trans-expr.c (gfc_copy_class_to_class): Likewise
503 (gfc_trans_class_array_init_assign): Likewise
504 (gfc_trans_class_init_assign): Likewise
505 (gfc_conv_expr_present): Likewise
506 (gfc_conv_substring): Likewise
507 (gfc_conv_cst_int_power): Likewise
508 (gfc_conv_expr_op): Likewise
509 (gfc_conv_procedure_call): Likewise
510 (fill_with_spaces): Likewise
511 (gfc_trans_string_copy): Likewise
512 (gfc_trans_alloc_subarray_assign): Likewise
513 (gfc_trans_pointer_assignment): Likewise
514 (gfc_trans_scalar_assign): Likewise
515 (fcncall_realloc_result): Likewise
516 (alloc_scalar_allocatable_for_assignment): Likewise
517 (trans_class_assignment): Likewise
518 (gfc_trans_assignment_1): Likewise
519 * trans-intrinsic.c (build_fixbound_expr): Likewise
520 (gfc_conv_intrinsic_aint): Likewise
521 (gfc_trans_same_strlen_check): Likewise
522 (conv_caf_send): Likewise
523 (trans_this_image): Likewise
524 (conv_intrinsic_image_status): Likewise
525 (trans_image_index): Likewise
526 (gfc_conv_intrinsic_bound): Likewise
527 (conv_intrinsic_cobound): Likewise
528 (gfc_conv_intrinsic_mod): Likewise
529 (gfc_conv_intrinsic_dshift): Likewise
530 (gfc_conv_intrinsic_dim): Likewise
531 (gfc_conv_intrinsic_sign): Likewise
532 (gfc_conv_intrinsic_ctime): Likewise
533 (gfc_conv_intrinsic_fdate): Likewise
534 (gfc_conv_intrinsic_ttynam): Likewise
535 (gfc_conv_intrinsic_minmax): Likewise
536 (gfc_conv_intrinsic_minmax_char): Likewise
537 (gfc_conv_intrinsic_anyall): Likewise
538 (gfc_conv_intrinsic_arith): Likewise
539 (gfc_conv_intrinsic_minmaxloc): Likewise
540 (gfc_conv_intrinsic_minmaxval): Likewise
541 (gfc_conv_intrinsic_btest): Likewise
542 (gfc_conv_intrinsic_bitcomp): Likewise
543 (gfc_conv_intrinsic_shift): Likewise
544 (gfc_conv_intrinsic_ishft): Likewise
545 (gfc_conv_intrinsic_ishftc): Likewise
546 (gfc_conv_intrinsic_leadz): Likewise
547 (gfc_conv_intrinsic_trailz): Likewise
548 (gfc_conv_intrinsic_mask): Likewise
549 (gfc_conv_intrinsic_spacing): Likewise
550 (gfc_conv_intrinsic_rrspacing): Likewise
551 (gfc_conv_intrinsic_size): Likewise
552 (gfc_conv_intrinsic_sizeof): Likewise
553 (gfc_conv_intrinsic_transfer): Likewise
554 (gfc_conv_allocated): Likewise
555 (gfc_conv_associated): Likewise
556 (gfc_conv_same_type_as): Likewise
557 (gfc_conv_intrinsic_trim): Likewise
558 (gfc_conv_intrinsic_repeat): Likewise
559 (conv_isocbinding_function): Likewise
560 (conv_intrinsic_ieee_is_normal): Likewise
561 (conv_intrinsic_ieee_is_negative): Likewise
562 (conv_intrinsic_ieee_copy_sign): Likewise
563 (conv_intrinsic_move_alloc): Likewise
564 * trans-io.c (set_parameter_value_chk): Likewise
565 (set_parameter_value_inquire): Likewise
566 (set_string): Likewise
567 * trans-openmp.c (gfc_walk_alloc_comps): Likewise
568 (gfc_omp_clause_default_ctor): Likewise
569 (gfc_omp_clause_copy_ctor): Likewise
570 (gfc_omp_clause_assign_op): Likewise
571 (gfc_omp_clause_dtor): Likewise
572 (gfc_omp_finish_clause): Likewise
573 (gfc_trans_omp_clauses): Likewise
574 (gfc_trans_omp_do): Likewise
575 * trans-stmt.c (gfc_trans_goto): Likewise
576 (gfc_trans_sync): Likewise
577 (gfc_trans_arithmetic_if): Likewise
578 (gfc_trans_simple_do): Likewise
579 (gfc_trans_do): Likewise
580 (gfc_trans_forall_loop): Likewise
581 (gfc_trans_where_2): Likewise
582 (gfc_trans_allocate): Likewise
583 (gfc_trans_deallocate): Likewise
584 * trans-types.c (gfc_init_types): Initialize logical_type_node and
585 their true/false trees.
586 (gfc_get_array_descr_info): Use logical_type_node.
587 * trans-types.h (logical_type_node): New tree.
588 (logical_true_node): Likewise.
589 (logical_false_node): Likewise.
590 * trans.c (gfc_trans_runtime_check): Use logical_type_node.
591 (gfc_call_malloc): Likewise
592 (gfc_allocate_using_malloc): Likewise
593 (gfc_allocate_allocatable): Likewise
594 (gfc_add_comp_finalizer_call): Likewise
595 (gfc_add_finalizer_call): Likewise
596 (gfc_deallocate_with_status): Likewise
597 (gfc_deallocate_scalar_with_status): Likewise
598 (gfc_call_realloc): Likewise
600 2017-11-06 Paul Thomas <pault@gcc.gnu.org>
603 * trans-expr.c (gfc_map_intrinsic_function): Return false for
604 bounds without the DIM argument instead of ICEing.
606 2017-11-06 Martin Liska <mliska@suse.cz>
609 * options.c (gfc_post_options): Set default value of
610 -Wreturn-type to false.
612 2017-11-05 Thomas Koenig <tkoenig@gcc.gnu.org>
615 * lang.opt (ffrontend-loop-interchange): New option.
616 (Wfrontend-loop-interchange): New option.
617 * options.c (gfc_post_options): Handle ffrontend-loop-interchange.
618 * frontend-passes.c (gfc_run_passes): Run
619 optimize_namespace if flag_frontend_optimize or
620 flag_frontend_loop_interchange are set.
621 (optimize_namespace): Run functions according to flags set;
622 also call index_interchange.
623 (ind_type): New function.
624 (has_var): New function.
625 (index_cost): New function.
626 (loop_comp): New function.
628 2017-11-05 Paul Thomas <pault@gcc.gnu.org>
631 * resolve.c (resolve_ordinary_assign): Do not add the _data
632 component for class valued array constructors being assigned
633 to derived type arrays.
634 * trans-array.c (gfc_trans_array_ctor_element): Take the _data
635 of class valued elements for assignment to derived type arrays.
637 2017-11-05 Paul Thomas <pault@gcc.gnu.org>
641 * resolve.c (resolve_component): There is no need to resolve
642 the components of a use associated vtype.
643 (resolve_fl_derived): Unconditionally generate a vtable for any
644 module derived type, as long as the standard is F2003 or later
645 and it is not a vtype or a PDT template.
647 2017-11-05 Tom de Vries <tom@codesourcery.com>
650 * parse.c (match, matcha, matchs, matcho, matchds, matchdo): Remove
651 semicolon after "do {} while (0)".
653 2017-11-04 Andre Vehreschild <vehre@gcc.gnu.org>
655 * trans-expr.c (gfc_trans_assignment_1): Character kind conversion may
656 create a loop variant temporary, too.
657 * trans-intrinsic.c (conv_caf_send): Treat char arrays as arrays and
659 * trans.c (get_array_span): Take the character kind into account when
660 doing pointer arithmetic.
662 2017-11-04 Thomas Koenig <tkoenig@gcc.gnu.org>
665 * gfortran.h (gfc_check_f): Replace fm3l with fm4l.
666 * intrinsic.h (gfc_resolve_maxloc): Add gfc_expr * to argument
668 (gfc_resolve_minloc): Likewise.
669 * check.c (gfc_check_minloc_maxloc): Handle kind argument.
670 * intrinsic.c (add_sym_3_ml): Rename to
671 (add_sym_4_ml): and handle kind argument.
672 (add_function): Replace add_sym_3ml with add_sym_4ml and add
673 extra arguments for maxloc and minloc.
674 (check_specific): Change use of check.f3ml with check.f4ml.
675 * iresolve.c (gfc_resolve_maxloc): Handle kind argument. If
676 the kind is smaller than the smallest library version available,
677 use gfc_default_integer_kind and convert afterwards.
678 (gfc_resolve_minloc): Likewise.
680 2017-11-04 Paul Thomas <pault@gcc.gnu.org>
683 * trans-decl.c (gfc_trans_deferred_vars): Do a better job of a
684 case where 'tmp' was used unititialized and remove TODO.
686 2017-11-03 Steven G. Kargl <kargl@gcc.gnu.org>
689 * resolve.c (resolve_equivalence): An entity in a common block within
690 a module cannot appear in an equivalence statement if the entity is
691 with a pure procedure.
693 2017-10-31 Jim Wilson <wilson@tuliptree.org>
695 * parse.c (unexpected_eof): Call gcc_unreachable before return.
697 2017-10-30 Paul Thomas <pault@gcc.gnu.org>
700 * trans_expr.c (gfc_conv_procedure_call): When passing a class
701 argument to an unlimited polymorphic dummy, it is wrong to cast
702 the passed expression as unlimited, unless it is unlimited. The
703 correct way is to assign to each of the fields and set the _len
706 2017-10-30 Steven G. Kargl <kargl@gcc.gnu.org>
708 * resolve.c (resolve_transfer): Set derived to correct symbol for
711 2017-10-29 Jim Wilson <wilson@tuliptree.org>
713 * invoke.texi: Delete adb and sdb references.
715 2017-10-28 Andre Vehreschild <vehre@gcc.gnu.org>
717 * check.c (gfc_check_co_reduce): Clarify error message.
719 2017-10-28 Paul Thomas <pault@gcc.gnu.org>
722 * trans-expr.c (trans_class_vptr_len_assignment): 'vptr_expr'
723 must only be set if the right hand side expression is of type
726 2017-10-27 Steven G. Kargl <kargl@gcc.gnu.org>
729 * match.c (gfc_match_allocate): Exit early on syntax error.
731 2017-10-27 Thomas Koenig <tkoenig@gcc.gnu.org>
734 * simplify.c (is_constant_array_expr): If the expression is
735 a parameter array, call gfc_simplify_expr.
737 2017-10-25 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
739 * match.c (gfc_match_type_is): Fix typo in error message.
741 2017-10-21 Paul Thomas <pault@gcc.gnu.org>
744 * decl.c (gfc_get_pdt_instance): Remove the error message that
745 the parameter does not have a corresponding component since
746 this is now taken care of when the derived type is resolved. Go
747 straight to error return instead.
748 (gfc_match_formal_arglist): Make the PDT relevant errors
749 immediate so that parsing of the derived type can continue.
750 (gfc_match_derived_decl): Do not check the match status on
751 return from gfc_match_formal_arglist for the same reason.
752 * resolve.c (resolve_fl_derived0): Check that each type
753 parameter has a corresponding component.
756 * resolve.c (resolve_generic_f): Check that the derived type
757 can be used before resolving the struture constructor.
760 * symbol.c (check_conflict): Add the conflicts involving PDT
761 KIND and LEN attributes.
763 2017-10-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
765 * interface.c (check_sym_interfaces, check_uop_interfaces,
766 gfc_check_interfaces): Base interface_name buffer off
769 2017-10-19 Jakub Jelinek <jakub@redhat.com>
772 * gfortran.h (gfc_resolve_do_iterator): Add a bool arg.
773 (gfc_resolve_omp_local_vars): New declaration.
774 * openmp.c (omp_current_ctx): Make static.
775 (gfc_resolve_omp_parallel_blocks): Handle EXEC_OMP_TASKLOOP
776 and EXEC_OMP_TASKLOOP_SIMD.
777 (gfc_resolve_do_iterator): Add ADD_CLAUSE argument, if false,
778 don't actually add any clause. Move omp_current_ctx test
780 (handle_local_var, gfc_resolve_omp_local_vars): New functions.
781 * resolve.c (gfc_resolve_code): Call gfc_resolve_omp_parallel_blocks
782 instead of just gfc_resolve_omp_do_blocks for EXEC_OMP_TASKLOOP
783 and EXEC_OMP_TASKLOOP_SIMD.
784 (gfc_resolve_code): Adjust gfc_resolve_do_iterator caller.
785 (resolve_codes): Call gfc_resolve_omp_local_vars.
787 2017-10-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
789 * gfortran.h (gfc_lookup_function_fuzzy): New declaration.
790 (gfc_closest_fuzzy_match): New declaration.
791 (vec_push): New definition.
792 * misc.c (gfc_closest_fuzzy_match): New definition.
793 * resolve.c: Include spellcheck.h.
794 (lookup_function_fuzzy_find_candidates): New static function.
795 (lookup_uop_fuzzy_find_candidates): Likewise.
796 (lookup_uop_fuzzy): Likewise.
797 (resolve_operator) <INTRINSIC_USER>: Call lookup_uop_fuzzy.
798 (gfc_lookup_function_fuzzy): New definition.
799 (resolve_unknown_f): Call gfc_lookup_function_fuzzy.
800 * interface.c (check_interface0): Likewise.
801 (lookup_arg_fuzzy_find_candidates): New static function.
802 (lookup_arg_fuzzy ): Likewise.
803 (compare_actual_formal): Call lookup_arg_fuzzy.
804 * symbol.c: Include spellcheck.h.
805 (lookup_symbol_fuzzy_find_candidates): New static function.
806 (lookup_symbol_fuzzy): Likewise.
807 (gfc_set_default_type): Call lookup_symbol_fuzzy.
808 (lookup_component_fuzzy_find_candidates): New static function.
809 (lookup_component_fuzzy): Likewise.
810 (gfc_find_component): Call lookup_component_fuzzy.
812 2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
815 * frontend-passes.c (combine_array_constructor): If an array
816 constructor is all constants and has more elements than a small
817 constant, don't convert a*[b,c] to [a*b,a*c] to reduce compilation
820 2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
823 * resolve.c (resovle_symbol): Change gcc_assert to
824 sensible error message.
826 2017-10-18 Paul Thomas <pault@gcc.gnu.org>
829 * trans_decl.c (gfc_get_symbol_decl): Procedure symbols that
830 have the 'used_in_submodule' attribute should be processed by
831 'gfc_get_extern_function_decl'.
833 2017-10-16 Fritz Reese <fritzoreese@gmail.com>
836 * trans-io.c (transfer_expr): Treat BT_UNION as BT_DERIVED.
838 2017-10-15 Thomas Koenig <tkoenig@gcc.gnu.org>
841 * fortran/scanner.c (last_error_char): New global variable.
842 (gfc_scanner_init_1): Set last_error_char to NULL.
843 (gfc_gobble_whitespace): If a character not printable or
844 not newline, issue an error.
846 2017-10-13 Paul Thomas <pault@gcc.gnu.org>
849 * resolve.c (resolve_symbol): Ensure that derived type array
850 results get default initialization.
852 2017-10-11 Nathan Sidwell <nathan@acm.org>
854 * cpp.c (gfc_cpp_add_include_path): Update incpath_e names.
855 (gfc_cpp_add_include_path_after): Likewise.
857 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
859 * target-memory.c (gfc_interpret_logical): Use wi::to_wide when
860 operating on trees as wide_ints.
861 * trans-const.c (gfc_conv_tree_to_mpz): Likewise.
862 * trans-expr.c (gfc_conv_cst_int_power): Likewise.
863 * trans-intrinsic.c (trans_this_image): Likewise.
864 (gfc_conv_intrinsic_bound): Likewise.
865 (conv_intrinsic_cobound): Likewise.
867 2017-10-08 Steven G. Kargl <kargl@gcc.gnu.org>
869 * check.c (gfc_check_x): Remove function.
870 * intrinsic.c (add_functions): Use gfc_check_fn_r.
872 2017-10-08 Paul Thomas <pault@gcc.gnu.org>
875 * module.c : Bump up MOD_VERSION to 15.
876 (mio_component): Edit comment about PDT specification list.
877 (mio_expr, mio_symbol): Include the expression and symbol PDT
878 specification lists in the same way as in mio_component.
880 2017-10-08 Thomas Koenig <tkoenig@gcc.gnu.org>
882 * dump_prase_tree (show_symbol): Output list of variables in
884 (show_code_node): Add new line for ELSE and END DO for DO
886 * invoke.texi: Document that the output of
887 -fdump-fortran-original, -fdump-fortran-optimized and
888 -fdump-parse-tree is unsable and may lead to ICEs.
890 2017-10-07 Paul Thomas <pault@gcc.gnu.org>
893 * class.c (gfc_find_derived_vtab): Return NULL for a passed
894 pdt template to prevent bad procedures from being written.
895 * decl.c (gfc_get_pdt_instance): Do not use the default
896 initializer for pointer and allocatable pdt type components. If
897 the component is allocatbale, set the 'alloc_comp' attribute of
899 * module.c : Add a prototype for 'mio_actual_arglist'. Add a
900 boolean argument 'pdt'.
901 (mio_component): Call it for the parameter list of pdt type
902 components with 'pdt' set to true.
903 (mio_actual_arg): Add the boolean 'pdt' and, if it is set, call
904 mio_integer for the 'spec_type'.
905 (mio_actual_arglist): Add the boolean 'pdt' and use it in the
906 call to mio_actual_arg.
907 (mio_expr, mio_omp_udr_expr): Call mio_actual_arglist with
909 * resolve.c (get_pdt_spec_expr): Add the parameter name to the
910 KIND parameter error.
911 (get_pdt_constructor): Check that cons->expr is non-null.
912 * trans-array.c (structure_alloc_comps): For deallocation of
913 allocatable components, ensure that parameterized components
914 are deallocated first. Likewise, when parameterized components
915 are allocated, nullify allocatable components first. Do not
916 recurse into pointer or allocatable pdt components while
917 allocating or deallocating parameterized components. Test that
918 parameterized arrays or strings are allocated before freeing
920 (gfc_trans_pointer_assignment): Call the new function. Tidy up
921 a minor whitespace issue.
922 trans-decl.c (gfc_trans_deferred_vars): Set 'tmp' to NULL_TREE
923 to prevent the expression from being used a second time.
925 2017-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
928 * expr.c (gfc_check_pointer_assign): Error
929 for non-contiguous rhs.
931 2017-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
933 * gfortran.h (async_io_dt): Add external reference.
934 * io.c (async_io_dt): Add variable.
935 (compare_to_allowed_values): Add prototyte. Add optional argument
936 num. If present, set it to the number of the entry that was
938 (check_io_constraints): If this is for an asynchronous I/O
939 statement, set async_io_dt and set the asynchronous flag for
941 * resolve.c (resolve_transfer): If async_io_dt is set, set
942 the asynchronous flag on the variable.
943 (resolve_fl_namelist): If async_io_dt is set, set the asynchronous
944 flag on all elements of the namelist.
946 2017-10-04 Paul Thomas <pault@gcc.gnu.org>
950 * resolve.c (resolve_assoc_var): Deferred character type
951 associate names must not receive an integer conatant length.
952 * symbol.c (gfc_is_associate_pointer): Deferred character
953 length functions also require an associate pointer.
954 * trans-decl.c (gfc_get_symbol_decl): Deferred character
955 length functions or derived type components require the assoc
956 name to have variable string length.
957 * trans-stmt.c (trans_associate_var): Set the string length of
958 deferred string length associate names. The address expression
959 is not needed for allocatable, pointer or dummy targets. Change
960 the comment about defered string length targets.
962 2017-10-03 Thomas Koenig <tkoenig@gcc.gnu.org>
964 * io.c (match_wait_element): Correctly match END and EOR tags.
965 * dump-parse-tree.c (show_code_node): Handle EXEC_WAIT.
967 2017-10-02 Paul Thomas <pault@gcc.gnu.org>
970 * resolve.c (gfc_resolve_code): Simplify condition for class
971 pointer assignments becoming regular assignments by asserting
972 that only class valued targets are permitted.
973 * trans-expr.c (trans_class_pointer_fcn): New function using a
974 block of code from gfc_trans_pointer_assignment.
975 (gfc_trans_pointer_assignment): Call the new function. Tidy up
976 a minor whitespace issue.
978 2017-10-01 Dominique d'Humieres <dominiq@lps.ens.fr>
981 * parse.c (gfc_global_used): Replace the gfc_internal_error
984 2017-09-29 Dominique d'Humieres <dominiq@lps.ens.fr>
987 * interface.c (compare_actual_formal): Change warnings to errors
988 when "Actual argument contains too few elements for dummy
989 argument", unless -std=legacy is used.
991 2017-09-27 Thomas Schwinge <thomas@codesourcery.com>
993 * lang.opt <Wdo-subscript>: End help text with a period.
995 2017-09-26 Thomas Koenig <tkoenig@gcc.gnu.org>
997 * frontend-passes.c (do_subscript): Don't do anything
998 if inside an associate list.
1000 2017-09-25 Thomas Koenig <tkoenig@gcc.gnu.org>
1002 * lang.opt: Add -Wdo-subscript.
1003 * frontend-passes.c (do_t): New type.
1004 (doloop_list): Use variable of do_type.
1005 (if_level): Variable to track if levels.
1006 (select_level): Variable to track select levels.
1007 (gfc_run_passes): Initialize i_level and select_level.
1008 (doloop_code): Record current level of if + select
1009 level in doloop_list. Add seen_goto if there could
1010 be a branch outside the loop. Use different type for
1012 (doloop_function): Call do_intent and do_subscript; move
1013 functionality of checking INTENT to do_intent.
1014 (insert_index_t): New type, for callback_insert_index.
1015 (callback_insert_index): New function.
1016 (insert_index): New function.
1017 (do_subscript): New function.
1018 (do_intent): New function.
1019 (gfc_code_walker): Keep track of if_level and select_level.
1020 * invoke.texi: Document -Wdo-subscript.
1022 2017-09-25 Janne Blomqvist <jb@gcc.gnu.org>
1024 * trans.c (gfc_unlikely): Remove unnecessary fold_convert.
1025 (gfc_likely): Likewise.
1027 2017-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1028 Steven G. Kargl <kargl@gcc.gnu.org>
1031 * expr.c (gfc_get_full_arrayspec_from_expr): If there is
1032 no symtree, set array spec to NULL.
1034 2017-09-23 Janus Weil <janus@gcc.gnu.org>
1037 * lang.opt: Add the options -fdefault-real-10 and -fdefault-real-16.
1038 Rename flag_default_real to flag_default_real_8.
1039 * invoke.texi: Add documentation.
1040 * module.c (use_iso_fortran_env_module): flag_default_real is renamed.
1041 * trans-types.c (gfc_init_kinds): Implement the flags
1042 -fdefault-real-10 and -fdefault-real-16. Make -fdefault-double-8 work
1043 without -fdefault-real-8.
1045 2017-09-21 Paul Thomas <pault@gcc.gnu.org>
1048 * match.c (gfc_match_associate): Before failing the association
1049 try again, allowing a proc pointer selector.
1054 * primary.c (gfc_match_varspec): Introduce 'tgt_expr', which
1055 points to the associate selector, if any. Go through selector
1056 references, after resolution for variables, to catch any full
1057 or section array references. If a class associate name does
1058 not have the same declared type as the selector, resolve the
1059 selector and copy the declared type to the associate name.
1060 Before throwing a no implicit type error, resolve all allowed
1061 selector expressions, and copy the resulting typespec.
1064 * resolve.c (resolve_assoc_var): Selector must cannot be the
1065 NULL expression and it must have a type.
1068 * resolve.c (resolve_symbol): Allow associate names to be
1071 2017-09-21 Cesar Philippidis <cesar@codesourcery.com>
1073 * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive
1074 arguments to constant integers.
1076 2017-09-17 Paul Thomas <pault@gcc.gnu.org>
1079 * decl.c (gfc_get_pdt_instance): Use the component initializer
1080 expression for the default, rather than the parameter value.
1081 * resolve.c (resolve_pdt): New function.
1082 (resolve_symbol): Call it. Remove false error, prohibiting
1083 deferred type parameters for dummy arguments.
1086 * primary.c (gfc_match_varspec): If the type of an associate
1087 name is unknown and yet there is a match, try resolving the
1088 target expression and using its type.
1090 2017-09-15 Paul Thomas <pault@gcc.gnu.org>
1093 trans-decl.c (gfc_trans_deferred_vars): Do not null the 'span'
1094 field if the symbol is either implicitly or explicitly saved.
1096 2017-09-13 Paul Thomas <pault@gcc.gnu.org>
1099 * decl.c (match_char_kind): If the kind expression is
1100 parameterized, save it in saved_kind_expr and set kind = 0.
1101 (gfc_get_pdt_instance): Resolve and simplify before emitting
1102 error on expression kind. Insert a missing simplification after
1103 insertion of kind expressions.
1105 2017-09-12 Paul Thomas <pault@gcc.gnu.org>
1109 * decl.c (variable_decl): Check pdt template components for
1110 appearance of KIND/LEN components in the type parameter name
1111 list, that components corresponding to type parameters have
1112 either KIND or LEN attributes and that KIND or LEN components
1113 are scalar. Copy the initializer to the parameter value.
1114 (gfc_get_pdt_instance): Add a label 'error_return' and follow
1115 it with repeated code, while replacing this code with a jump.
1116 Check if a parameter appears as a component in the template.
1117 Make sure that the parameter expressions are integer. Validate
1119 (gfc_match_decl_type_spec): Search for pdt_types in the parent
1120 namespace since they are instantiated in the template ns.
1121 * expr.c (gfc_extract_int): Use a KIND parameter if it
1122 appears as a component expression.
1123 (gfc_check_init_expr): Allow expressions with the pdt_kind
1125 *primary.c (gfc_match_actual_arglist): Make sure that the first
1126 keyword argument is recognised when 'pdt' is set.
1128 2017-09-10 Paul Thomas <pault@gcc.gnu.org>
1136 * expr.c (is_subref_array): Add class pointer array dummies
1137 to the list of expressions that return true.
1138 * trans-array.c: Add SPAN_FIELD and update indices for
1140 (gfc_conv_descriptor_span, gfc_conv_descriptor_span_get,
1141 gfc_conv_descriptor_span_set, is_pointer_array,
1142 get_array_span): New functions.
1143 (gfc_get_descriptor_offsets_for_info): New function to preserve
1144 API for access to descriptor fields for trans-types.c.
1145 (gfc_conv_scalarized_array_ref): If the expression is a subref
1146 array, make sure that info->descriptor is a descriptor type.
1147 Otherwise, if info->descriptor is a pointer array, set 'decl'
1148 and fix it if it is a component reference.
1149 (build_array_ref): Simplify handling of class array refs by
1150 passing the vptr to gfc_build_array_ref rather than generating
1151 the pointer arithmetic in this function.
1152 (gfc_conv_array_ref): As in gfc_conv_scalarized_array_ref, set
1154 (gfc_array_allocate): Set the span field if this is a pointer
1155 array. Use the expr3 element size if it is available, so that
1156 the dynamic type element size is used.
1157 (gfc_conv_expr_descriptor): Set the span field for pointer
1159 * trans-array.h: Prototypes for gfc_conv_descriptor_span_get
1160 gfc_conv_descriptor_span_set and
1161 gfc_get_descriptor_offsets_for_info added.
1162 trans-decl.c (gfc_get_symbol_decl): If a non-class pointer
1163 array, mark the declaration as a GFC_DECL_PTR_ARRAY_P. Remove
1164 the setting of GFC_DECL_SPAN.
1165 (gfc_trans_deferred_vars): Set the span field to zero in thge
1167 * trans-expr.c (gfc_conv_procedure_call): Do not use copy-in/
1168 copy-out to pass subref expressions to a pointer dummy.
1169 (gfc_trans_pointer_assignment): Remove code for setting of
1170 GFC_DECL_SPAN. Set the 'span' field for non-class pointers to
1171 class function results. Likewise for rank remap. In the case
1172 that the target is not a whole array, use the target array ref
1173 for remap and, since the 'start' indices are missing, set the
1174 lbounds to one, as required by the standard.
1175 * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Pick up the
1176 'token' offset from the field decl in the descriptor.
1177 (conv_isocbinding_subroutine): Set the 'span' field.
1178 * trans-io.c (gfc_trans_transfer): Always scalarize pointer
1180 * trans-stmt.c (trans_associate_var): Set the 'span' field.
1181 * trans-types.c (gfc_get_array_descriptor_base): Add the 'span'
1182 field to the array descriptor.
1183 (gfc_get_derived_type): Pointer array components are marked as
1184 GFC_DECL_PTR_ARRAY_P.
1185 (gfc_get_array_descr_info): Replaced API breaking code for
1186 descriptor offset calling gfc_get_descriptor_offsets_for_info.
1187 * trans.c (get_array_span): New function.
1188 (gfc_build_array_ref): Simplify by calling get_array_span and
1189 obtain 'span' if 'decl' or 'vptr' present.
1190 * trans.h : Rename DECL_LANG_FLAG_6, GFC_DECL_SUBREF_ARRAY_P,
1191 as GFC_DECL_PTR_ARRAY_P.
1193 2017-09-09 Paul Thomas <pault@gcc.gnu.org>
1195 * decl.c : Add decl_type_param_list, type_param_spec_list as
1196 static variables to hold PDT spec lists.
1197 (build_sym): Copy 'type_param_spec_list' to symbol spec_list.
1198 (build_struct): Copy the 'saved_kind_expr' to the component
1199 'kind_expr'. Check that KIND or LEN components appear in the
1200 decl_type_param_list. These should appear as symbols in the
1201 f2k_derived namespace. If the component is itself a PDT type,
1202 copy the decl_type_param_list to the component param_list.
1203 (gfc_match_kind_spec): If the KIND expression is parameterized
1204 set KIND to zero and store the expression in 'saved_kind_expr'.
1205 (insert_parameter_exprs): New function.
1206 (gfc_insert_kind_parameter_exprs): New function.
1207 (gfc_insert_parameter_exprs): New function.
1208 (gfc_get_pdt_instance): New function.
1209 (gfc_match_decl_type_spec): Match the decl_type_spec_list if it
1210 is present. If it is, call 'gfc_get_pdt_instance' to obtain the
1211 specific instance of the PDT.
1212 (match_attr_spec): Match KIND and LEN attributes. Check for the
1213 standard and for type/kind of the parameter. They are also not
1214 allowed outside a derived type definition.
1215 (gfc_match_data_decl): Null the decl_type_param_list and the
1216 type_param_spec_list on entry and free them on exit.
1217 (gfc_match_formal_arglist): If 'typeparam' is true, add the
1218 formal symbol to the f2k_derived namespace.
1219 (gfc_match_derived_decl): Register the decl_type_param_list
1220 if this is a PDT. If this is a type extension, gather up all
1221 the type parameters and put them in the right order.
1222 *dump-parse-tree.c (show_attr): Signal PDT templates and the
1223 parameter attributes.
1224 (show_components): Output parameter atrributes and component
1226 (show_symbol): Show variable parameter lists.
1227 * expr.c (expr.c): Copy the expression parameter list.
1228 (gfc_is_constant_expr): Pass on symbols representing PDT
1230 (gfc_check_init_expr): Break on PDT KIND parameters and
1231 PDT parameter expressions.
1232 (gfc_check_assign): Assigning to KIND or LEN components is an
1234 (derived_parameter_expr): New function.
1235 (gfc_derived_parameter_expr): New function.
1236 (gfc_spec_list_type): New function.
1237 * gfortran.h : Add enum gfc_param_spec_type. Add the PDT attrs
1238 to the structure symbol_attr. Add the 'kind_expr' and
1239 'param_list' field to the gfc_component structure. Comment on
1240 the reuse of the gfc_actual_arglist structure as storage for
1241 type parameter spec lists. Add the new field 'spec_type' to
1242 this structure. Add 'param_list' fields to gfc_symbol and
1243 gfc_expr. Add prototypes for gfc_insert_kind_parameter_exprs,
1244 gfc_insert_parameter_exprs, gfc_add_kind, gfc_add_len,
1245 gfc_derived_parameter_expr and gfc_spec_list_type.
1246 * interface.c (gfc_compare_derived_types): Treat PDTs in the
1247 same way as sequence types.
1248 * match.c : Add variable 'type_param_spec_list'.
1249 (gfc_op2string, gfc_match_member_sep, gfc_match_label): Remove
1250 trailing whitespace.
1251 (match_derived_type_spec): Match PDTs and find specific
1253 (gfc_match_type_spec): Remove more trailing whitespace.
1254 (gfc_match_allocate): Assumed or deferred parameters cannot
1255 appear here. Copy the type parameter spec list to the expr for
1256 the allocatable entity. Free 'type_param_spec_list'.
1257 (gfc_match_common, gfc_match_namelist, gfc_match_module): Still
1258 more trailing whitespace to remove.
1259 (gfc_match_type_is): Allow PDT typespecs.
1260 * match.h : Modify prototypes for gfc_match_formal_arglist and
1261 gfc_match_actual_arglist.
1262 * module.c (ab_attribute, mstring attr_bits): PDT attributes
1264 (mio_symbol_attribute): PDT attributes handled.
1265 (mio_component): Deal with 'kind_expr' field.
1266 (mio_full_f2k_derived): For PDT templates, transfer the formal
1267 namespace symroot to the f2k_derived namespace.
1268 *primary.c (match_keyword_arg, gfc_match_actual_arglist): Add
1269 modifications to handle PDT spec lists. These are flagged in
1270 both cases by new boolean arguments, whose prototype defaults
1272 (gfc_match_structure_constructor, match_variable): Remove yet
1273 more trailing whitespace.
1274 * resolve.c (get_pdt_spec_expr, get_pdt_constructor): New
1276 (resolve_structure_cons): If the constructor is a PDT template,
1277 call get_pdt_constructor to build it using the parameter lists
1278 and then get the specific instance of the PDT.
1279 (resolve_component): PDT strings need a hidden string length
1280 component like deferred characters.
1281 (resolve_symbol): Dummy PDTs cannot have deferred parameters.
1282 * symbol.c (gfc_add_kind, gfc_add_len): New functions.
1283 (free_components): Free 'kind_expr' and 'param_list' fields.
1284 (gfc_free_symbol): Free the 'param_list' field.
1285 (gfc_find_sym_tree): If the current state is a PDT template,
1286 look for the symtree in the f2k_derived namspaces.
1287 trans-array.c (structure_alloc_comps): Allocate and deallocate
1288 PDTs. Check dummy arguments for compliance of LEN parameters.
1289 Add the new functions to the preceeding enum.
1290 (gfc_allocate_pdt_comp, gfc_deallocate_pdt_comp and
1291 gfc_check_pdt_dummy): New functions calling above.
1292 * trans-array.h : Add prototypes for these functions.
1293 trans-decl.c (gfc_get_symbol_decl): Call gfc_defer_symbol_init
1294 as appropriate for PDT symbols.
1295 (gfc_trans_deferred_vars): Allocate/deallocate PDT entities as
1296 they come into and out of scope. Exclude pdt_types from being
1298 (gfc_trans_subcomponent_assign): PDT array components must be
1299 handles as if they are allocatable.
1300 * trans-stmt.c (gfc_trans_allocate): Handle initialization of
1302 (gfc_trans_deallocate): Likewise.
1303 * trans-types.c (gfc_get_derived_type): PDT templates must not
1304 arrive here. PDT string components are handles as if deferred.
1305 Similarly, PDT arrays are treated as if allocatable. PDT
1306 strings are pointer types.
1307 * trans.c (gfc_deferred_strlen): Handle PDT strings in the same
1308 way as deferred characters.
1310 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1313 * parse.c (decode_omp_directive): Use matchs instead of matcho for
1314 end ordered and ordered directives, except for ordered depend. For
1315 -fopenmp-simd and ordered depend, reject the stmt.
1316 * trans-openmp.c (gfc_trans_omp_ordered): For -fopenmp-simd ignore
1317 threads clause and if simd clause isn't present, just translate the
1320 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1321 Alan Hayward <alan.hayward@arm.com>
1322 David Sherwood <david.sherwood@arm.com>
1324 * trans-types.c (gfc_init_kinds): Use opt_scalar_int_mode for
1327 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1328 Alan Hayward <alan.hayward@arm.com>
1329 David Sherwood <david.sherwood@arm.com>
1331 * target-memory.c (size_integer): Use SCALAR_INT_TYPE_MODE.
1332 (size_logical): Likewise.
1334 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1335 Alan Hayward <alan.hayward@arm.com>
1336 David Sherwood <david.sherwood@arm.com>
1338 * trans-types.c (gfc_type_for_mode): Use is_a <scalar_int_mode>.
1340 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1341 Alan Hayward <alan.hayward@arm.com>
1342 David Sherwood <david.sherwood@arm.com>
1344 * trans-types.c (gfc_init_kinds): Use opt_scalar_float_mode
1345 and FOR_EACH_MODE_IN_CLASS.
1347 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1348 Alan Hayward <alan.hayward@arm.com>
1349 David Sherwood <david.sherwood@arm.com>
1351 * target-memory.c (size_float): Use SCALAR_FLOAT_TYPE_MODE
1352 instead of TYPE_MODE.
1354 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1355 Alan Hayward <alan.hayward@arm.com>
1356 David Sherwood <david.sherwood@arm.com>
1358 * trans-types.c (gfc_init_kinds): Use machine_mode instead of int
1361 2017-08-28 Janus Weil <janus@gcc.gnu.org>
1364 * expr.c (gfc_check_pointer_assign): Improve the check whether pointer
1365 may outlive pointer target.
1367 2017-08-27 Thomas Koenig <tkoenig@gcc.gnu.org>
1370 * frontend-passes (inline_matumul_assign): Explicity
1371 set typespec for call to CONJG.
1373 2017-08-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1376 * trans-io.c (get_dtio_proc): Add check for format label and set
1377 formatted flag accordingly. Reorganize the code a little.
1379 2017-08-16 Thomas Koenig <tkoenig@gcc.gnu.org>
1382 * frontend-passes.c (realloc_string_callback): If expression is a
1383 concatenation, also check for dependency.
1384 (constant_string_length): Check for presence of symtree.
1386 2017-08-13 Thomas Koenig <tkoenig@gcc.gnu.org>
1388 * gfortran.texi: Document format of unformatted sequential files.
1390 2017-08-11 Thomas Koenig <tkoenig@gcc.gnu.org>
1392 * invoke.texi: Actually commit change about -Ofast.
1394 2017-08-11 Thomas Koenig <tkoenig@gcc.gnu.org>
1397 * resolve.c (resolve_symbol): Adjust (and reformat)
1398 comment. Perform check if a BIND(C) is declared
1399 at module level regardless of whether it is typed
1402 2017-08-10 Fritz Reese <fritzoreese@gmail.com>
1404 * options.c (set_dec_flags): Only set legacy standards when value
1407 2017-08-10 Fritz Reese <fritzoreese@gmail.com>
1409 * options.c (set_dec_flags, gfc_post_options): Only set flag_d_lines
1410 with -fdec when not set by user.
1412 2017-08-10 Fritz Reese <fritzoreese@gmail.com>
1414 * decl.c (attr_seen): New static variable.
1415 * decl.c (variable_decl): Match %FILL in STRUCTURE body.
1416 * gfortran.texi: Update documentation.
1418 2017-08-08 Martin Liska <mliska@suse.cz>
1420 * trans-types.c: Include header files.
1422 2017-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
1426 * options.c: Make -Ofast honor -fmax-stack-var-size.
1427 * invoke.texi: Document change.
1429 2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
1432 * intrisic.c (gfc_convert_type_warn): Only set typespec for
1433 empty array constructors which don't have it already.
1435 2017-08-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1438 * lang.opt (fc-prototypes): Add option.
1439 * gfortran.h (gfc_typespec): Add interop_kind to struct.
1440 (gfc_dump_c_prototypes): Add prototype.
1441 * decl.c (gfc_match_kind_spec): Copy symbol used for kind to typespec.
1442 * parse.c (gfc_parse_file): Call gfc_dump_prototypes.
1443 * dump-parse-tree.c (gfc_dump_c_prototypes): New function.
1444 (type_return): New enum.
1445 (get_c_type_name): New function.
1446 (write_decl): New function.
1447 (write_type): New function.
1448 (write_variable): New function.
1449 (write_proc): New function.
1450 (write_interop_decl): New function.
1451 * invoke.texi: Document -fc-prototypes.
1453 2017-08-01 Dominique d'Humieres <dominiq@lps.ens.fr>
1456 * expr.c (gfc_check_init_expr): Use the renamed name.
1458 2017-07-31 Jakub Jelinek <jakub@redhat.com>
1460 * check.c (gfc_check_num_images): Fix a pasto.
1462 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1464 * trans-decl.c (gfc_trans_use_stmts): Pass false as new argument to
1465 the imported_module_or_decl debug hook.
1467 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1469 * resolve.c (find_reachable_labels): Adjust.
1471 2017-07-25 Jakub Jelinek <jakub@redhat.com>
1473 * ioparm.def: Use 1U << 31 instead of 1 << 31 as flags2 mask.
1475 2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1477 * dump-parse-tree.c (show_symbol): Show binding label if present.
1479 2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1480 Mikael Morin <mikael@gcc.gnu.org>
1483 * fortran/trans-array.c (gfc_conv_resolve_dependencies):
1484 Break if dependency has been found.
1486 2017-07-23 Alexander Monakov <amonakov@ispras.ru>
1488 * interface.c (pair_cmp): Fix gfc_symbol comparison. Adjust comment.
1490 2017-07-18 Nathan Sidwell <nathan@acm.org>
1492 * trans.c (gfc_build_array_ref): Use TYPE_MAX_VALUE.
1494 2017-07-09 Dominique d'Humieres <dominiq@lps.ens.fr>
1497 * class.c (class_array_ref_detected): Remove a redundant
1500 2017-07-06 Harald Anlauf <anlauf@gmx.de>
1503 * array.c (gfc_ref_dimen_size): Handle bad subscript triplets.
1505 2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr>
1508 * resolve.c (resolve_symbol): Fix typo.
1510 2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr>
1513 * symbol.c (check_conflict): Add missing "conflicts".
1515 2017-06-29 Cesar Philippidis <cesar@codesourcery.com>
1518 * openmp.c (gfc_match_oacc_routine): Check if proc_name exist before
1519 comparing the routine name against it.
1521 2017-06-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1524 * trans-stmt.c (gfc_trans_call): If no code expr, use code->loc
1525 as warning/error locus.
1527 2017-06-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1530 * arith.c (wprecision_int_real): Set return value before
1531 mpz_clear and then return after it.
1533 2017-06-15 Janus Weil <janus@gcc.gnu.org>
1536 * trans-expr.c (gfc_conv_procedure_call): Deallocate the result of
1537 scalar allocatable procedure-pointer components.
1539 2017-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
1542 * frontend-passes.c (traverse_io_block): Also
1543 check for variables occurring as indices multiple
1544 time in a single implied DO loop.
1546 2017-06-05 Janus Weil <janus@gcc.gnu.org>
1549 * trans-expr.c (gfc_conv_procedure_call): Fix detection of allocatable
1552 2017-06-05 Nicolas Koenig <koenigni@student.ethz.ch>
1555 * frontend-passes.c (traverse_io_block): New function.
1556 (simplify_io_impl_do): New function.
1557 (optimize_namespace): Invoke gfc_code_walker with
1558 simplify_io_impl_do.
1560 2017-06-02 Jakub Jelinek <jakub@redhat.com>
1563 * openmp.c (resolve_omp_clauses): Fix a typo.
1565 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1567 * error.c (gfc_format_decoder): Update for new bool and
1568 const char ** params.
1570 2017-05-29 Thomas Koenig <tkoenig@gcc.gnu.org>
1573 * frontend-passes.c (check_conjg_transpose_variable):
1575 (has_dimen_vector_ref): Likewise
1576 (matmul_temp_args): New function. Add prototype.
1577 (optimize_namespace): Call matmul_temp_args.
1579 2017-05-28 Thomas Koenig <tkoenig@gcc.gnu.org>
1581 * frontend-passes.c (matmul_lhs_realloc): Correct
1582 allocation size for case A1B2.
1584 2017-05-25 Thomas Koenig <tkoenig@gcc.gnu.org>
1586 * dump-parse-tree.c (show_expr): Also replace
1587 with dumpfile for showing values for forgotten
1590 2017-05-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1592 * dump-parse-tree.c (show_expr): Replace stdout
1593 with dumpfile for showing values.
1595 2017-05-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1598 * frontend-passes.c (matrix_case): Add A2TB2.
1599 (inline_limit_check): Handle MATMUL(TRANSPOSE(A),B)
1600 (inline_matmul_assign): Likewise.
1602 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
1604 * openmp.c (OACC_KERNELS_CLAUSES): Add "OMP_CLAUSE_NUM_GANGS",
1605 "OMP_CLAUSE_NUM_WORKERS", "OMP_CLAUSE_VECTOR_LENGTH".
1607 2017-05-22 Janus Weil <janus@gcc.gnu.org>
1610 * resolve.c (resolve_fl_derived): Make sure that vtype symbols are
1613 2017-05-19 Paul Thomas <pault@gcc.gnu.org>
1616 * trans-io.c (nml_get_addr_expr): If we are dealing with class
1617 type data set tmp tree to get that address.
1618 (transfer_namelist_element): Set the array spec to point to the
1621 2017-05-19 David Malcolm <dmalcolm@redhat.com>
1624 * bbt.c (insert): Remove trailing exclamation mark from message.
1625 * decl.c (gfc_match_final_decl): Likewise.
1626 * dump-parse-tree.c (show_expr): Likewise.
1627 * module.c (gfc_use_module): Likewise.
1628 * primary.c (build_actual_constructor): Likewise.
1629 (gfc_convert_to_structure_constructor): Likewise.
1631 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1633 * gfortran.h (enum gfc_omp_default_sharing): Add
1634 "OMP_DEFAULT_PRESENT".
1635 * dump-parse-tree.c (show_omp_clauses): Handle it.
1636 * openmp.c (gfc_match_omp_clauses): Likewise.
1637 * trans-openmp.c (gfc_trans_omp_clauses): Likewise.
1639 2017-05-18 Fritz Reese <fritzoreese@gmail.com>
1642 * decl.c (match_attr_spec, gfc_match_automatic,
1643 gfc_match_static, gfc_match_structure_decl): Unify diagnostic
1644 errors regarding -fdec options.
1645 * io.c (match_dec_etag, match_dec_vtag, match_dec_ftag): Ditto.
1647 2017-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1650 * trans-io.c (transfer_namelist_element): Change check from
1651 NULL_TREE to null_pointer_node.
1653 2017-05-17 Fritz Reese <fritzoreese@gmail.com>
1656 * expr.c (component_initializer): Don't generate initializers for
1658 * invoke.texi (-finit-derived): Document.
1660 2017-05-16 Paul Thomas <pault@gcc.gnu.org>
1663 * decl.c (build_sym): In a submodule allow overriding of host
1664 associated symbols from the ancestor module with a new
1667 2017-05-15 Steven G. Kargl <kargl@gcc.gnu.org>
1670 * trans-stmt.c (gfc_trans_integer_select): Remove redundant condition.
1672 2017-05-15 Steven G. Kargl <kargl@gcc.gnu.org>
1675 * expr.c (gfc_generate_initializer): If type conversion fails,
1676 check for error and return NULL.
1678 2017-05-14 Nicolas Koenig <koenigni@student.ethz.ch>
1681 * array.c (gfc_ref_dimen_size): Simplify stride
1683 * data.c (gfc_advance_section): Simplify start,
1684 end and stride expressions
1685 (gfc_advance_section): Simplify start and end
1687 (gfc_get_section_index): Simplify start expression
1689 2017-05-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1691 * io.c (gfc_resolve_dt): Fix returns to bool type.
1693 2017-05-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1696 * io.c (dtio_procs_present): Add new function to check for DTIO
1697 procedures relative to I/O statement READ or WRITE.
1698 (gfc_resolve_dt): Add namelist checks using the new function.
1699 * resolve.c (dtio_procs_present): Remove function and related
1700 namelist checks. (resolve_fl_namelist): Add check specific to
1701 Fortran 95 restriction on namelist objects.
1703 2017-05-11 Nathan Sidwell <nathan@acm.org>
1705 * trans-decl.c: Include dumpfile.h not tree-dump.h,
1707 2017-05-09 Janus Weil <janus@gcc.gnu.org>
1710 * resolve.c (gfc_resolve_finalizers): Ensure that derived-type
1711 components have a their finalizers resolved, also if the superordinate
1712 type itself has a finalizer.
1714 2017-05-08 Thomas Koenig <tkoenig@gcc.gnu.org>
1717 * frontend-passes.c (matmul_to_var_expr): New function,
1719 (matmul_to_var_code): Likewise.
1720 (optimize_namespace): Use them from gfc_code_walker.
1722 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1724 * cpp.c (cb_cpp_error): Replace report_diagnostic
1725 with diagnostic_report_diagnostic.
1726 * error.c (gfc_warning): Likewise.
1727 (gfc_warning_now_at): Likewise.
1728 (gfc_warning_now): Likewise.
1729 (gfc_warning_internal): Likewise.
1730 (gfc_error_now): Likewise.
1731 (gfc_fatal_error): Likewise.
1732 (gfc_error_opt): Likewise.
1733 (gfc_internal_error): Likewise.
1735 2017-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1738 * frontend-passes.c (inline_matmul_assign): Also check bounds
1739 for allocatable lhs and matrix-vector-multiplication.
1741 2017-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1744 * io.c (format_lex): Check for '/' and set token to FMT_SLASH.
1745 (check_format): Move FMT_DT checking code to data_desc section.
1746 * module.c (gfc_match_use): Include the case of INTERFACE_DTIO.
1748 2017-04-22 Janus Weil <janus@gcc.gnu.org>
1751 * trans-types.c (gfc_conv_procedure_call): Deallocate the components
1752 of allocatable intent(out) arguments.
1754 2017-04-21 Janus Weil <janus@gcc.gnu.org>
1757 * trans-types.c (gfc_get_derived_type): Prevent an infinite loop when
1758 building a derived type that includes a procedure pointer component
1759 with a polymorphic result.
1761 2017-04-17 Paul Thomas <pault@gcc.gnu.org>
1764 * module.c (find_symtree_for_symbol): Delete.
1765 (read_module): Remove the call to the above.
1767 2017-04-14 Janus Weil <janus@gcc.gnu.org>
1770 * class.c (generate_finalization_wrapper): Give the finalization wrapper
1771 the recursive attribute.
1773 2017-04-10 Nicolas Koenig <koenigni@student.ethz.ch>
1774 Paul Thomas <pault@gcc.gnu.org>
1777 * module.c (gfc_match_submodule): Add error
1778 if function is called in the wrong state.
1780 2017-04-10 Janus Weil <janus@gcc.gnu.org>
1783 * expr.c (gfc_check_pointer_assign): Check if procedure pointer
1784 components in a pointer assignment need an explicit interface.
1786 2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
1789 * symbol.c (gfc_delete_symtree): If there is a period in the name, ignore
1790 everything before it.
1792 2017-03-28 Janus Weil <janus@gcc.gnu.org>
1795 * trans-io.c (transfer_namelist_element): Perform a polymorphic call
1796 to a DTIO procedure if necessary.
1798 2017-03-25 Paul Thomas <pault@gcc.gnu.org>
1802 * decl.c (access_attr_decl): Remove the error for an absent
1803 generic DTIO interface and ensure that symbol has the flavor
1806 2017-03-22 Dominique d'Humieres <dominiq@lps.ens.fr>
1809 * module.c: Remove trailing period.
1811 2017-03-22 Dominique d'Humieres <dominiq@lps.ens.fr>
1814 * decl.c: Replace '%s' with %qs.
1816 * interface.c: Likewise.
1817 * match.c: Likewise.
1818 * primary.c: Likewise.
1819 * resolve.c: Likewise.
1823 * io.c: Remove trailing spaces.
1824 * match.c: Likewise.
1825 * openmp.c: Likewise.
1826 * resolve.c: Likewise.
1827 * trans-intrinsic.c: Likewise.
1830 * expr.c: Remove a double spaces.
1833 * primary.c: Remove spurious quotes around %qs.
1835 2017-03-22 Thomas Koenig <tkoenig@gcc.gnu.org>
1838 * frontend-passes.c (combine_array_constructor): Take
1839 location of new expression from constructor expression instead
1842 2017-03-20 Nicolas Koenig <koenigni@student.ethz.ch>
1845 * symbol.c (check_conflict): Report an error if an EQUIVALENCE
1848 2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
1851 * decl.c (add_hidden_procptr_result): Fixed Refs count of the
1852 created "ppr@" symbol.
1854 2017-03-18 Paul Thomas <pault@gcc.gnu.org>
1857 * module.c (mio_symbol_attribute): Remove reset of the flag
1858 'no_module_procedures'.
1859 (check_for_module_procedures): New function. Move declaration
1860 of 'no_module_procedures' to above it.
1861 (gfc_dump_module): Traverse namespace calling new function.
1863 2017-03-18 Paul Thomas <pault@gcc.gnu.org>
1866 * symbol.c (check_conflict): A dummy procedure in a submodule,
1867 module procedure is not an error.
1868 (gfc_add_flavor): Ditto.
1870 2017-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1873 * openmp.c (check_symbol_not_pointer): Adjust diagnostics.
1875 2017-03-16 Jakub Jelinek <jakub@redhat.com>
1878 * parse.c (gfc_ascii_statement): Use !$ACC for ST_OACC_ATOMIC
1879 and ST_OACC_END_ATOMIC, instead of !ACC.
1880 * trans-decl.c (finish_oacc_declare): Use !$ACC instead of $!ACC.
1881 * openmp.c (gfc_match_oacc_declare, gfc_match_oacc_wait,
1882 gfc_resolve_oacc_declare): Likewise.
1885 * error.c (gfc_format_decoder): Rename plus argument to set_locus,
1886 remove ATTRIBUTE_UNUSED from all arguments, call default_tree_printer
1887 if not a Fortran specific spec.
1888 * trans-io.c: Include options.h.
1889 (gfc_build_st_parameter): Temporarily disable -Wpadded around layout
1890 of artificial IO data structures.
1892 2017-03-15 David Malcolm <dmalcolm@redhat.com>
1895 * resolve.c (resolve_contained_fntype): Make error messages more
1896 amenable to translation.
1898 2017-03-06 Richard Biener <rguenther@suse.de>
1901 * trans.c (gfc_add_modify_loc): Weaken assert.
1903 2017-03-05 Andre Vehreschild <vehre@gcc.gnu.org>,
1904 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
1906 * check.c (positive_check): Add new function checking constant for
1907 being greater then zero.
1908 (gfc_check_image_status): Add checking of image_status arguments.
1909 (gfc_check_failed_or_stopped_images): Same but for failed_- and
1910 stopped_images function.
1911 * dump-parse-tree.c (show_code_node): Added output of FAIL IMAGE.
1912 * gfortran.h (enum gfc_statement): Added FAIL_IMAGE_ST.
1913 (enum gfc_isym_id): Added new intrinsic symbols.
1914 (enum gfc_exec_op): Added EXEC_FAIL_IMAGE.
1915 * gfortran.texi: Added description for the new API functions. Updated
1916 coverage of gfortran of TS18508.
1917 * intrinsic.c (add_functions): Added symbols to resolve new intrinsic
1919 * intrinsic.h: Added prototypes.
1920 * iresolve.c (gfc_resolve_failed_images): Resolve the failed_images
1922 (gfc_resolve_image_status): Same for image_status.
1923 (gfc_resolve_stopped_images): Same for stopped_images.
1924 * libgfortran.h: Added prototypes.
1925 * match.c (gfc_match_if): Added matching of FAIL IMAGE statement.
1926 (gfc_match_fail_image): Match a FAIL IMAGE statement.
1927 * match.h: Added prototype.
1928 * parse.c (decode_statement): Added matching for FAIL IMAGE.
1929 (next_statement): Same.
1930 (gfc_ascii_statement): Same.
1932 * simplify.c (gfc_simplify_failed_or_stopped_images): For COARRAY=
1933 single a constant result can be returne.d
1934 (gfc_simplify_image_status): For COARRAY=single the result is constant.
1935 * st.c (gfc_free_statement): Added FAIL_IMAGE handling.
1936 * trans-decl.c (gfc_build_builtin_function_decls): Added decls of the
1938 * trans-expr.c (gfc_conv_procedure_call): This is first time all
1939 arguments of a function are optional, which is now handled here
1941 * trans-intrinsic.c (conv_intrinsic_image_status): Translate
1943 (gfc_conv_intrinsic_function): Add support for image_status.
1944 (gfc_is_intrinsic_libcall): Add support for the remaining new
1946 * trans-stmt.c (gfc_trans_fail_image): Trans a fail image.
1947 * trans-stmt.h: Add the prototype for the above.
1948 * trans.c (trans_code): Dispatch for fail_image.
1949 * trans.h: Add the trees for the new intrinsics.
1951 2017-03-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1954 * openmp.c (check_symbol_not_pointer): Adjust diagnostic.
1956 2017-02-28 Paul Thomas <pault@gcc.gnu.org>
1959 * resolve.c (resolve_fl_procedure): Deal with the case where
1960 'submodule_name' is NULL so that gfc_error does not ICE.
1961 Reformat the error message to make it more consistent.
1963 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1965 * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...")
1966 instead of just cond ? "..." : "...".
1967 * scanner.c (gfc_next_char_literal): Likewise.
1968 * match.c (match_exit_cycle): Likewise.
1970 2017-02-26 Thomas Koenig <tkoenig@gcc.gnu.org>
1973 * options.c (gfc_post_options): Set default limit for matmul
1975 * invoke.texi: Document change.
1977 2017-02-25 Dominique d'Humieres <dominiq@lps.ens.fr>
1980 * interface.c (check_dtio_arg_TKR_intent): Change 'intent'
1983 2017-02-25 Dominique d'Humieres <dominiq@lps.ens.fr>
1986 * interface.c (gfc_match_end_interface): Remove spurious comma
1987 and space, replace 'got %s' with 'got %qs'.
1989 2017-02-20 Paul Thomas <pault@gcc.gnu.org>
1992 * interface.c (check_dtio_arg_TKR_intent): Supply 'must'
1993 missing from error message.
1995 2017-02-20 Paul Thomas <pault@gcc.gnu.org>
1998 * interface.c (gfc_find_typebound_dtio_proc): Guard test for
1999 flavor attribute by checking that symbol is resolved.
2001 2017-02-16 Paul Thomas <pault@gcc.gnu.org>
2004 * decl.c (access_attr_decl): Test for presence of generic DTIO
2005 interface and emit error if not present.
2007 2017-02-20 Paul Thomas <pault@gcc.gnu.org>
2010 * parse.c (check_component, parse_union): Whitespace.
2011 (set_syms_host_assoc): For a derived type, check if the module
2012 in which it was declared is one of the submodule ancestors. If
2013 it is, make the components public. Otherwise, reset attribute
2014 'host_assoc' and set 'use-assoc' so that encapsulation is
2017 2017-02-19 Paul Thomas <pault@gcc.gnu.org>
2020 * decl.c (gfc_set_constant_character_len): Whitespace.
2021 (gfc_match_end): Catch case where a procedure is contained in
2022 a module procedure and ensure that 'end procedure' is the
2023 correct termination.
2025 2017-02-19 Paul Thomas <pault@gcc.gnu.org>
2028 * resolve.c (fixup_unique_dummy): New function.
2029 (gfc_resolve_expr): Call it for dummy variables with a unique
2032 2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
2035 * trans-expr.c (gfc_trans_assignment_1): Deref indirect refs when
2036 compiling with -fcheck=mem to check the pointer and not the data.
2038 2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
2041 * trans-array.c (duplicate_allocatable_coarray): Ensure attributes
2042 passed are properly initialized.
2043 (structure_alloc_comps): Same.
2044 * trans-expr.c (gfc_trans_structure_assign): Same.
2046 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2048 * trans-expr.c (gfc_conv_substring): Add missing space in diagnostics.
2050 2017-02-12 Thomas Koenig <tkoenig@gcc.gnu.org>
2053 * intrinsic.c (gfc_intrinsic_func_interface): Return an error
2054 for -std=f95 for disallowed transformational functions in
2055 initialization expressions.
2057 2017-02-09 Cesar Philippidis <cesar@codesourcery.com>
2058 Joseph Myers <joseph@codesourcery.com>
2060 * openmp.c (resolve_omp_clauses): Error on directives
2061 containing both tile and collapse clauses.
2062 (resolve_oacc_loop_blocks): Represent '*' tile arguments as zero.
2063 * trans-openmp.c (gfc_trans_omp_do): Lower tiled loops like
2066 2017-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
2068 * trans-types.c (gfc_get_int_kind_from_width_isofortranen): Choose
2069 REAL type with the widest precision if two (or more) have the same
2072 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
2075 * trans-stmt.c (gfc_trans_allocate): Only deallocate the components of
2076 the temporary, when a new object was created for the temporary. Not
2077 when it is just an alias to an existing object.
2079 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
2082 * trans-decl.c (generate_coarray_sym_init): Retrieve the symbol's
2083 attributes before using them.
2085 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
2088 * trans-stmt.c (gfc_trans_allocate): Add the multiplying the _len
2089 component of unlimited polymorphic objects when source-allocating.
2091 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
2094 * trans-array.c (structure_alloc_comps): Ignore pointer components when
2097 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2100 * f95-lang.c (gfc_create_decls): Include stringpool.h.
2101 Pass main_input_filename to build_translation_unit_decl.
2103 2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
2105 * arith.c (arith_power): If simplifying integer power expression
2106 to zero, warn if -Winteger-division is given.
2108 2017-01-22 Jakub Jelinek <jakub@redhat.com>
2111 * parse.c (matchs, matcho, matchds, matchdo): Replace return st;
2112 with { ret = st; goto finish; }.
2113 (decode_omp_directive): Allow declare simd, declare target and
2114 simd directives in PURE/ELEMENTAL procedures. Only call
2115 gfc_unset_implicit_pure on successful match of other procedures.
2117 2017-01-21 Gerald Pfeifer <gerald@pfeifer.com>
2119 * gfc-internals.texi (Symbol Versioning): Change references
2120 to www.akkadia.org to https.
2122 2017-01-21 Jakub Jelinek <jakub@redhat.com>
2124 * gfortran.h (gfc_extract_int): Change return type to bool. Add
2125 int argument with = 0.
2126 * decl.c (gfc_match_kind_spec): Adjust gfc_extract_int caller, pass
2127 1 as new last argument to it, don't emit gfc_error.
2128 (match_char_kind): Likewise.
2129 (gfc_match_decl_type_spec): Use gfc_get_string ("%s", x) instead of
2131 (gfc_match_derived_decl, match_binding_attributes): Likewise.
2132 (gfc_match_structure_decl): Don't sprintf back to name, call
2133 get_struct_decl directly with gfc_dt_upper_string (name) result.
2134 * trans-stmt.c (gfc_trans_allocate): Use gfc_get_string ("%s", x)
2135 instead of gfc_get_string (x).
2136 * module.c (gfc_dt_lower_string, gfc_dt_upper_string,
2137 gfc_match_use, gfc_match_submodule, find_true_name, mio_pool_string,
2138 mio_symtree_ref, mio_expr, mio_omp_udr_expr, load_generic_interfaces,
2139 load_omp_udrs, load_needed, read_module, dump_module,
2140 create_intrinsic_function, import_iso_c_binding_module,
2141 create_int_parameter, create_int_parameter_array, create_derived_type,
2142 use_iso_fortran_env_module): Likewise.
2143 * error.c (gfc_diagnostic_starter, gfc_diagnostic_start_span): Use
2144 pp_verbatim (context->printer, "%s", x) instead of
2145 pp_verbatim (context->printer, x).
2146 * match.c (gfc_match_small_int): Adjust gfc_extract_int caller, pass
2147 1 as new last argument to it, don't emit gfc_error.
2148 (gfc_match_small_int_expr): Likewise.
2149 * iresolve.c (gfc_get_string): Optimize format "%s" case.
2150 (resolve_bound): Use gfc_get_string ("%s", x) instead of
2152 (resolve_transformational): Formatting fix.
2153 (gfc_resolve_char_achar): Change name argument to bool is_achar,
2154 use a single format string and if is_achar add "a" before "char".
2155 (gfc_resolve_achar, gfc_resolve_char): Adjust callers.
2156 * expr.c (gfc_extract_int): Change return type to bool, return true
2157 if some error occurred. Add REPORT_ERROR argument, if non-zero
2158 call either gfc_error or gfc_error_now depending on its sign.
2159 * arith.c (arith_power): Adjust gfc_extract_int caller.
2160 * symbol.c (gfc_add_component): Use gfc_get_string ("%s", x) instead
2161 of gfc_get_string (x).
2162 (gfc_new_symtree, gfc_delete_symtree, gfc_get_uop, gfc_new_symbol,
2163 gfc_get_gsymbol, generate_isocbinding_symbol): Likewise.
2164 * openmp.c (gfc_match_omp_clauses): Adjust gfc_extract_int caller, pass
2165 -1 as new last argument to it, don't emit gfc_error_now.
2166 (gfc_match_omp_declare_reduction): Use gfc_get_string ("%s", x)
2167 instead of gfc_get_string (x).
2168 * check.c (kind_check): Adjust gfc_extract_int caller.
2169 * intrinsic.c (add_sym, find_sym, make_alias): Use
2170 gfc_get_string ("%s", x) instead of gfc_get_string (x).
2171 * simplify.c (get_kind, gfc_simplify_btest, gfc_simplify_maskr,
2172 gfc_simplify_maskl, gfc_simplify_poppar, gfc_simplify_repeat,
2173 gfc_simplify_selected_int_kind, gfc_simplify_selected_real_kind):
2174 Adjust gfc_extract_int callers.
2175 * trans-decl.c (gfc_find_module): Use gfc_get_string ("%s", x)
2176 instead of gfc_get_string (x).
2177 * matchexp.c (expression_syntax): Add const.
2178 * primary.c (match_kind_param, match_hollerith_constant,
2179 match_string_constant): Adjust gfc_extract_int callers.
2180 (match_keyword_arg): Use gfc_get_string ("%s", x) instead of
2182 * frontend-passes.c (optimize_minmaxloc): Likewise.
2184 2017-01-19 Andre Vehreschild <vehre@gcc.gnu.org>
2187 * trans-decl.c (gfc_build_qualified_array): Add static decl to parent
2188 function only, when the decl-context is not the translation unit.
2190 2017-01-18 Louis Krupp <louis.krupp@zoho.com>
2194 * trans-expr.c (gfc_conv_variable): Don't treat temporary variables
2195 as function arguments.
2196 * trans-stmt.c (forall_make_variable_temp,
2197 generate_loop_for_temp_to_lhs, gfc_trans_assign_need_temp,
2198 gfc_trans_forall_1): Don't adjust offset of forall temporary
2199 for array sections, make forall temporaries work for substring
2200 expressions, improve test coverage by adding -ftest-forall-temp
2201 option to request usage of temporary array in forall code.
2202 * lang.opt: Add -ftest-forall-temp option.
2203 * invoke.texi: Add -ftest-forall-temp option.
2205 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
2207 * primary.c (caf_variable_attr): Improve figuring whether the current
2208 component is the last one refed.
2209 * trans-stmt.c (gfc_trans_allocate): Do not generate sync_all calls
2210 when allocating pointer or allocatable components.
2212 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
2214 * gfortran.texi: Add missing parameters to caf-API functions. Correct
2215 typos and clarify some descriptions.
2217 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
2220 Missed some cases, here they are:
2221 * trans-decl.c (gfc_build_qualified_array): Add static tokens to the
2222 parent function's scope.
2223 * trans-expr.c (gfc_get_tree_for_caf_expr): Shorten code. Remove
2226 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
2229 * resolve.c (resolve_lock_unlock_event): Resolve the expression for
2230 event's until_count.
2232 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
2235 * trans-expr.c (gfc_get_tree_for_caf_expr): Ensure the backend_decl
2236 is valid before accessing it.
2238 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2240 PR translation/79019
2241 PR translation/79020
2242 * decl.c (attr_decl1): Fix spelling in translatable string.
2243 * intrinsic.texi: Fix spelling - invokation -> invocation.
2244 * lang.opt (faggressive-function-elimination, gfc_convert): Fix
2245 typos in descriptions.
2246 * openmp.c (resolve_omp_clauses): Add missing whitespace to
2247 translatable strings.
2249 2017-01-08 Martin Sebor <msebor@redhat.com>
2251 PR tree-optimization/78913
2253 * trans-common.c (build_equiv_decl): Increase buffer size to avoid
2254 truncation for any argument.
2255 * trans-types.c (gfc_build_logical_type): Same.
2257 2017-01-07 Andre Vehreschild <vehre@gcc.gnu.org>
2261 * expr.c (gfc_check_pointer_assign): Return the same error message for
2262 rewritten coarray pointer assignments like for plain ones.
2263 * gfortran.h: Change prototype.
2264 * primary.c (caf_variable_attr): Set attributes used ones only only
2265 ones. Add setting of pointer_comp attribute.
2266 (gfc_caf_attr): Add setting of pointer_comp attribute.
2267 * trans-array.c (gfc_array_allocate): Add flag that the component to
2268 allocate is not an ultimate coarray component. Add allocation of
2270 (structure_alloc_comps): Extend nullify to treat pointer components in
2271 coarrays correctly. Restructure nullify to remove redundant code.
2272 (gfc_nullify_alloc_comp): Allow setting caf_mode flags.
2273 * trans-array.h: Change prototype of gfc_nullify_alloc_comp ().
2274 * trans-decl.c (generate_coarray_sym_init): Call nullify_alloc_comp for
2275 derived type coarrays with pointer components.
2276 * trans-expr.c (gfc_trans_structure_assign): Also treat pointer
2278 (trans_caf_token_assign): Handle assignment of token of scalar pointer
2280 (gfc_trans_pointer_assignment): Call above routine.
2281 * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Add treating pointer
2283 (gfc_conv_intrinsic_caf_get): Likewise.
2284 (conv_caf_send): Likewise.
2285 * trans-stmt.c (gfc_trans_allocate): After allocating a derived type in
2286 a coarray pre-register the tokens.
2287 (gfc_trans_deallocate): Simply determining the coarray type (scalar or
2288 array) and deregistering it correctly.
2289 * trans-types.c (gfc_typenode_for_spec): Replace in_coarray flag by the
2290 actual codim to allow lookup of array types in the cache.
2291 (gfc_build_array_type): Likewise.
2292 (gfc_get_array_descriptor_base): Likewise.
2293 (gfc_get_array_type_bounds): Likewise.
2294 (gfc_get_derived_type): Likewise.
2295 * trans-types.h: Likewise.
2296 * trans.c (gfc_deallocate_with_status): Enable deregistering of all kind
2297 of coarray components.
2298 (gfc_deallocate_scalar_with_status): Use free() in fcoarray_single mode
2299 instead of caf_deregister.
2301 2017-01-06 Jakub Jelinek <jakub@redhat.com>
2303 * simplify.c (simplify_transformation_to_array): Use
2304 GCC_DIAGNOSTIC_PUSH_IGNORED and GCC_DIAGNOSTIC_POP instead of
2305 #pragma GCC diagnostic {push,ignored,pop}.
2307 2017-01-06 Alexandre Oliva <aoliva@redhat.com>
2309 * simplify.c (simplify_transformation_to_array): Silence
2310 array bounds warning. Fix whitespace.
2312 2017-01-04 Alexandre Oliva <aoliva@redhat.com>
2314 * module.c (load_omp_udrs): Initialize name.
2316 2017-01-02 Janne Blomqvist <jb@gcc.gnu.org>
2319 * trans-expr.c (gfc_trans_string_copy): Rework string copy
2320 algorithm to avoid -Wstringop-overflow warning.
2322 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2324 Update copyright years.
2326 * gfortranspec.c (lang_specific_driver): Update copyright notice
2328 * gfc-internals.texi: Bump @copying's copyright year.
2329 * gfortran.texi: Ditto.
2330 * intrinsic.texi: Ditto.
2331 * invoke.texi: Ditto.
2333 Copyright (C) 2017 Free Software Foundation, Inc.
2335 Copying and distribution of this file, with or without modification,
2336 are permitted in any medium without royalty provided the copyright
2337 notice and this notice are preserved.