re PR fortran/65453 (ICE in build_function_decl, at fortran/trans-decl.c:2001)
[gcc.git] / gcc / fortran / ChangeLog
1 2018-03-18 Steven G. Kargl <kargl@gcc.gnu.org>
2
3 PR fortran/65453
4 * decl.c (get_proc_name): Catch clash between a procedure statement
5 and a contained subprogram
6
7 2018-03-16 Steven G. Kargl <kargl@gcc.gnu.org>
8
9 PR fortran/69395
10 * decl.c (merge_array_spec): Correct the error condition.
11
12 2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
13
14 PR fortran/78741
15 * decl.c (get_proc_name): Check for clash of entry name with
16 subroutine name.
17
18 2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
19
20 PR fortran/69395
21 * decl.c (merge_array_spec): Limit the merging to maximum allowed
22 dimensions, and issue error message if limit is exceeded.
23
24 2018-03-13 Steven G. Kargl <kargl@gcc.gnu.org>
25
26 * check.c (gfc_check_kill_sub): Remove check for INTEGER(4) or (8).
27 * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
28 (add_subroutines): Remove reference to gfc_resolve_kill_sub.
29 * intrinsic.texi: Update documentation.
30 * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
31 * trans-decl.c (gfc_build_intrinsic_function_decls): Add
32 gfor_fndecl_kill and gfor_fndecl_kill_sub
33 * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
34 functions.
35 (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
36 (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
37 * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
38
39 2018-03-11 Paul Thomas <pault@gcc.gnu.org>
40
41 PR fortran/84546
42 * trans-array.c (structure_alloc_comps): Make sure that the
43 vptr is copied and that the unlimited polymorphic _len is used
44 to compute the size to be allocated.
45 * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
46 unlimited polymorphic _len for the offset to the element.
47 (gfc_copy_class_to_class): Set the new 'unlimited' argument.
48 * trans.h : Add the boolean 'unlimited' to the prototype.
49
50 2018-03-11 Steven G. Kargl <kargl@gcc.gnu.org>
51
52 PR fortran/83939
53 * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
54
55 2018-03-11 Steven G. Kargl <kargls@gcc.gnu.org>
56
57 * check.c (gfc_check_kill): Check pid and sig are scalar.
58 (gfc_check_kill_sub): Restrict kind to 4 and 8.
59 * intrinsic.c (add_function): Sort keyword list. Add pid and sig
60 keywords for KILL. Remove redundant *back="back" in favor of the
61 original *bck="back".
62 (add_subroutines): Sort keyword list. Add pid and sig keywords
63 for KILL.
64 * intrinsic.texi: Fix documentation to consistently use pid and sig.
65 * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8. Choose the
66 correct function.
67 (gfc_resolve_rename_sub): Add comment.
68
69 2018-03-11 Thomas Koenig <tkoenig@gcc.gnu.org>
70
71 PR fortran/66128
72 * simplify.c (simplify_transformation): Return default result for
73 empty array argument.
74 (gfc_simplify_all): Remove special-case handling for zerosize.
75 (gfc_simplify_any): Likewise.
76 (gfc_simplify_count): Likewise.
77 (gfc_simplify_iall): Likewise.
78 (gfc_simplify_iany): Likewise.
79 (gfc_simplify_iparity): Likewise.
80 (gfc_simplify_minval): Likewise.
81 (gfc_simplify_maxval): Likewise.
82 (gfc_simplify_norm2): Likewise.
83 (gfc_simplify_product): Likewise.
84 (gfc_simplify_sum): Likewise.
85
86 2018-03-10 Steven G. Kargl <kargl@gcc.gnu.org>
87
88 PR fortran/84734
89 * arith.c (check_result, eval_intrinsic): If result overflows, pass
90 the expression up the chain instead of a NULL pointer.
91
92 2018-03-07 Steven G. Kargl <kargl@gcc.gnu.org>
93
94 PR fortran/64124
95 PR fortran/70409
96 * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
97
98 2017-03-06 Thomas Koenig <tkoenig@gcc.gnu.org>
99
100 PR fortran/84697
101 PR fortran/66128
102 * expr.c (simplify_parameter_variable): If p is a size zero array
103 and not an ARRAY_EXPR insert an empty array constructor and
104 return.
105 * gfortran.h: Add prototype for gfc_is_size_zero_array.
106 * simplify.c (is_size_zero_array): Make non-static and rename into
107 (gfc_is_size_zero_array): Check for parameter arrays of zero
108 size by comparing shape and absence of constructor.
109 (gfc_simplify_all): Use gfc_is_size_zero_array instead of
110 is_size_zero_array.
111 (gfc_simplify_count): Likewise.
112 (gfc_simplify_iall): Likewise.
113 (gfc_simplify_iany): Likewise.
114 (gfc_simplify_iparity): Likewise.
115 (gfc_simplify_minval): Likewise.
116 (gfc_simplify_maxval): Likewise.
117 (gfc_simplify_product): Likewise.
118 (gfc_simplify_sum): Likewise.
119
120 2018-03-06 Steven G. Kargl <kargl@gcc.gnu.org>
121
122 PR fortran/56667
123 * primary.c (match_sym_complex_part): Give the matcher for an implied
124 do-loop a chance to run.
125
126 2018-03-03 Harald Anlauf <anlauf@gmx.de>
127
128 PR fortran/71085
129 * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
130 dereference NULL pointer.
131
132 2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
133
134 PR fortran/66128
135 * simplify.c (is_size_zero_array): New function to check for size
136 zero array.
137 (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
138 gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
139 gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
140 gfc_simplify_product, gfc_simplify_sum): Use it, and implement
141 requirements from F2018.
142
143 2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
144
145 PR fortran/51434
146 * simplify.c (gfc_simplify_transfer): Resolve mold.
147
148 2018-03-03 Paul Thomas <pault@gcc.gnu.org>
149
150 PR fortran/80965
151 * resolve.c (build_loc_call): Change symtree name from 'loc' to
152 '_loc'.
153
154 2018-03-01 Paul Thomas <pault@gcc.gnu.org>
155
156 PR fortran/84219
157 * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
158 components are caf tokens.
159 (gfc_target_interpret_expr): Treat BT_VOID expressions as
160 integers.
161
162 2018-03-01 Paul Thomas <pault@gcc.gnu.org>
163
164 PR fortran/84538
165 * class.c (class_array_ref_detected): Remove the condition that
166 there be no reference after the array reference.
167 (find_intrinsic_vtab): Remove excess whitespace.
168 * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
169 as 'base and call build_class_array_ref earlier.
170
171 2018-02-28 Paul Thomas <pault@gcc.gnu.org>
172
173 PR fortran/83901
174 * trans-stmt.c (trans_associate_var): Make sure that the se
175 expression is a pointer type before converting it to the symbol
176 backend_decl type.
177
178 2018-02-25 Steven G. Kargl <kargl@gcc.gnu.org>
179
180 PR fortran/83633
181 * decl.c (variable_decl): Check that an explicit-shape-array with
182 nonconstant bounds is allowed.
183
184 2018-02-25 Paul Thomas <pault@gcc.gnu.org>
185
186 PR fortran/84523
187 * trans-intrinsic.c (gfc_conv_allocated): If the argument se
188 has a pre block, add it to the expression pre block.
189
190 2018-02-25 Thomas Koenig <tkoenig@gcc.gnu.org>
191
192 PR fortran/78238
193 * gfortran.h (gfc_integer_4_kind): Define.
194 * resolve.c (resolve_select_type): Make sure that the
195 kind of c->high is gfc_integer_4_kind.
196
197 2018-02-24 Steven G. Kargl <kargl@gcc.gnu.org>
198
199 PR fortran/30792
200 * decl.c (gfc_match_data): Check for invalid substring in
201 data-implied-do
202
203 2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
204
205 * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
206
207 2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
208
209 PR fortran/84511
210 * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
211
212 2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
213
214 PR fortran/84346
215 * interface.c (compare_actual_formal): Issue error if keyword is
216 used in a statement function.
217
218 2018-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
219
220 PR fortran/84506
221 * trans-io.c (set_parameter_value_inquire): Adjust range check of
222 negative unit values for kind=8 units to the kind=4 negative limit.
223
224 2018-02-23 Paul Thomas <pault@gcc.gnu.org>
225
226 PR fortran/83149
227 * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
228 accessing its components.
229
230 2018-02-23 Paul Thomas <pault@gcc.gnu.org>
231
232 PR fortran/83149
233 * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
234 before accessing its components.
235
236 2018-02-23 Paul Thomas <pault@gcc.gnu.org>
237
238 PR fortran/83148
239 * trans-const.c : Clean up some whitespace issues.
240 * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
241 derived type has a kind value of zero, set it to the default
242 integer kind.
243
244 2018-02-23 Janne Blomqvist <jb@gcc.gnu.org>
245
246 PR fortran/84519
247 * trans-decl.c (gfc_build_builtin_function_decls): Add bool
248 argument to stop and error stop decls.
249 * trans-stmt.c (gfc_trans_stop): Add false value to argument
250 lists.
251
252 2018-02-22 Janne Blomqvist <jb@gcc.gnu.org>
253
254 PR 78534
255 PR 84509
256 * trans-decl.c (gfc_build_builtin_function_decls): Pass
257 gfc_int8_type node to pause_numeric, size_type_node to
258 pause_string.
259 * trans-stmt.c (gfc_trans_pause): Likewise.
260
261 2018-02-22 Janne Blomqvist <jb@gcc.gnu.org>
262
263 * gfortran.texi: Update Coarray API description.
264 * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
265 character lengths, int for exit codes.
266 (generate_coarray_sym_init): Use size_t for character length.
267 * trans-intrinsic.c (conv_co_collective): Likewise.
268 * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
269 (gfc_trans_event_post_wait): Likewise.
270 (gfc_trans_sync): Likewise.
271 (gfc_trans_stop): Use size_t for character lengths, int for exit
272 codes.
273
274 2018-02-20 Thomas Koenig <tkoenig@gcc.gnu.org>
275
276 PR fortran/48890
277 PR fortran/83823
278 * primary.c (gfc_convert_to_structure_constructor):
279 For a constant string constructor, make sure the length
280 is correct.
281
282 2018-02-19 Paul Thomas <pault@gcc.gnu.org>
283
284 PR fortran/83344
285 PR fortran/83975
286 * resolve.c (resolve_assoc_var): Rearrange the logic for the
287 determination of the character length of associate names. If
288 the associate name is missing a length expression or the length
289 expression is not a constant and the target is not a variable,
290 make the associate name allocatable and deferred length.
291 * trans-decl.c (gfc_get_symbol_decl): Null the character length
292 backend_decl for deferred length associate names that are not
293 variables. Set 'length' to gfc_index_zero_node for character
294 associate names, whose character length is a PARM_DECL.
295
296 2018-02-19 Thomas Koenig <tkoenig@gcc.gnu.org>
297
298 PR fortran/35339
299 * frontend-passes.c (traverse_io_block): Remove workaround for
300 PR 80945.
301
302 2018-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
303
304 * gfortran.texi: Document additional src/dst_type. Fix some typos.
305 * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
306 argument of _caf_*_by_ref () with * e { get, send, sendget }.
307 * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
308 data referenced when generating a call to caf_get_by_ref ().
309 (conv_caf_send): Same but for caf_send_by_ref () and
310 caf_sendget_by_ref ().
311
312 2018-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
313
314 PR fortran/84389
315 * io.c (check_format): Allow FMT_COLON.
316
317 2018-02-18 Paul Thomas <pault@gcc.gnu.org>
318
319 PR fortran/80945
320 * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
321 the typenode in the case of deferred length characters.
322
323 2018-02-17 Thomas Koenig <tkoenig@gcc.gnu.org>
324
325 PR fortran/84270
326 * frontend-passes (scalarized_expr): If the expression
327 is an assumed size array, leave in the last reference
328 and pass AR_SECTION instead of AR_FULL to gfc_resolve
329 in order to avoid an error.
330
331 2018-02-17 Paul Thomas <pault@gcc.gnu.org>
332
333 PR fortran/84115
334 * resolve.c (resolve_assoc_var): If a non-constant target expr.
335 has no string length expression, make the associate variable
336 into a deferred length, allocatable symbol.
337 * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
338 the symbol.
339 * trans-stmt.c (trans_associate_var): Null and free scalar
340 associate names that are allocatable. After assignment, remove
341 the allocatable attribute to prevent reallocation.
342
343 2018-02-16 Jakub Jelinek <jakub@redhat.com>
344
345 PR fortran/84418
346 * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
347 kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
348
349 2018-02-16 Dominique d'Humieres <dominiq@gcc.gnu.org>
350
351 PR fortran/84354
352 * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
353
354 2018-02-15 Janus Weil <janus@gcc.gnu.org>
355
356 PR fortran/84409
357 * interface.c (check_dtio_arg_TKR_intent): Add a check for character
358 length.
359
360 2018-02-14 Janus Weil <janus@gcc.gnu.org>
361
362 PR fortran/84385
363 * match.c (gfc_match_select_type): Fix check for selector in
364 SELECT TYPE statement.
365
366 2018-02-13 Janus Weil <janus@gcc.gnu.org>
367
368 PR fortran/84313
369 * symbol.c (check_conflict): Reject procedure pointers in common blocks.
370
371 2018-02-13 Alastair McKinstry <alastair.mckinstry@sceal.ie>
372 Janne Blomqvist <jb@gcc.gnu.org>
373
374 * module.c (dump_module): Use lbasename to ensure that module
375 files are reproducible.
376
377 2018-02-12 Janus Weil <janus@gcc.gnu.org>
378
379 PR fortran/84273
380 * resolve.c (resolve_component): Fix checks of passed argument in
381 procedure-pointer components.
382
383 2018-02-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
384
385 PR fortran/35299
386 * resolve.c (resolve_formal_arglist): Update error message.
387
388 2018-02-11 Andre Vehreschild <vehre@gcc.gnu.org>
389
390 * gfortran.texi: Fix typos in documentation of caf_register ().
391 * trans-array.c (structure_alloc_comps): Only register a component of
392 a derived typed corray, not of an ultimate component coarray.
393
394 2018-02-11 Steven G. Kargl <kargl@gcc.gnu.org>
395
396 PR fortran/54223
397 PR fortran/84276
398 * interface.c (compare_actual_formal): Add in_statement_function
399 bool parameter. Skip check of INTENT attribute for statement
400 functions. Arguments to a statement function cannot be optional,
401 issue error for missing argument.
402 (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
403 in_statement_function.
404
405 2018-02-11 Paul Thomas <pault@gcc.gnu.org>
406
407 PR fortran/84074
408 * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
409 flag. If the is a vector subscript or the expression is not a
410 variable, make the descriptor one-based.
411
412 2018-02-10 Paul Thomas <pault@gcc.gnu.org>
413
414 PR fortran/84141
415 PR fortran/84155
416 * trans-array.c (gfc_array_init_size): Revert the change made
417 in revision 257356 setting the dtype.
418 * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
419 Call gfc_get_dtype_rank_type every time.
420
421 PR fortran/56691
422 * trans-array.c (gfc_conv_expr_descriptor): If the source array
423 is a descriptor type, use its offset, removing the condition
424 that is be a class expression.
425
426 2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
427
428 PR fortran/82994
429 * match.c (gfc_match_deallocate): Check for NULL pointer.
430
431 2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org>
432
433 PR fortran/68560
434 * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
435 (gfc_conv_intrinsic_function): Call it.
436
437 2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
438
439 PR fortran/82049
440 * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
441 try to resolve it. While here return early if possible.
442
443 2018-02-04 Paul Thomas <pault@gcc.gnu.org>
444
445 PR fortran/84115
446 * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
447 'length' if the symbol charlen backend_decl is an indirect ref.
448
449 2018-02-03 Paul Thomas <pault@gcc.gnu.org>
450
451 PR fortran/84141
452 PR fortran/84155
453 * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
454 use gfc_get_dtype_rank_type.
455
456 2018-02-01 Janne Blomqvist <jb@gcc.gnu.org>
457
458 PR 83975
459 PR 83344
460 * resolve.c (resolve_assoc_var): Generate an error if
461 target length unknown.
462
463 2018-02-01 Janne Blomqvist <jb@gcc.gnu.org>
464
465 PR fortran/83705
466 * simplify.c (gfc_simplify_repeat): Increase limit for deferring
467 to runtime, print a warning message.
468
469 2018-01-31 Jakub Jelinek <jakub@redhat.com>
470
471 PR fortran/84116
472 * openmp.c (gfc_match_omp_clauses): If all the linear
473 gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
474 nor set *head = NULL. Formatting fixes.
475
476 2018-01-31 Paul Thomas <pault@gcc.gnu.org>
477
478 PR fortran/84088
479 * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
480 an address expression passed to an assumed rank dummy, convert
481 to an indirect reference.
482
483 2018-01-31 Thomas Koenig <tkoenig@gcc.gnu.org>
484
485 * dump-parse-tree.c (write_proc): Use sym_name (which may
486 be sym->binding_label) instead of sym->name.
487
488 2018-01-31 Janne Blomqvist <jb@gcc.gnu.org>
489
490 * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
491 of int for slen.
492
493 2018-01-31 Janne Blomqvist <jb@gcc.gnu.org>
494
495 PR fortran/78534
496 * trans-expr.c (fill_with_spaces): Use memset instead of
497 generating loop.
498 (gfc_trans_string_copy): Improve opportunity to use builtins with
499 constant lengths.
500
501 2018-01-30 Jakub Jelinek <jakub@redhat.com>
502
503 PR debug/84131
504 * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
505 to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
506
507 2018-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
508
509 PR fortran/84134
510 * array.c (gfc_ref_dimen_size): Whitespace fixes. If stride is
511 zero, return false.
512
513 2018-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
514
515 PR fortran/84133
516 * frontend-passes (matmul_to_var_expr): Return early if
517 in association list.
518 (inline_matmul_assign): Likewise.
519
520 2017-01-29 Thomas Koenig <tkoenig@gcc.gnu.org>
521
522 PR fortran/84073
523 * resolve.c (resolve_component): Ensure BIND(C) character
524 components have length one.
525 (resolve_symbol): Likewise for variables.
526
527 2018-01-27 Jakub Jelinek <jakub@redhat.com>
528
529 PR fortran/84065
530 * decl.c (add_init_expr_to_sym): Ignore initializers for too large
531 lengths.
532
533 2018-01-26 Damian Rouson <damian@sourceryinstitute.org>
534 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
535 Soren Rasmussen <s.c.rasmussen@gmail.com>
536
537 Partial support for Fortran 2018 teams features.
538
539 * array.c (gfc_match_array_ref): add team attribute in coarray
540 transfers.
541 * check.c (gfc_check_get_team, gfc_check_team_number): add new
542 functions for get_team and team_number.
543 * dump-parse-tree.c (show_code_node): add new statements: form team,
544 change team, end team, and sync team.
545 * expr.c (gfc_find_team_co): add new function.
546 * gfortran.h: add new statements.
547 * intrinsic.c (add_functions): add get_team and team_number functions.
548 * intrinsic.h: add get_team and team_number prototypes for check,
549 simplify, and resolve.
550 * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
551 functions.
552 * iso-fortran-env.def: add the team_type derived type.
553 * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
554 (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
555 add change team, end team, form team, sync team match and functions.
556 * match.h: add new prototypes for change team, end team, form team,
557 and sync team.
558 * parse.c (decode_statement): add cases for change team, end team,
559 form team, and sync team.
560 * resolve.c: add cases for exec form team, change team, end team, and
561 sync team.
562 * simplify.c (gfc_simplify_get_team): add new function for get team.
563 * st.c (gfc_free_statement): add cases exec for change team, end team,
564 form team, sync team.
565 * trans-decl.c (gfor_fndecl_caf_form_team)
566 (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
567 (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
568 (gfor_fndecl_caf_team_number): add functions and definitions.
569 * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
570 new function and team_type argument support.
571 * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
572 (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
573 * trans-stmt.h: add new prototypes.
574 * trans-types.c (gfc_get_derived_type): check condition for team_type.
575 * trans.c (trans_code): new exec cases for form team, change team, end
576 team, and sync team.
577 * trans.h: add new prototypes.
578
579 2018-01-26 Steven G. Kargl <kargl@gcc.gnu.org>
580
581 PR fortran/83998
582 * simplify.c (compute_dot_product): Initialize result to INTEGER(1) 0
583 or .false. The summation does the correct type conversion.
584 (gfc_simplify_dot_product): Special case zero-sized arrays.
585
586 2018-25-01 Paul Thomas <pault@gcc.gnu.org>
587
588 PR fortran/37577
589 * array.c (gfc_match_array_ref): If standard earlier than F2008
590 it is an error if the reference dimension is greater than 7.
591 libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
592 dtype masks and shifts accordingly.
593 * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
594 type node to check the field.
595 (gfc_conv_descriptor_dtype): Access the rank field of dtype.
596 (duplicate_allocatable_coarray): Access the rank field of the
597 dtype descriptor rather than the dtype itself.
598 * trans-expr.c (get_scalar_to_descriptor_type): Store the type
599 of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
600 (ie. a character).
601 (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
602 get_scalar_to_descriptor_type if the actual expression is a
603 constant.
604 (gfc_trans_structure_assign): Assign the rank directly to the
605 dtype rank field.
606 * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
607 to default integer kind.
608 (gfc_conv_intrinsic_sizeof): Obtain the element size from the
609 'elem_len' field of the dtype.
610 * trans-io.c (gfc_build_io_library_fndecls): Replace
611 gfc_int4_type_node with dtype_type_node where necessary.
612 (transfer_namelist_element): Use gfc_get_dtype_rank_type for
613 scalars.
614 * trans-types.c : Provide 'get_dtype_type_node' to acces the
615 dtype_type_node and, if necessary, build it.
616 The maximum size of an array element is now determined by the
617 maximum value of size_t.
618 Update the description of the array descriptor, including the
619 type def for the dtype_type.
620 (gfc_get_dtype_rank_type): Build a constructor for the dtype.
621 Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
622 (gfc_get_array_descriptor_base): Change the type of the dtype
623 field to dtype_type_node.
624 (gfc_get_array_descr_info): Get the offset to the rank field of
625 the dtype.
626 * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
627 * trans.h : Define the indices of the dtype fields.
628
629 2018-23-01 Paul Thomas <pault@gcc.gnu.org>
630
631 PR fortran/83866
632 * decl.c (gfc_match_derived_decl): If eos not matched, recover
633 and emit error about garbage after declaration.
634
635 2018-23-01 Paul Thomas <pault@gcc.gnu.org>
636
637 PR fortran/83898
638 * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
639 for characters.
640
641 2018-01-22 Janne Blomqvist <jb@gcc.gnu.org>
642
643 PR 78534
644 PR 83704
645 * arith.c (gfc_arith_concat): Use size_t for string length.
646 (gfc_compare_string): Likewise.
647 (gfc_compare_with_Cstring): Likewise.
648 * array.c (gfc_resolve_character_array_constructor): Use
649 HOST_WIDE_INT, gfc_mpz_get_hwi.
650 * check.c (gfc_check_fe_runtime_error): Use size_t.
651 * data.c (create_character_initializer): Use HOST_WIDE_INT,
652 gfc_extract_hwi.
653 * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
654 (add_init_expr_to_sym): Use HOST_WIDE_INT.
655 * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
656 gfc_extract_hwi.
657 (gfc_apply_init): Likewise.
658 * match.h (gfc_set_constant_character_len): Update prototype.
659 * primary.c (match_string_constant): Use size_t.
660 * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
661 gfc_mpz_get_hwi.
662 * simplify.c (init_result_expr): Likewise.
663 (gfc_simplify_len_trim): Use size_t.
664 * target-memory.c (gfc_encode_character): Use size_t.
665 (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
666 (interpret_array): Use size_t.
667 (gfc_interpret_character): Likewise.
668 * target-memory.h (gfc_encode_character): Update prototype.
669 (gfc_interpret_character): Likewise.
670 (gfc_target_interpret_expr): Likewise.
671 * trans-const.c (gfc_build_string_const): Use size_t for length
672 argument.
673 (gfc_build_wide_string_const): Likewise.
674 * trans-const.h (gfc_build_string_const): Likewise.
675 (gfc_build_wide_string_const): Likewise.
676
677 2018-01-20 Steven G. Kargl <kargl@gcc.gnu.org>
678
679 PR fortran/83900
680 * simplify.c (gfc_simplify_matmul): Set return type correctly.
681
682 2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
683
684 PR fortran/83900
685 * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
686
687 2018-01-17 Harald Anlauf <anlauf@gmx.de>
688
689 PR fortran/83864
690 * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
691
692 2018-01-17 Harald Anlauf <anlauf@gmx.de>
693
694 PR fortran/83874
695 * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
696
697 2018-01-15 Louis Krupp <louis.krupp@zoho.com>
698
699 PR fortran/82257
700 * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
701 from symbol marked unlimited polymorphic.
702 * resolve.c (resolve_structure_cons): Likewise.
703 * misc.c (gfc_typename): Don't dereference derived->components
704 if it's NULL.
705
706 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org>
707
708 PR fortran/54613
709 * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
710 (gfc_logical_4_kind): New macro
711 * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
712 (gfc_simplify_maxloc): Likewise.
713 (gfc_resolve_maxloc): Likewise.
714 (gfc_resolve_minloc): Likewise.
715 * check.c (gfc_check_minloc_maxloc): Add checking for "back"
716 argument; also raise error if it is used (for now). Add it
717 if it isn't present.
718 * intrinsic.c (add_sym_4ml): Rename to
719 (add_sym_5ml), adjust for extra argument.
720 (add_functions): Add "back" constant. Adjust maxloc and minloc
721 for back argument.
722 * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
723 not of gfc_logical_4_kind, convert.
724 (gfc_resolve_minloc): Likewise.
725 * simplify.c (gfc_simplify_minloc): Add back argument.
726 (gfc_simplify_maxloc): Likewise.
727 * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
728 argument to %VAL to ensure passing by value.
729 (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
730 also for library calls.
731
732 2018-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
733
734 PR fortran/82007
735 * resolve.c (resolve_transfer): Delete code looking for 'DT'
736 format specifiers in format strings. Set formatted to true if a
737 format string or format label is present.
738 * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
739 whitespace.
740
741 2018-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
742
743 PR fortran/83744
744 * dump-parse-tree.c (get_c_type_name): Remove extra line.
745 Change for loop to use declaration in for loop. Handle BT_LOGICAL
746 and BT_CHARACTER.
747 (write_decl): Add where argument. Fix indentation. Replace
748 assert with error message. Add typename to warning
749 in comment.
750 (write_type): Adjust locus to call of write_decl.
751 (write_variable): Likewise.
752 (write_proc): Likewise. Replace assert with error message.
753
754 2018-01-13 Paul Thomas <pault@gcc.gnu.org>
755
756 PR fortran/52162
757 * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
758 the rhs expression is neither an elemental nor a conversion
759 function.
760
761 PR fortran/83622
762 * trans-array.c (is_pointer_array): Remove unconditional return
763 of false for -fopenmp.
764
765 2018-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
766 <emsr@gcc.gnu.org>
767
768 PR fortran/83803
769 * dump-parse-tree.c (write_proc): Always emit closing parenthesis
770 for functions.
771
772 2018-01-10 Steven G. Kargl <kargl@gcc.gnu.org>
773
774 PR fortran/82367
775 * resolve.c (resolve_allocate_expr): Check for NULL pointer.
776
777 2018-01-10 Steven G. Kargl <kargl@gcc.gnu.org>
778
779 PR fortran/83093
780 * resolve.c (resolve_charlen): Check the type of cl->length
781 after resolution.
782
783 2018-01-10 Janne Blomqvist <jb@gcc.gnu.org>
784
785 PR fortran/83740
786 * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
787
788 2018-01-10 Janne Blomqvist <jb@gcc.gnu.org>
789
790 PR fortran/83740
791 * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
792 LHS type when assigning.
793
794 2018-01-09 Steven G. Kargl <kargl@gcc.gnu.org>
795
796 PR fortran/83742
797 * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
798
799 2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>
800
801 * match.c (gfc_match_allocate): Check for NULL pointer.
802
803 2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>
804
805 * expr.c (gfc_check_pointer_assign): Fix typo in comment.
806
807 2018-01-08 Paul Thomas <pault@gcc.gnu.org>
808
809 PR fortran/83611
810 * decl.c (gfc_get_pdt_instance): If parameterized arrays have
811 an initializer, convert the kind parameters and add to the
812 component if the instance.
813 * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
814 use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
815 for parameterized arrays. Clean up typos in comments. Convert
816 parameterized array initializers and copy into the array.
817 * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
818 parameterized types.
819 *trans-stmt.c (trans_associate_var): Deallocate associate vars
820 as necessary, when they are PDT function results for example.
821
822 PR fortran/83731
823 * trans-array.c (structure_alloc_comps): Only compare len parms
824 when they are declared explicitly.
825
826 2018-01-06 Janne Blomqvist <jb@gcc.gnu.org>
827
828 PR fortran/50892
829 * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
830 lhs type.
831
832 2018-01-05 Janne Blomqvist <jb@gcc.gnu.org>
833
834 PR fortran/78534
835 PR fortran/66310
836 * array.c (got_charlen): Use gfc_charlen_int_kind.
837 * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
838 hardcoded kind.
839 (find_intrinsic_vtab): Likewise.
840 * decl.c (match_char_length): Use gfc_charlen_int_kind.
841 (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
842 (gfc_match_implicit): Use gfc_charlen_int_kind.
843 * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
844 (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
845 * expr.c (gfc_get_character_expr): Length parameter of type
846 gfc_charlen_t.
847 (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
848 (gfc_extract_hwi): New function.
849 (simplify_const_ref): Make string_len of type gfc_charlen_t.
850 (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
851 * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
852 * gfortran.h (gfc_mpz_get_hwi): New prototype.
853 (gfc_mpz_set_hwi): Likewise.
854 (gfc_charlen_t): New typedef.
855 (gfc_expr): Use gfc_charlen_t for character lengths.
856 (gfc_size_kind): New extern variable.
857 (gfc_extract_hwi): New prototype.
858 (gfc_get_character_expr): Use gfc_charlen_t for character length.
859 (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
860 * gfortran.texi: Update description of hidden string length argument.
861 * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
862 (gfc_resolve_char_achar): Likewise.
863 (gfc_resolve_repeat): Pass string length directly without
864 temporary, use gfc_charlen_int_kind.
865 (gfc_resolve_transfer): Use gfc_charlen_int_kind.
866 * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
867 * misc.c (gfc_mpz_get_hwi): New function.
868 (gfc_mpz_set_hwi): New function.
869 * module.c (atom_int): Change type from int to HOST_WIDE_INT.
870 (parse_integer): Don't complain about large integers.
871 (write_atom): Use HOST_WIDE_INT for integers.
872 (mio_integer): Handle integer type mismatch.
873 (mio_hwi): New function.
874 (mio_intrinsic_op): Use HOST_WIDE_INT.
875 (mio_array_ref): Likewise.
876 (mio_expr): Likewise.
877 * primary.c (match_substring): Use gfc_charlen_int_kind.
878 * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
879 (resolve_character_operator): Likewise.
880 (resolve_assoc_var): Likewise.
881 (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
882 (resolve_charlen): Use mpz_sgn to determine sign.
883 * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
884 instead of long.
885 * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
886 * target-memory.c (size_character): Length argument of type
887 gfc_charlen_t.
888 (gfc_encode_character): Likewise.
889 (gfc_interpret_character): Use gfc_charlen_t.
890 * target-memory.h (gfc_encode_character): Modify prototype.
891 * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
892 (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
893 (trans_array_constructor): Use existing type.
894 (get_array_charlen): Likewise.
895 * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
896 * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
897 * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
898 (add_argument_checking): Likewise.
899 * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
900 gfc_charlen_type_node.
901 (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
902 4, fold_convert to correct type.
903 (gfc_conv_class_to_class): Build const of type size_type_node for
904 size.
905 (gfc_copy_class_to_class): Likewise.
906 (gfc_conv_string_length): Use same type in expression.
907 (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
908 (gfc_conv_string_tmp): Make sure len is of the right type.
909 (gfc_conv_concat_op): Use same type in expression.
910 (gfc_conv_procedure_call): Likewise.
911 (fill_with_spaces): Comment out memset() block due to spurious
912 -Wstringop-overflow warnings.
913 (gfc_trans_string_copy): Use gfc_charlen_type_node.
914 (alloc_scalar_allocatable_for_subcomponent_assignment):
915 fold_convert to right type.
916 (gfc_trans_subcomponent_assign): Likewise.
917 (trans_class_vptr_len_assignment): Build const of correct type.
918 (gfc_trans_pointer_assignment): Likewise.
919 (alloc_scalar_allocatable_for_assignment): fold_convert to right
920 type in expr.
921 (trans_class_assignment): Build const of correct type.
922 * trans-intrinsic.c (gfc_conv_associated): Likewise.
923 (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
924 * trans-io.c (gfc_build_io_library_fndecls): Use
925 gfc_charlen_type_node for character lengths.
926 (set_string): Convert to right type in assignment.
927 * trans-stmt.c (gfc_trans_label_assign): Build const of
928 gfc_charlen_type_node.
929 (trans_associate_var): Likewise.
930 (gfc_trans_character_select): Likewise.
931 (gfc_trans_allocate): Likewise, don't typecast strlen result.
932 (gfc_trans_deallocate): Don't typecast strlen result.
933 * trans-types.c (gfc_size_kind): New variable.
934 (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
935 from size_type_node.
936 * trans-types.h: Fix comment.
937
938 2018-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
939
940 PR fortran/83683
941 PR fortran/45689
942 * check.c (gfc_check_eoshift): Check for string length and
943 for conformance of boundary.
944 * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
945 * intrinsic.h: Add prototype for gfc_simplify_eoshift.
946 * simplify.c (gfc_simplify_eoshift): New function.
947
948 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
949 Alan Hayward <alan.hayward@arm.com>
950 David Sherwood <david.sherwood@arm.com>
951
952 * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
953
954 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
955 Alan Hayward <alan.hayward@arm.com>
956 David Sherwood <david.sherwood@arm.com>
957
958 * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
959
960 2018-01-03 Thomas Koenig <tkoenig@gcc.gnu.org>
961
962 PR fortran/83664
963 * check.c (gfc_check_eoshift): Error for missing boundary if array
964 is not one of the standard types.
965
966 2018-01-03 Jakub Jelinek <jakub@redhat.com>
967
968 Update copyright years.
969
970 * gfortranspec.c (lang_specific_driver): Update copyright notice
971 dates.
972 * gfc-internals.texi: Bump @copying's copyright year.
973 * gfortran.texi: Ditto.
974 * intrinsic.texi: Ditto.
975 * invoke.texi: Ditto.
976
977 2017-01-02 Thomas Koenig <tkoenig@gcc.gnu.org>
978
979 PR fortran/45689
980 * intrinsic.c (add_function): Add gfc_simplify_maxloc and
981 gfc_simplify_minloc to maxloc and minloc, respectively.
982 * intrinsic.h: Add prototypes for gfc_simplify_minloc
983 and gfc_simplify_maxloc.
984 * simplify.c (min_max_chose): Adjust prototype. Modify function
985 to have a return value which indicates if the extremum was found.
986 (is_constant_array_expr): Fix typo in comment.
987 (simplify_minmaxloc_to_scalar): New function.
988 (simplify_minmaxloc_nodim): New function.
989 (new_array): New function.
990 (simplify_minmaxloc_to_array): New function.
991 (gfc_simplify_minmaxloc): New function.
992 (simplify_minloc): New function.
993 (simplify_maxloc): New function.
994
995 2018-01-02 Thomas Koenig <tkoenig@gcc.gnu.org>
996
997 PR fortran/45689
998 PR fortran/83650
999 * simplify.c (gfc_simplify_cshift): Re-implement to allow full
1000 range of arguments.
1001
1002 2018-01-01 Paul Thomas <pault@gcc.gnu.org>
1003
1004 PR fortran/83076
1005 * resolve.c (resolve_fl_derived0): Add caf_token fields for
1006 allocatable and pointer scalars, when -fcoarray selected.
1007 * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
1008 field as well as the backend_decl.
1009 (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
1010 derived types that are not vtypes. Components with caf_token
1011 attribute are pvoid types. For a component requiring it, find
1012 the caf_token field and have the component token field point to
1013 its backend_decl.
1014
1015 PR fortran/83319
1016 *trans-types.c (gfc_get_array_descriptor_base): Add the token
1017 field to the descriptor even when codimen not set.
1018 \f
1019 Copyright (C) 2018 Free Software Foundation, Inc.
1020
1021 Copying and distribution of this file, with or without modification,
1022 are permitted in any medium without royalty provided the copyright
1023 notice and this notice are preserved.