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