re PR fortran/62245 (gfortran miscompiles int() on mips)
[platform/upstream/gcc.git] / gcc / fortran / ChangeLog
1 2014-09-05  Joost VandeVondele  <vondele@gcc.gnu.org>
2
3         PR fortran/62245
4         * intrinsic.texi (INT): clarify result.
5
6 2014-09-03  Fritz Reese  <Reese-Fritz@zai.com>
7
8         PR fortran/62174
9         * decl.c (variable_decl): Don't overwrite typespecs of Cray pointees
10         when matching a component declaration.
11
12 2014-09-02  Marek Polacek  <polacek@redhat.com>
13
14         PR fortran/62270
15         * interface.c (compare_parameter): Fix condition.
16         * trans-expr.c (gfc_conv_procedure_call): Likewise.
17
18 2014-08-31  Fritz Reese  <Reese-Fritz@zai.com>
19
20         PR fortran/62309
21         * resolve.c (apply_default_init_local): Don't treat variables
22         in RECURSIVE procedures as saved.
23
24 2014-08-31  Tobias Burnus  <burnus@net-b.de>
25
26         * trans-decl.c (gfc_build_builtin_function_decls): Add
27         may_require_tmp dummy argument.
28         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get,
29         conv_caf_send): Handle may_require_tmp argument.
30         (gfc_conv_intrinsic_function): Update call.
31         * gfortran.texi (_gfortran_caf_send, _gfortran_caf_get,
32         _gfortran_caf_sendget): Update interface description.
33
34 2014-08-30  Tobias Burnus  <burnus@net-b.de>
35
36         * trans.h (gfc_caf_get_image_index,
37         gfc_get_caf_token_offset): New prototypes.
38         * trans-expr.c (gfc_caf_get_image_index): Moved from
39         trans-intrinsic.c and renamed.
40         (gfc_get_caf_token_offset) Ditto; support offset = NULL
41         with early return.
42         * trans-intrinsic.c (get_caf_token_offset, caf_get_image_index):
43         Moved to trans-expr.
44         (gfc_conv_intrinsic_caf_get, conv_caf_send,
45         conv_intrinsic_atomic_op, conv_intrinsic_atomic_ref,
46         conv_intrinsic_atomic_cas): Update callers.
47
48 2014-08-30  Tobias Burnus  <burnus@net-b.de>
49
50         PR fortran/62278
51         PR fortran/44735
52         PR fortran/60593
53         * dependency.c (gfc_check_dependency): Allow for optimizations
54         in the pointer-alias check.
55
56 2014-08-30  Janne Blomqvist  <jb@gcc.gnu.org>
57
58         * module.c (gfc_dump_module): Use ISO C remove() instead of POSIX
59         unlink().
60
61 2014-08-29  Jeffrey Armstrong  <jeffrey.armstrong@approximatrix.com>
62
63         PR fortran/62215
64         * module.c (gfc_dump_module): Unlink old module file before
65         renaming new one.
66
67 2014-08-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
68
69         * frontend_passes (expr_array):  Replace by vec template.
70         (expr_size):  Remove.
71         (expr_count):  Remove.
72         (doloop_list):  Replace by vec template.
73         (doloop_size):  Remove.
74         (gfc_run_passes):  Adjust to use of vec template.
75         (cfe_register_funcs):  Likewise.
76         (cfe_expr_0):  Likewise.
77         (doloop_code):  Likewise.
78
79 2014-08-22  Steven Bosscher  <steven@gcc.gnu.org>
80
81         PR fortran/62135
82         * resolve.c (resolve_select): Fix list traversal in case the
83         last element of the CASE list was dropped as unreachable code.
84
85 2014-08-22  Joost VandeVondele  <Joost.VandeVondele@mat.ethz.ch>
86
87         PR fortran/61234
88         * lang.opt (Wuse-without-only): New flag.
89         * gfortran.h (gfc_option_t): Add it.
90         * invoke.texi: Document it.
91         * module.c (gfc_use_module): Warn if needed.
92         * options.c (gfc_init_options,gfc_handle_option): Init accordingly.
93
94 2014-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
95
96         PR fortran/62214
97         * frontend-passes.c (optimize_binop_array_assignment):
98         Do not try to optimize the array assignment for string
99         concatenation.
100
101 2014-08-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
102
103         PR fortran/44054
104         * error.c (gfc_diagnostic_build_locus_prefix): New function.
105         (gfc_diagnostic_starter): Follow Fortran FE diagnostics.
106         (gfc_diagnostic_finalizer): Do not call default finalizer.
107
108 2014-08-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
109
110         PR fortran/44054
111         * error.c (gfc_diagnostic_finalizer): Call default finalizer.
112
113 2014-08-20  Joost VandeVondele  <Joost.VandeVondele@mat.ethz.ch>
114
115         * options.c (gfc_init_options_struct): assert that the frontend sets
116         flag_errno_math and flag_associative_math.
117
118 2014-08-17  Tobias Burnus  <burnus@net-b.de>
119
120         * resolve.c (gfc_resolve_finalizers): Ensure that parents are
121         resolved first.
122
123 2014-08-17  Tobias Burnus  <burnus@net-b.de>
124
125         * trans-io.c (gfc_build_io_library_fndecls): Fix decl of
126         IOCALL_SET_NML_VAL.
127         (transfer_namelist_element): Use proper int type as argument.
128
129 2014-08-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
130
131         PR fortran/62142
132         * trans-expr.c (is_runtime_conformable):  Add NULL pointer checks.
133
134 2014-08-15  Tobias Burnus  <burnus@net-b.de>
135
136         * resolve.c (resolve_critical): Fix name mangling.
137         * trans-stmt.c (gfc_trans_critical): Fix lock call.
138
139 2014-08-15  Manuel López-Ibáñez  <manu@gcc.gnu.org>
140
141         PR fortran/44054
142         * gfortran.h: Define GCC_DIAG_STYLE.
143         (gfc_diagnostics_init,gfc_warning_cmdline): Declare.
144         * trans-array.c: Include gfortran.h before diagnostic-core.h.
145         * trans-expr.c: Likewise.
146         * trans-openmp.c: Likewise.
147         * trans-const.c: Likewise.
148         * trans.c: Likewise.
149         * trans-types.c: Likewise.
150         * f95-lang.c: Likewise.
151         * trans-decl.c: Likewise.
152         * trans-io.c: Likewise.
153         * trans-intrinsic.c: Likewise.
154         * error.c: Include diagnostic.h and diagnostic-color.h.
155         (gfc_diagnostic_build_prefix): New.
156         (gfc_diagnostic_starter): New.
157         (gfc_diagnostic_finalizer): New.
158         (gfc_warning_cmdline): New.
159         (gfc_diagnostics_init): New.
160         * gfc-diagnostic.def: New.
161         * options.c (gfc_init_options): Call gfc_diagnostics_init.
162         (gfc_post_options): Use gfc_warning_cmdline.
163
164 2014-08-15  Jakub Jelinek  <jakub@redhat.com>
165             Tobias Burnus  <burnus@net-b.de>
166
167         PR fortran/62131
168         * openmp.c (resolve_omp_atomic): Only complain if code->expr1's attr
169         is allocatable, rather than whenever var->attr.allocatable.
170
171 2014-08-15  Jakub Jelinek  <jakub@redhat.com>
172
173         PR fortran/62107
174         * trans-openmp.c (gfc_omp_finish_clause): Handle scalar pointer
175         or allocatable passed by reference.
176         (gfc_trans_omp_clauses) <case OMP_LIST_MAP>: Likewise.
177
178 2014-08-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
179
180         PR fortran/62106
181         * gfortran.h (symbol_attribute):  Add fe_temp flag.
182         * frontend-passes.c (is_fe_temp):  New function.
183         (create_var):  Don't add a temporary for an already
184         created variable or for a constant.
185         (combine_ARRAY_constructor):  Remove special handling
186         for constants.
187
188 2014-08-14  Tobias Burnus  <burnus@net-b.de>
189
190         * gfortran.texi (caf_register_t): Add CAF_REGTYPE_CRITICAL.
191         (_gfortran_caf_register): Update for locking/critical.
192         (_gfortran_caf_lock, _gfortran_caf_unlock): Add.
193         * resolve.c (resolve_critical): New.
194         (gfc_resolve_code): Call it.
195         * trans-decl.c (gfor_fndecl_caf_critical,
196         gfor_fndecl_caf_end_critical): Remove.
197         (gfor_fndecl_caf_lock, gfor_fndecl_caf_unlock): Add.
198         (gfc_build_builtin_function_decls): Remove critical,
199         assign locking declarations.
200         (generate_coarray_sym_init): Handle locking and
201         critical variables.
202         * trans-stmt.c (gfc_trans_critical): Add calls to
203         lock/unlock libcaf functions.
204         * trans.h (gfc_coarray_type): Update locking, add
205         critical enum values.
206         (gfor_fndecl_caf_critical, gfor_fndecl_caf_end_critical): Remove.
207         (gfor_fndecl_caf_lock, gfor_fndecl_caf_unlock): Add.
208
209 2014-08-14  Tobias Burnus  <burnus@net-b.de>
210
211         * gfortran.texi (Coarray Programming): Add first ABI
212         documentation.
213
214 2014-08-14  Jakub Jelinek  <jakub@redhat.com>
215
216         PR fortran/62076
217         * openmp.c (gfc_match_omp_clauses): When failed to match
218         operator name, defined op name or name, set buffer to
219         empty string.  Don't call gfc_find_omp_udr if buffer is empty
220         string.
221         (gfc_match_omp_declare_reduction): Call gfc_undo_symbols ()
222         before calling gfc_free_omp_udr.
223
224 2014-08-11  Richard Biener  <rguenther@suse.de>
225
226         PR fortran/61950
227         * trans-expr.c (gfc_conv_structure): Initialize _size with
228         a value of proper type.
229
230 2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
231
232         PR fortran/61999
233         * simplify.c (gfc_simplify_dot_product): Convert types of
234         vectors before calculating the result.
235
236 2014-08-02  Trevor Saunders  <tsaunders@mozilla.com>
237
238         * openmp.c, trans-decl.c: Use hash_set instead of pointer_set.
239
240 2014-07-26  Tobias Burnus  <burnus@net-b.de>
241
242         PR fortran/61881
243         PR fortran/61888
244         PR fortran/57305
245         * intrinsic.texi (SIZEOF): Document changed behavior
246         for polymorphic arrays.
247
248 2014-07-26  Tobias Burnus  <burnus@net-b.de>
249
250         PR fortran/61881
251         PR fortran/61888
252         PR fortran/57305
253         * check.c (gfc_check_sizeof): Permit for assumed type if and
254         only if it has an array descriptor.
255         * intrinsic.c (do_ts29113_check): Permit SIZEOF.
256         (add_functions): SIZEOF is an Inquiry function.
257         * intrinsic.texi (SIZEOF): Add note that only contiguous
258         arrays are permitted.
259         * trans-expr.c (gfc_conv_intrinsic_to_class): Handle assumed
260         rank.
261         * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Handle
262         assumed type + array descriptor, CLASS and assumed rank.
263         (gfc_conv_intrinsic_storage_size): Handle class arrays.
264
265 2014-07-25  Tobias Burnus  <burnus@net-b.de>
266
267         * simplify.c (gfc_simplify_storage_size): Use proper
268         integer kind for the returned value.
269
270 2014-07-24  Uros Bizjak  <ubizjak@gmail.com>
271
272         * intrinsic.texi (Intrinsic Procedures) <ATOMIC_DEFINE>: Move to
273         correct menu position to match sectioning.
274
275 2014-06-15  Tobias Burnus  <burnus@net-b.de>
276
277         * symbol.c (check_conflict): Add codimension conflict with
278         pointer; fix cray-pointee check.
279
280 2014-06-14  Tobias Burnus  <burnus@net-b.de>
281
282         * trans-intrinsic.c (conv_intrinsic_atomic_ref): Fix handling
283         for kind mismatch with -fcoarray=lib.
284
285 2014-07-12  Paul Thomas  <pault@gcc.gnu.org>
286
287         PR fortran/61780
288         * dependency.c (gfc_dep_resolver): Index the 'reverse' array so
289         that elements are skipped. This then correctly aligns 'reverse'
290         with the scalarizer loops.
291
292 2014-07-12  Tobias Burnus  <burnus@net-b.de>
293
294         PR fortran/61628
295         * trans-types.c (gfc_init_types): Fix data-type bug
296         with gfc_max_array_element_size.
297
298 2014-07-12  Tobias Burnus  <burnus@net-b.de>
299
300         * libgfortran.h (libcaf_atomic_codes): Add.
301         * trans-decl.c (gfor_fndecl_caf_atomic_def,
302         gfor_fndecl_caf_atomic_ref, gfor_fndecl_caf_atomic_cas,
303         gfor_fndecl_caf_atomic_op): New variables.
304         (gfc_build_builtin_function_decls): Initialize them.
305         * trans.h (gfor_fndecl_caf_atomic_def,
306         gfor_fndecl_caf_atomic_ref, gfor_fndecl_caf_atomic_cas,
307         gfor_fndecl_caf_atomic_op): New variables.
308         * trans-intrinsic.c (conv_intrinsic_atomic_op,
309         conv_intrinsic_atomic_ref, conv_intrinsic_atomic_cas):
310         Add library calls with -fcoarray=lib.
311
312 2014-07-12  Tobias Burnus  <burnus@net-b.de>
313
314         * check.c (gfc_check_atomic): Update for STAT=.
315         (gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
316         (gfc_check_atomic_op, gfc_check_atomic_cas,
317         gfc_check_atomic_fetch_op): New.
318         * gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS, GFC_ISYM_ATOMIC_ADD,
319         GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
320         GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
321         GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
322         * intrinsic.c (add_subroutines): Handle them.
323         * intrinsic.texi: Add documentation for them.
324         (ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
325         (ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
326         * intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
327         gfc_check_atomic_fetch_op): New
328         prototypes.
329         * libgfortran.h (libgfortran_stat_codes): Add GFC_STAT_FAILED_IMAGE.
330         * iso-fortran-env.def: Add it.
331         * trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
332         conv_intrinsic_atomic_ref; handle more atomics.
333         (conv_intrinsic_atomic_def): Handle STAT=.
334         (conv_intrinsic_atomic_cas): New.
335         (gfc_conv_intrinsic_subroutine): Handle new atomics.
336
337 2014-07-09  Bernd Schmidt  <bernds@codesourcery.com>
338
339         * trans-array.c (gfc_build_constant_array_constructor): Build a
340         static decl manually.
341         * trans-decl.c (create_main_function): Likewise.
342
343 2014-07-07  Paul Thomas  <pault@gcc.gnu.org>
344
345         PR fortran/61459
346         PR fortran/58883
347         * trans-expr.c (fcncall_realloc_result): Use the natural type
348         for the address expression of 'res_desc'.
349
350 2014-07-07  Gerald Pfeifer  <gerald@pfeifer.com>
351
352         * gfortran.texi (Fortran 2003 status): Fix grammar.
353
354 2014-07-04  Tobias Burnus  <burnus@net-b.de>
355
356         * resolve.c (resolve_assoc_var): Fix corank setting.
357         * trans-array.c (gfc_conv_descriptor_token): Change assert.
358         for select-type temporaries.
359         * trans-decl.c (generate_coarray_sym_init): Skip for
360         attr.select_type_temporary.
361         * trans-expr.c (gfc_conv_procedure_call): Fix for
362         select-type temporaries.
363         * trans-intrinsic.c (get_caf_token_offset): Ditto.
364         (gfc_conv_intrinsic_caf_get, gfc_conv_intrinsic_caf_send): Set
365         the correct dtype.
366         * trans-types.h (gfc_get_dtype_rank_type): New.
367         * trans-types.c (gfc_get_dtype_rank_type): Ditto.
368
369 2014-07-03  Tobias Burnus  <burnus@net-b.de>
370
371         * scanner.c (skip_free_comments): Fix indentation.
372
373 2014-07-02  Jakub Jelinek  <jakub@redhat.com>
374             Fritz Reese  <Reese-Fritz@zai.com>
375
376         * decl.c (variable_decl): Reject old style initialization
377         for derived type components.
378
379 2014-06-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
380
381         PR fortran/36275
382         PR fortran/38839
383         * decl.c (check_bind_name_identifier): New function.
384         (gfc_match_bind_c): Match any constant expression as binding
385         label.
386         * match.c (gfc_match_name_C): Remove.
387
388 2014-06-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
389
390         PR fortran/29383
391         * gfortran.h (gfc_simplify_ieee_selected_real_kind): New prototype.
392         * libgfortran.h (GFC_FPE_*): Use simple integer values, valid in
393         both C and Fortran.
394         * expr.c (gfc_check_init_expr): Simplify IEEE_SELECTED_REAL_KIND.
395         * simplify.c (gfc_simplify_ieee_selected_real_kind): New function.
396         * module.c (mio_symbol): Keep track of symbols which came from
397         intrinsic modules.
398         (gfc_use_module): Keep track of the IEEE modules.
399         * trans-decl.c (gfc_get_symbol_decl): Adjust code since
400         we have new intrinsic modules.
401         (gfc_build_builtin_function_decls): Build decls for
402         ieee_procedure_entry and ieee_procedure_exit.
403         (is_from_ieee_module, is_ieee_module_used, save_fp_state,
404         restore_fp_state): New functions.
405         (gfc_generate_function_code): Save and restore floating-point
406         state on procedure entry/exit, when IEEE modules are used.
407         * intrinsic.texi: Document the IEEE modules.
408
409 2014-06-25  Tobias Burnus  <burnus@net-b.de>
410
411         * interface.c (check_intents): Fix diagnostic with
412         coindexed coarrays.
413
414 2014-06-25  Tobias Burnus  <burnus@net-b.de>
415
416         * resolve.c (resolve_ordinary_assign): Don't invoke caf_send
417         when assigning a coindexed RHS scalar to a noncoindexed LHS
418         array.
419         * trans-intrinsic.c (conv_caf_send): Do numeric type conversion
420         for a noncoindexed scalar RHS.
421
422 2014-06-25  Tobias Burnus  <burnus@net-b.de>
423
424         * check.c (check_co_minmaxsum): Add definable check.
425         * expr.c (gfc_check_vardef_context): Fix context == NULL case.
426         * trans-expr.c (get_scalar_to_descriptor_type): Handle pointer
427         arguments.
428         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Fix generation of
429         temporary strings.
430
431 2014-06-25  Jakub Jelinek  <jakub@redhat.com>
432
433         * trans.h (gfc_omp_clause_linear_ctor): New prototype.
434         * trans-openmp.c (gfc_omp_linear_clause_add_loop,
435         gfc_omp_clause_linear_ctor): New functions.
436         (gfc_trans_omp_clauses): Make sure OMP_CLAUSE_LINEAR_STEP has
437         correct type.  Set OMP_CLAUSE_LINEAR_ARRAY flag if needed.
438         * f95-lang.c (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Redefine.
439
440 2014-06-24  Jakub Jelinek  <jakub@redhat.com>
441
442         * dump-parse-tree.c (show_omp_namelist): Use n->udr->udr instead
443         of n->udr.
444         * f95-lang.c (gfc_init_builtin_functions): Initialize
445         BUILT_IN_ASSUME_ALIGNED.
446         * gfortran.h (gfc_omp_namelist): Change udr field type to
447         struct gfc_omp_namelist_udr.
448         (gfc_omp_namelist_udr): New type.
449         (gfc_get_omp_namelist_udr): Define.
450         (gfc_resolve_code): New prototype.
451         * match.c (gfc_free_omp_namelist): Free name->udr.
452         * module.c (intrinsics): Add INTRINSIC_USER.
453         (fix_mio_expr): Likewise.
454         (mio_expr): Handle INSTRINSIC_USER and non-resolved EXPR_FUNCTION.
455         * openmp.c (gfc_match_omp_clauses): Adjust initialization of n->udr.
456         (gfc_match_omp_declare_reduction): Treat len=: the same as len=*.
457         Set attr.flavor on omp_{out,in,priv,orig} artificial variables.
458         (struct resolve_omp_udr_callback_data): New type.
459         (resolve_omp_udr_callback, resolve_omp_udr_callback2,
460         resolve_omp_udr_clause): New functions.
461         (resolve_omp_clauses): Adjust for n->udr changes, resolve UDR clauses
462         here.
463         (omp_udr_callback): Don't check for implicitly declared functions
464         here.
465         (gfc_resolve_omp_udr): Don't call gfc_resolve.  Don't check for
466         implicitly declared subroutines here.
467         * resolve.c (resolve_function): If value.function.isym is non-NULL,
468         consider it already resolved.
469         (resolve_code): Renamed to ...
470         (gfc_resolve_code): ... this.  No longer static.
471         (gfc_resolve_blocks, generate_component_assignments, resolve_codes):
472         Adjust callers.
473         * trans-openmp.c (gfc_omp_privatize_by_reference): Don't privatize
474         by reference type (C_PTR) variables.
475         (gfc_omp_finish_clause): Make sure OMP_CLAUSE_SIZE is non-NULL.
476         (gfc_trans_omp_udr_expr): Remove.
477         (gfc_trans_omp_array_reduction_or_udr): Adjust for n->udr changes.
478         Don't call gfc_trans_omp_udr_expr, even for sym->attr.dimension
479         expand it as assignment or subroutine call.  Don't initialize
480         value.function.isym.
481
482 2014-06-23  Tobias Burnus  <burnus@net-b.de>
483
484         * trans-decl.c (gfc_trans_deferred_vars): Fix handling of
485         explicit-size arrays with -fcoarray=lib.
486
487 2014-06-20  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
488
489         PR fortran/33363
490         * invoke.texi: Don't mention nonexisting -fcase-lower option.
491
492 2014-06-19  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
493
494         PR fortran/61454
495         * expr.c (scalarize_intrinsic_call): Take care of optional
496         arguments.
497
498 2014-06-19  Tobias Burnus  <burnus@net-b.de>
499
500         * trans-intrinsic.c (conv_co_minmaxsum): Fix argument
501         passing.
502
503 2014-06-18  Tobias Burnus  <burnus@net-b.de>
504
505         * gfortran.texi (OpenMP): Update refs to OpenMP 4.0.
506         * intrinsic.texi (OpenMP Modules): Ditto.
507
508 2014-06-18  Jakub Jelinek  <jakub@redhat.com>
509
510         * cpp.c (cpp_define_builtins): Change _OPENMP macro to
511         201307.
512         * dump-parse-tree.c (show_omp_namelist): Add list_type
513         argument.  Adjust for rop being u.reduction_op now,
514         handle depend_op or map_op.
515         (show_omp_node): Adjust callers.  Print some new
516         OpenMP 4.0 clauses, adjust for OMP_LIST_DEPEND_{IN,OUT}
517         becoming a single OMP_LIST_DEPEND.
518         * f95-lang.c (gfc_handle_omp_declare_target_attribute): New
519         function.
520         (gfc_attribute_table): New variable.
521         (LANG_HOOKS_OMP_FINISH_CLAUSE, LANG_HOOKS_ATTRIBUTE_TABLE): Redefine.
522         * frontend-passes.c (gfc_code_walker): Handle new OpenMP target
523         EXEC_OMP_* codes and new clauses.
524         * gfortran.h (gfc_statement): Add ST_OMP_TARGET, ST_OMP_END_TARGET,
525         ST_OMP_TARGET_DATA, ST_OMP_END_TARGET_DATA, ST_OMP_TARGET_UPDATE,
526         ST_OMP_DECLARE_TARGET, ST_OMP_TEAMS, ST_OMP_END_TEAMS,
527         ST_OMP_DISTRIBUTE, ST_OMP_END_DISTRIBUTE, ST_OMP_DISTRIBUTE_SIMD,
528         ST_OMP_END_DISTRIBUTE_SIMD, ST_OMP_DISTRIBUTE_PARALLEL_DO,
529         ST_OMP_END_DISTRIBUTE_PARALLEL_DO, ST_OMP_DISTRIBUTE_PARALLEL_DO_SIMD,
530         ST_OMP_END_DISTRIBUTE_PARALLEL_DO_SIMD, ST_OMP_TARGET_TEAMS,
531         ST_OMP_END_TARGET_TEAMS, ST_OMP_TEAMS_DISTRIBUTE,
532         ST_OMP_END_TEAMS_DISTRIBUTE, ST_OMP_TEAMS_DISTRIBUTE_SIMD,
533         ST_OMP_END_TEAMS_DISTRIBUTE_SIMD, ST_OMP_TARGET_TEAMS_DISTRIBUTE,
534         ST_OMP_END_TARGET_TEAMS_DISTRIBUTE,
535         ST_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD,
536         ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_SIMD,
537         ST_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO,
538         ST_OMP_END_TEAMS_DISTRIBUTE_PARALLEL_DO,
539         ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO,
540         ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO,
541         ST_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
542         ST_OMP_END_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
543         ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD and
544         ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD.
545         (symbol_attribute): Add omp_declare_target field.
546         (gfc_omp_depend_op, gfc_omp_map_op): New enums.
547         (gfc_omp_namelist): Replace rop field with union
548         containing reduction_op, depend_op and map_op.
549         (OMP_LIST_DEPEND_IN, OMP_LIST_DEPEND_OUT): Remove.
550         (OMP_LIST_DEPEND, OMP_LIST_MAP, OMP_LIST_TO, OMP_LIST_FROM): New.
551         (gfc_omp_clauses): Add num_teams, device, thread_limit,
552         dist_sched_kind, dist_chunk_size fields.
553         (gfc_common_head): Add omp_declare_target field.
554         (gfc_exec_op): Add EXEC_OMP_TARGET, EXEC_OMP_TARGET_DATA,
555         EXEC_OMP_TEAMS, EXEC_OMP_DISTRIBUTE, EXEC_OMP_DISTRIBUTE_SIMD,
556         EXEC_OMP_DISTRIBUTE_PARALLEL_DO, EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD,
557         EXEC_OMP_TARGET_TEAMS, EXEC_OMP_TEAMS_DISTRIBUTE,
558         EXEC_OMP_TEAMS_DISTRIBUTE_SIMD, EXEC_OMP_TARGET_TEAMS_DISTRIBUTE,
559         EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD,
560         EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO,
561         EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO,
562         EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
563         EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD and
564         EXEC_OMP_TARGET_UPDATE.
565         (gfc_add_omp_declare_target): New prototype.
566         * match.h (gfc_match_omp_declare_target, gfc_match_omp_distribute,
567         gfc_match_omp_distribute_parallel_do,
568         gfc_match_omp_distribute_parallel_do_simd,
569         gfc_match_omp_distribute_simd, gfc_match_omp_target,
570         gfc_match_omp_target_data, gfc_match_omp_target_teams,
571         gfc_match_omp_target_teams_distribute,
572         gfc_match_omp_target_teams_distribute_parallel_do,
573         gfc_match_omp_target_teams_distribute_parallel_do_simd,
574         gfc_match_omp_target_teams_distribute_simd,
575         gfc_match_omp_target_update, gfc_match_omp_teams,
576         gfc_match_omp_teams_distribute,
577         gfc_match_omp_teams_distribute_parallel_do,
578         gfc_match_omp_teams_distribute_parallel_do_simd,
579         gfc_match_omp_teams_distribute_simd): New prototypes.
580         * module.c (ab_attribute): Add AB_OMP_DECLARE_TARGET.
581         (attr_bits): Likewise.
582         (mio_symbol_attribute): Handle omp_declare_target attribute.
583         (gfc_free_omp_clauses): Free num_teams, device, thread_limit
584         and dist_chunk_size expressions.
585         (OMP_CLAUSE_PRIVATE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE,
586         OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_COPYIN,
587         OMP_CLAUSE_REDUCTION, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS,
588         OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_ORDERED,
589         OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL,
590         OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND,
591         OMP_CLAUSE_INBRANCH, OMP_CLAUSE_LINEAR, OMP_CLAUSE_NOTINBRANCH,
592         OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SIMDLEN,
593         OMP_CLAUSE_UNIFORM): Use 1U instead of 1.
594         (OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP, OMP_CLAUSE_TO, OMP_CLAUSE_FROM,
595         OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_THREAD_LIMIT,
596         OMP_CLAUSE_DIST_SCHEDULE): Define.
597         (gfc_match_omp_clauses): Change mask parameter to unsigned int.
598         Adjust for rop becoming u.reduction_op.  Disallow inbranch with
599         notinbranch.  For depend clause, always create OMP_LIST_DEPEND
600         and fill in u.depend_op.  Handle num_teams, device, map,
601         to, from, thread_limit and dist_schedule clauses.
602         (OMP_DECLARE_SIMD_CLAUSES): Or in OMP_CLAUSE_INBRANCH and
603         OMP_CLAUSE_NOTINBRANCH.
604         (OMP_TARGET_CLAUSES, OMP_TARGET_DATA_CLAUSES,
605         OMP_TARGET_UPDATE_CLAUSES, OMP_TEAMS_CLAUSES,
606         OMP_DISTRIBUTE_CLAUSES): Define.
607         (match_omp): New function.
608         (gfc_match_omp_do, gfc_match_omp_do_simd, gfc_match_omp_parallel,
609         gfc_match_omp_parallel_do, gfc_match_omp_parallel_do_simd,
610         gfc_match_omp_parallel_sections, gfc_match_omp_parallel_workshare,
611         gfc_match_omp_sections, gfc_match_omp_simd, gfc_match_omp_single,
612         gfc_match_omp_task): Rewritten using match_omp.
613         (gfc_match_omp_threadprivate, gfc_match_omp_declare_reduction):
614         Diagnose if the directives are followed by unexpected junk.
615         (gfc_match_omp_distribute, gfc_match_omp_distribute_parallel_do,
616         gfc_match_omp_distribute_parallel_do_simd,
617         gfc_match_omp_distrbute_simd, gfc_match_omp_declare_target,
618         gfc_match_omp_target, gfc_match_omp_target_data,
619         gfc_match_omp_target_teams, gfc_match_omp_target_teams_distribute,
620         gfc_match_omp_target_teams_distribute_parallel_do,
621         gfc_match_omp_target_teams_distribute_parallel_do_simd,
622         gfc_match_omp_target_teams_distrbute_simd, gfc_match_omp_target_update,
623         gfc_match_omp_teams, gfc_match_omp_teams_distribute,
624         gfc_match_omp_teams_distribute_parallel_do,
625         gfc_match_omp_teams_distribute_parallel_do_simd,
626         gfc_match_omp_teams_distrbute_simd): New functions.
627         * openmp.c (resolve_omp_clauses): Adjust for
628         OMP_LIST_DEPEND_{IN,OUT} being changed to OMP_LIST_DEPEND.  Handle
629         OMP_LIST_MAP, OMP_LIST_FROM, OMP_LIST_TO, num_teams, device,
630         dist_chunk_size and thread_limit.
631         (gfc_resolve_omp_parallel_blocks): Only put sharing clauses into
632         ctx.sharing_clauses.  Call gfc_resolve_omp_do_blocks for various
633         new EXEC_OMP_* codes.
634         (resolve_omp_do): Handle various new EXEC_OMP_* codes.
635         (gfc_resolve_omp_directive): Likewise.
636         (gfc_resolve_omp_declare_simd): Add missing space to diagnostics.
637         * parse.c (decode_omp_directive): Handle parsing of OpenMP 4.0
638         offloading related directives.
639         (case_executable): Add ST_OMP_TARGET_UPDATE.
640         (case_exec_markers): Add ST_OMP_TARGET*, ST_OMP_TEAMS*,
641         ST_OMP_DISTRIBUTE*.
642         (case_decl): Add ST_OMP_DECLARE_TARGET.
643         (gfc_ascii_statement): Handle new ST_OMP_* codes.
644         (parse_omp_do): Handle various new ST_OMP_* codes.
645         (parse_executable): Likewise.
646         * resolve.c (gfc_resolve_blocks): Handle various new EXEC_OMP_*
647         codes.
648         (resolve_code): Likewise.
649         (resolve_symbol): Change that !$OMP DECLARE TARGET variables
650         are saved.
651         * st.c (gfc_free_statement): Handle various new EXEC_OMP_* codes.
652         * symbol.c (check_conflict): Check omp_declare_target conflicts.
653         (gfc_add_omp_declare_target): New function.
654         (gfc_copy_attr): Copy omp_declare_target.
655         * trans.c (trans_code): Handle various new EXEC_OMP_* codes.
656         * trans-common.c (build_common_decl): Add "omp declare target"
657         attribute if needed.
658         * trans-decl.c (add_attributes_to_decl): Likewise.
659         * trans.h (gfc_omp_finish_clause): New prototype.
660         * trans-openmp.c (gfc_omp_finish_clause): New function.
661         (gfc_trans_omp_reduction_list): Adjust for rop being renamed
662         to u.reduction_op.
663         (gfc_trans_omp_clauses): Adjust for OMP_LIST_DEPEND_{IN,OUT}
664         change to OMP_LIST_DEPEND and fix up depend handling.
665         Handle OMP_LIST_MAP, OMP_LIST_TO, OMP_LIST_FROM, num_teams,
666         thread_limit, device, dist_chunk_size and dist_sched_kind.
667         (gfc_trans_omp_do): Handle EXEC_OMP_DISTRIBUTE.
668         (GFC_OMP_SPLIT_DISTRIBUTE, GFC_OMP_SPLIT_TEAMS,
669         GFC_OMP_SPLIT_TARGET, GFC_OMP_SPLIT_NUM, GFC_OMP_MASK_DISTRIBUTE,
670         GFC_OMP_MASK_TEAMS, GFC_OMP_MASK_TARGET, GFC_OMP_MASK_NUM): New.
671         (gfc_split_omp_clauses): Handle splitting of clauses for new
672         EXEC_OMP_* codes.
673         (gfc_trans_omp_do_simd): Add pblock argument, adjust for being
674         callable for combined constructs.
675         (gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_do_simd): Likewise.
676         (gfc_trans_omp_distribute, gfc_trans_omp_teams,
677         gfc_trans_omp_target, gfc_trans_omp_target_data,
678         gfc_trans_omp_target_update): New functions.
679         (gfc_trans_omp_directive): Adjust gfc_trans_omp_* callers, handle
680         new EXEC_OMP_* codes.
681
682 2014-06-18  Tobias Burnus  <burnus@net-b.de>
683
684         PR fortran/61126
685         * invoke.texi (-Wunused-parameter): Make clearer when
686         -Wextra implies this option.
687
688 2014-06-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>
689
690         PR fortran/61126
691         * options.c (gfc_handle_option): Remove call to
692         handle_generated_option.
693
694 2014-06-17  Tobias Burnus  <burnus@net-b.de>
695
696         * check.c (gfc_check_atomic, gfc_check_atomic_def):
697         Use argument for GFC_ISYM_CAF_GET.
698         * resolve.c (resolve_variable): Enable CAF_GET insertion.
699         (resolve_lock_unlock): Remove GFC_ISYM_CAF_GET.
700         (resolve_ordinary_assign): Enable CAF_SEND insertion.
701         * trans-const.c (gfc_build_string_const,
702         gfc_build_wide_string_const): Set TYPE_STRING_FLAG.
703         * trans-decl.c (gfor_fndecl_caf_get, gfor_fndecl_caf_send,
704         gfor_fndecl_caf_sendget): New global variables.
705         (gfc_build_builtin_function_decls): Initialize them;
706         update co_min/max/sum initialization.
707         * trans-expr.c (gfc_get_tree_for_caf_expr): Renamed from
708         get_tree_for_caf_expr and removed static.
709         (gfc_conv_procedure_call): Update call.
710         * trans-intrinsic.c (caf_get_image_index,
711         conv_caf_vector_subscript_elem, conv_caf_vector_subscript,
712         get_caf_token_offset, gfc_conv_intrinsic_caf_get,
713         conv_caf_send): New.
714         (gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine,
715         gfc_walk_intrinsic_function): Handle CAF_GET and CAF_SEND.
716         (conv_co_minmaxsum): Update call for remove unused vector
717         subscript.
718         (conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref):
719         Skip a CAF_GET of the argument.
720         * trans-types.c (gfc_get_caf_vector_type): New.
721         * trans-types.h (gfc_get_caf_vector_type): New.
722         * trans.h (gfor_fndecl_caf_get, gfor_fndecl_caf_send,
723         gfor_fndecl_caf_sendget): New global variables.
724         (gfc_get_tree_for_caf_expr): New prototypes.
725
726 2014-06-15  Jan Hubicka  <hubicka@ucw.cz>
727
728         * trans-common.c (build_common_decl): Use
729         set_decl_tls_model.
730         * trans-decl.c (gfc_finish_var_decl): Likewise.
731         (get_proc_pointer_decl): Likewise.
732
733 2014-06-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
734
735         PR fortran/28484
736         PR fortran/61429
737         * check.c (gfc_check_system_clock): Improve checking of arguments.
738         * intrinsic.texi: Update doc of SYSTEM_CLOCK.
739         * iresolve.c (gfc_resolve_system_clock): Choose library function
740         used depending on argument kinds.
741         * trans-decl.c (gfc_build_intrinsic_function_decls): Build
742         decls for system_clock_4 and system_clock_8.
743         * trans-intrinsic.c (conv_intrinsic_system_clock): New function.
744         (gfc_conv_intrinsic_subroutine): Call conv_intrinsic_system_clock.
745         * trans.h (gfor_fndecl_system_clock4, gfor_fndecl_system_clock8):
746         New variables.
747
748 2014-06-12  Tobias Burnus  <burnus@net-b.de>
749
750         * gfortran.h (gfc_copy_formal_args_intr): Update prototype.
751         * symbol.c (gfc_copy_formal_args_intr): Handle the case
752         that absent optional arguments should be ignored.
753         * trans-intrinsic.c (gfc_get_symbol_for_expr): Ditto.
754         (gfc_conv_intrinsic_funcall,
755         conv_generic_with_optional_char_arg): Update call.
756         * resolve.c (gfc_resolve_intrinsic): Ditto.
757
758 2014-06-10  Dominique d'Humieres <dominiq@lps.ens.fr>
759             Mikael Morin <mikael@gcc.gnu.org>
760
761         PR fortran/41936
762         * trans-expr.c (gfc_conv_expr_reference): Deallocate array
763         components.
764
765 2014-06-10  Jakub Jelinek  <jakub@redhat.com>
766
767         PR fortran/60928
768         * f95-lang.c (gfc_init_builtin_functions): Handle -fopenmp-simd
769         like -fopenmp.
770         * openmp.c (resolve_omp_clauses): Remove allocatable components
771         diagnostics.  Add associate-name and intent(in) pointer
772         diagnostics for various clauses, diagnose procedure pointers in
773         reduction clause.
774         * parse.c (match_word_omp_simd): New function.
775         (matchs, matcho): New macros.
776         (decode_omp_directive): Change match macros to either matchs
777         or matcho.  Handle -fopenmp-simd.
778         (next_free, next_fixed): Handle -fopenmp-simd like -fopenmp.
779         * scanner.c (skip_free_comments, skip_fixed_comments, include_line):
780         Likewise.
781         * trans-array.c (get_full_array_size): Rename to...
782         (gfc_full_array_size): ... this.  No longer static.
783         (duplicate_allocatable): Adjust caller.  Add NO_MEMCPY argument
784         and handle it.
785         (gfc_duplicate_allocatable, gfc_copy_allocatable_data): Adjust
786         duplicate_allocatable callers.
787         (gfc_duplicate_allocatable_nocopy): New function.
788         (structure_alloc_comps): Adjust g*_full_array_size and
789         duplicate_allocatable caller.
790         * trans-array.h (gfc_full_array_size,
791         gfc_duplicate_allocatable_nocopy): New prototypes.
792         * trans-common.c (create_common): Call gfc_finish_decl_attrs.
793         * trans-decl.c (gfc_finish_decl_attrs): New function.
794         (gfc_finish_var_decl, create_function_arglist,
795         gfc_get_fake_result_decl): Call it.
796         (gfc_allocate_lang_decl): If DECL_LANG_SPECIFIC is already allocated,
797         don't allocate it again.
798         (gfc_get_symbol_decl): Set GFC_DECL_ASSOCIATE_VAR_P on
799         associate-names.
800         * trans.h (gfc_finish_decl_attrs): New prototype.
801         (struct lang_decl): Add scalar_allocatable and scalar_pointer
802         bitfields.
803         (GFC_DECL_SCALAR_ALLOCATABLE, GFC_DECL_SCALAR_POINTER,
804         GFC_DECL_GET_SCALAR_ALLOCATABLE, GFC_DECL_GET_SCALAR_POINTER,
805         GFC_DECL_ASSOCIATE_VAR_P): Define.
806         (GFC_POINTER_TYPE_P): Remove.
807         * trans-openmp.c (gfc_omp_privatize_by_reference): Don't check
808         GFC_POINTER_TYPE_P, instead test GFC_DECL_GET_SCALAR_ALLOCATABLE,
809         GFC_DECL_GET_SCALAR_POINTER or GFC_DECL_CRAY_POINTEE on decl.
810         (gfc_omp_predetermined_sharing): Associate-names are predetermined.
811         (enum walk_alloc_comps): New.
812         (gfc_has_alloc_comps, gfc_omp_unshare_expr_r, gfc_omp_unshare_expr,
813         gfc_walk_alloc_comps): New functions.
814         (gfc_omp_private_outer_ref): Return true for scalar allocatables or
815         decls with allocatable components.
816         (gfc_omp_clause_default_ctor, gfc_omp_clause_copy_ctor,
817         gfc_omp_clause_assign_op, gfc_omp_clause_dtor): Fix up handling of
818         allocatables, handle also OMP_CLAUSE_REDUCTION, handle scalar
819         allocatables and decls with allocatable components.
820         (gfc_trans_omp_array_reduction_or_udr): Don't handle allocatable
821         arrays here.
822         (gfc_trans_omp_reduction_list): Call
823         gfc_trans_omp_array_reduction_or_udr even for allocatable scalars.
824         (gfc_trans_omp_do_simd): If -fno-openmp, just expand it as OMP_SIMD.
825         (gfc_trans_omp_parallel_do_simd): Likewise.
826         * trans-types.c (gfc_sym_type): Don't set GFC_POINTER_TYPE_P.
827         (gfc_get_derived_type): Call gfc_finish_decl_attrs.
828
829 2014-06-09  Paul Thomas  <pault@gcc.gnu.org>
830
831         PR fortran/61406
832         * trans-stmt.c (trans_associate_var): Check that array
833         constructors are constant for direct reference.
834
835 2014-06-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
836
837         PR fortran/36096
838         * intrinsic.texi: Fix documentation of BESSEL_J0, BESSEL_J1,
839         BESSEL_Y0, and BESSEL_Y1.
840
841 2014-06-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
842
843         PR fortran/45187
844         * trans-decl.c (gfc_create_module_variable): Don't create
845         Cray-pointee decls twice.
846
847 2014-06-06  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
848
849         * io.c (resolve_tag): Warn on non-default kind for NUMBER,
850         NEXTREC, RECL, NAMED, OPENED and PENDING I/O specifiers.
851
852 2014-06-06  Jakub Jelinek  <jakub@redhat.com>
853
854         * dump-parse-tree.c (show_omp_namelist): Dump reduction
855         id in each list item.
856         (show_omp_node): Only handle OMP_LIST_REDUCTION, not
857         OMP_LIST_REDUCTION_FIRST .. OMP_LIST_REDUCTION_LAST.  Don't
858         dump reduction id here.
859         * frontend-passes.c (dummy_code_callback): Renamed to...
860         (gfc_dummy_code_callback): ... this.  No longer static.
861         (optimize_reduction): Use gfc_dummy_code_callback instead of
862         dummy_code_callback.
863         * gfortran.h (gfc_statement): Add ST_OMP_DECLARE_REDUCTION.
864         (symbol_attribute): Add omp_udr_artificial_var bitfield.
865         (gfc_omp_reduction_op): New enum.
866         (gfc_omp_namelist): Add rop and udr fields.
867         (OMP_LIST_PLUS, OMP_LIST_REDUCTION_FIRST, OMP_LIST_MULT,
868         OMP_LIST_SUB, OMP_LIST_AND, OMP_LIST_OR, OMP_LIST_EQV,
869         OMP_LIST_NEQV, OMP_LIST_MAX, OMP_LIST_MIN, OMP_LIST_IAND,
870         OMP_LIST_IOR, OMP_LIST_IEOR, OMP_LIST_REDUCTION_LAST): Removed.
871         (OMP_LIST_REDUCTION): New.
872         (gfc_omp_udr): New type.
873         (gfc_get_omp_udr): Define.
874         (gfc_symtree): Add n.omp_udr field.
875         (gfc_namespace): Add omp_udr_root field, add omp_udr_ns bitfield.
876         (gfc_free_omp_udr, gfc_omp_udr_find, gfc_resolve_omp_udrs,
877         gfc_dummy_code_callback): New prototypes.
878         * match.h (gfc_match_omp_declare_reduction): New prototype.
879         * module.c (MOD_VERSION): Increase to 13.
880         (omp_declare_reduction_stmt): New array.
881         (mio_omp_udr_expr, write_omp_udr, write_omp_udrs, load_omp_udrs):
882         New functions.
883         (read_module): Read OpenMP user defined reductions.
884         (write_module): Write OpenMP user defined reductions.
885         * openmp.c: Include arith.h.
886         (gfc_free_omp_udr, gfc_find_omp_udr): New functions.
887         (gfc_match_omp_clauses): Handle user defined reductions.
888         Store reduction kind into gfc_omp_namelist instead of using
889         several OMP_LIST_* entries.
890         (match_udr_expr, gfc_omp_udr_predef, gfc_omp_udr_find,
891         gfc_match_omp_declare_reduction): New functions.
892         (resolve_omp_clauses): Adjust for reduction clauses being only
893         in OMP_LIST_REDUCTION list.  Diagnose missing UDRs.
894         (struct omp_udr_callback_data): New type.
895         (omp_udr_callback, gfc_resolve_omp_udr, gfc_resolve_omp_udrs): New
896         functions.
897         * parse.c (decode_omp_directive): Handle !$omp declare reduction.
898         (case_decl): Add ST_OMP_DECLARE_REDUCTION.
899         (gfc_ascii_statement): Print ST_OMP_DECLARE_REDUCTION.
900         * resolve.c (resolve_fl_variable): Allow len=: or len=* on
901         sym->attr.omp_udr_artificial_var symbols.
902         (resolve_types): Call gfc_resolve_omp_udrs.
903         * symbol.c (gfc_get_uop): If gfc_current_ns->omp_udr_ns,
904         use parent ns instead of gfc_current_ns.
905         (gfc_get_sym_tree): Don't insert symbols into
906         namespaces with omp_udr_ns set.
907         (free_omp_udr_tree): New function.
908         (gfc_free_namespace): Call it.
909         * trans-openmp.c (struct omp_udr_find_orig_data): New type.
910         (omp_udr_find_orig, gfc_trans_omp_udr_expr): New functions.
911         (gfc_trans_omp_array_reduction): Renamed to...
912         (gfc_trans_omp_array_reduction_or_udr): ... this.  Remove SYM
913         argument, instead pass gfc_omp_namelist pointer N.  Handle
914         user defined reductions.
915         (gfc_trans_omp_reduction_list): Remove REDUCTION_CODE argument.
916         Handle user defined reductions and reduction ops in gfc_omp_namelist.
917         (gfc_trans_omp_clauses): Adjust for just a single OMP_LIST_REDUCTION
918         list.
919         (gfc_split_omp_clauses): Likewise.
920
921 2014-06-05  Richard Biener  <rguenther@suse.de>
922
923         PR fortran/61418
924         * gfortranspec.c (spec_file): Remove.
925         (find_spec_file): Likewise.
926         (lang_specific_driver): Do not look for specs file in -L
927         or append -specs command line argument.
928         (lang_specific_pre_link): Always %:include libgfortran.spec.
929
930 2014-06-02  Andrew MacLeod  <amacleod@redhat.com>
931
932         * fortran/trans.c (trans_runtime_error_vararg): Call
933         fold_build_call_array_loc instead of fold_builtin_call_array.
934
935 2014-06-02  Bernd Schmidt  <bernds@codesourcery.com>
936
937         * trans-decl.c (gfc_build_builtin_function_decls): Correct number of
938         arguments to caf_init.
939
940 2014-05-26  Tobias Burnus  <burnus@net-b.de>
941
942         * gfortran.texi (Project Status): Fix broken link.
943
944 2014-05-26  Janne Blomqvist  <jb@gcc.gnu.org>
945
946         PR libfortran/61310
947         * intrinsics.texi (CTIME): Remove mention of locale-dependent
948         behavior.
949
950 2014-05-26  Tobias Burnus  <burnus@net-b.de>
951
952         PR fortran/55117
953         * trans-io.c (nml_full_name, transfer_namelist_element): Insert
954         a '+' rather then '%' to differentiate namelist variable names
955         that are based on extended derived types.
956
957 2014-05-25  Tobias Burnus  <burnus@net-b.de>
958
959         * check.c (gfc_check_num_images): New.
960         (gfc_check_this_image): Handle distance argument.
961         * intrinsic.c (add_functions): Update this_image and num_images
962         for new distance and failed arguments.
963         * intrinsic.texi (THIS_IMAGE, NUM_IMAGES): Document the new
964         arguments.
965         * intrinsic.h (gfc_check_num_images): New.
966         (gfc_check_this_image, gfc_simplify_num_images,
967         gfc_simplify_this_image, gfc_resolve_this_image): Update prototype.
968         * iresolve.c (gfc_resolve_this_image): Handle distance argument.
969         * simplify.c (gfc_simplify_num_images, gfc_simplify_this_image):
970         Handle new arguments.
971         * trans-intrinsic.c (trans_this_image, trans_num_images): Ditto.
972         (gfc_conv_intrinsic_function): Update trans_num_images call.
973
974 2014-05-23  Tobias Burnus  <burnus@net-b.de>
975
976         * gfc-internals.texi: Change URLs to HTTPS; fix broken links.
977         * gfortran.texi: Ditto.
978
979 2014-05-22  Thomas Schwinge  <thomas@codesourcery.com>
980
981         * f95-lang.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
982         (DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
983         (DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
984         * types.def: Simplify examples for DEF_FUNCTION_TYPE_*.
985
986 2014-05-17  Trevor Saunders  <tsaunders@mozilla.com>
987
988         * f95-lang.c (pushlevel): Adjust.
989         * trans-decl.c (gfc_allocate_lang_decl): Adjust.
990         (gfc_find_module): Likewise.
991         * trans-types.c (gfc_get_nodesc_array_type): Likewise.
992         (gfc_get_array_type_bounds): Likewise.
993         (gfc_nonrestricted_type): Likewise.
994         * trans.h: Don't use variable_size gty attribute.
995
996 2014-05-17  Dominique d'Humieres <dominiq@lps.ens.fr>
997
998         * check.c (gfc_check_fn_rc2008): move "argument" to the right
999         place.
1000
1001 2014-05-12  Tobias Burnus  <burnus@net-b.de>
1002
1003         PR fortran/60127
1004         * openmp.c (resolve_omp_do): Reject do concurrent loops.
1005
1006 2014-05-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
1007
1008         PR fortran/60834
1009         * frontend-passes.c (in_assoc_list):  New variable.
1010         (optimize_namespace):  Initialize in_assoc_list
1011         (combine_array_constructor): Don't try to combine
1012         assoc lists.
1013         (gfc_code_walker):  Keep track of in_assoc_list.
1014
1015 2014-05-11  Jakub Jelinek  <jakub@redhat.com>
1016
1017         * gfortran.h (gfc_statement): Add ST_OMP_CANCEL,
1018         ST_OMP_CANCELLATION_POINT, ST_OMP_TASKGROUP, ST_OMP_END_TASKGROUP,
1019         ST_OMP_SIMD, ST_OMP_END_SIMD, ST_OMP_DO_SIMD, ST_OMP_END_DO_SIMD,
1020         ST_OMP_PARALLEL_DO_SIMD, ST_OMP_END_PARALLEL_DO_SIMD and
1021         ST_OMP_DECLARE_SIMD.
1022         (gfc_omp_namelist): New typedef.
1023         (gfc_get_omp_namelist): Define.
1024         (OMP_LIST_UNIFORM, OMP_LIST_ALIGNED, OMP_LIST_LINEAR,
1025         OMP_LIST_DEPEND_IN, OMP_LIST_DEPEND_OUT): New clause list kinds.
1026         (gfc_omp_proc_bind_kind, gfc_omp_cancel_kind): New enums.
1027         (gfc_omp_clauses): Change type of lists to gfc_omp_namelist *.
1028         Add inbranch, notinbranch, cancel, proc_bind, safelen_expr and
1029         simdlen_expr fields.
1030         (gfc_omp_declare_simd): New typedef.
1031         (gfc_get_omp_declare_simd): Define.
1032         (gfc_namespace): Add omp_declare_simd field.
1033         (gfc_exec_op): Add EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
1034         EXEC_OMP_TASKGROUP, EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD and
1035         EXEC_OMP_PARALLEL_DO_SIMD.
1036         (gfc_omp_atomic_op): Add GFC_OMP_ATOMIC_MASK, GFC_OMP_ATOMIC_SEQ_CST
1037         and GFC_OMP_ATOMIC_SWAP.
1038         (gfc_code): Change type of omp_namelist field to gfc_omp_namelist *.
1039         (gfc_free_omp_namelist, gfc_free_omp_declare_simd,
1040         gfc_free_omp_declare_simd_list, gfc_resolve_omp_declare_simd): New
1041         prototypes.
1042         * trans-stmt.h (gfc_trans_omp_declare_simd): New prototype.
1043         * symbol.c (gfc_free_namespace): Call gfc_free_omp_declare_simd.
1044         * openmp.c (gfc_free_omp_clauses): Free safelen_expr and
1045         simdlen_expr.  Use gfc_free_omp_namelist instead of
1046         gfc_free_namelist.
1047         (gfc_free_omp_declare_simd, gfc_free_omp_declare_simd_list): New
1048         functions.
1049         (gfc_match_omp_variable_list): Add end_colon, headp and
1050         allow_sections arguments.  Handle parsing of array sections.
1051         Use *omp_namelist* instead of *namelist* data structure and
1052         functions/macros.  Allow termination at : character.
1053         (OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_INBRANCH,
1054         OMP_CLAUSE_LINEAR, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_PROC_BIND,
1055         OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_UNIFORM): Define.
1056         (gfc_match_omp_clauses): Change first and needs_space variables
1057         into arguments with default values.  Parse inbranch, notinbranch,
1058         proc_bind, safelen, simdlen, uniform, linear, aligned and
1059         depend clauses.
1060         (OMP_PARALLEL_CLAUSES): Add OMP_CLAUSE_PROC_BIND.
1061         (OMP_DECLARE_SIMD_CLAUSES, OMP_SIMD_CLAUSES): Define.
1062         (OMP_TASK_CLAUSES): Add OMP_CLAUSE_DEPEND.
1063         (gfc_match_omp_do_simd): New function.
1064         (gfc_match_omp_flush): Use *omp_namelist* instead of *namelist*
1065         data structure and functions/macros.
1066         (gfc_match_omp_simd, gfc_match_omp_declare_simd,
1067         gfc_match_omp_parallel_do_simd): New functions.
1068         (gfc_match_omp_atomic): Handle seq_cst clause.  Handle atomic swap.
1069         (gfc_match_omp_taskgroup, gfc_match_omp_cancel_kind,
1070         gfc_match_omp_cancel, gfc_match_omp_cancellation_point): New
1071         functions.
1072         (resolve_omp_clauses): Add where, omp_clauses and ns arguments.
1073         Use *omp_namelist* instead of *namelist* data structure and
1074         functions/macros.  Resolve uniform, aligned, linear, depend,
1075         safelen and simdlen clauses.
1076         (resolve_omp_atomic): Adjust for GFC_OMP_ATOMIC_{MASK,SEQ_CST,SWAP}
1077         addition, recognize atomic swap.
1078         (gfc_resolve_omp_parallel_blocks): Use gfc_omp_namelist instead
1079         of gfc_namelist.  Handle EXEC_OMP_PARALLEL_DO_SIMD the same as
1080         EXEC_OMP_PARALLEL_DO.
1081         (gfc_resolve_do_iterator): Use *omp_namelist* instead of *namelist*
1082         data structure and functions/macros.
1083         (resolve_omp_do): Likewise.  Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
1084         EXEC_OMP_PARALLEL_DO_SIMD.
1085         (gfc_resolve_omp_directive): Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
1086         EXEC_OMP_PARALLEL_DO_SIMD and EXEC_OMP_CANCEL.  Adjust
1087         resolve_omp_clauses caller.
1088         (gfc_resolve_omp_declare_simd): New function.
1089         * parse.c (decode_omp_directive): Parse cancellation point, cancel,
1090         declare simd, end do simd, end simd, end parallel do simd,
1091         end taskgroup, parallel do simd, simd and taskgroup directives.
1092         (case_executable): Add ST_OMP_CANCEL and ST_OMP_CANCELLATION_POINT.
1093         (case_exec_markers): Add ST_OMP_TASKGROUP, case ST_OMP_SIMD,
1094         ST_OMP_DO_SIMD and ST_OMP_PARALLEL_DO_SIMD.
1095         (case_decl): Add ST_OMP_DECLARE_SIMD.
1096         (gfc_ascii_statement): Handle ST_OMP_CANCEL,
1097         ST_OMP_CANCELLATION_POINT, ST_OMP_TASKGROUP, ST_OMP_END_TASKGROUP,
1098         ST_OMP_SIMD, ST_OMP_END_SIMD, ST_OMP_DO_SIMD, ST_OMP_END_DO_SIMD,
1099         ST_OMP_PARALLEL_DO_SIMD, ST_OMP_END_PARALLEL_DO_SIMD and
1100         ST_OMP_DECLARE_SIMD.
1101         (parse_omp_do): Handle ST_OMP_SIMD, ST_OMP_DO_SIMD and
1102         ST_OMP_PARALLEL_DO_SIMD.
1103         (parse_omp_atomic): Adjust for GFC_OMP_ATOMIC_* additions.
1104         (parse_omp_structured_block): Handle ST_OMP_TASKGROUP and
1105         ST_OMP_PARALLEL_DO_SIMD.
1106         (parse_executable): Handle ST_OMP_SIMD, ST_OMP_DO_SIMD,
1107         ST_OMP_PARALLEL_DO_SIMD and ST_OMP_TASKGROUP.
1108         * trans-decl.c (gfc_get_extern_function_decl,
1109         gfc_create_function_decl): Call gfc_trans_omp_declare_simd if
1110         needed.
1111         * frontend-passes.c (gfc_code_walker): Handle EXEC_OMP_SIMD,
1112         EXEC_OMP_DO_SIMD and EXEC_OMP_PARALLEL_DO_SIMD.  Walk
1113         safelen_expr and simdlen_expr.  Walk expressions in gfc_omp_namelist
1114         of depend, aligned and linear clauses.
1115         * match.c (match_exit_cycle): Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD
1116         and EXEC_OMP_PARALLEL_DO_SIMD.
1117         (gfc_free_omp_namelist): New function.
1118         * dump-parse-tree.c (show_namelist): Removed.
1119         (show_omp_namelist): New function.
1120         (show_omp_node): Handle OpenMP 4.0 additions.
1121         (show_code_node): Handle EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
1122         EXEC_OMP_DO_SIMD, EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and
1123         EXEC_OMP_TASKGROUP.
1124         * match.h (gfc_match_omp_cancel, gfc_match_omp_cancellation_point,
1125         gfc_match_omp_declare_simd, gfc_match_omp_do_simd,
1126         gfc_match_omp_parallel_do_simd, gfc_match_omp_simd,
1127         gfc_match_omp_taskgroup): New prototypes.
1128         * trans-openmp.c (gfc_trans_omp_variable): Add declare_simd
1129         argument, handle it.  Allow current_function_decl to be NULL.
1130         (gfc_trans_omp_variable_list): Add declare_simd argument, pass
1131         it through to gfc_trans_omp_variable and disregard whether
1132         sym is referenced if declare_simd is true.  Work on gfc_omp_namelist
1133         instead of gfc_namelist.
1134         (gfc_trans_omp_reduction_list): Work on gfc_omp_namelist instead of
1135         gfc_namelist.  Adjust gfc_trans_omp_variable caller.
1136         (gfc_trans_omp_clauses): Add declare_simd argument, pass it through
1137         to gfc_trans_omp_variable{,_list} callers.  Work on gfc_omp_namelist
1138         instead of gfc_namelist.  Handle inbranch, notinbranch, safelen,
1139         simdlen, depend, uniform, linear, proc_bind and aligned clauses.
1140         Handle cancel kind.
1141         (gfc_trans_omp_atomic): Handle seq_cst clause, handle atomic swap,
1142         adjust for GFC_OMP_ATOMIC_* changes.
1143         (gfc_trans_omp_cancel, gfc_trans_omp_cancellation_point): New
1144         functions.
1145         (gfc_trans_omp_do): Add op argument, handle simd translation into
1146         generic.
1147         (GFC_OMP_SPLIT_SIMD, GFC_OMP_SPLIT_DO, GFC_OMP_SPLIT_PARALLEL,
1148         GFC_OMP_SPLIT_NUM, GFC_OMP_MASK_SIMD, GFC_OMP_MASK_DO,
1149         GFC_OMP_MASK_PARALLEL): New.
1150         (gfc_split_omp_clauses, gfc_trans_omp_do_simd): New functions.
1151         (gfc_trans_omp_parallel_do): Rework to use gfc_split_omp_clauses.
1152         (gfc_trans_omp_parallel_do_simd, gfc_trans_omp_taskgroup): New
1153         functions.
1154         (gfc_trans_omp_directive): Handle EXEC_OMP_CANCEL,
1155         EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
1156         EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
1157         Adjust gfc_trans_omp_do caller.
1158         (gfc_trans_omp_declare_simd): New function.
1159         * st.c (gfc_free_statement): Handle EXEC_OMP_CANCEL,
1160         EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
1161         EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
1162         For EXEC_OMP_FLUSH call gfc_free_omp_namelist instead of
1163         gfc_free_namelist.
1164         * module.c (omp_declare_simd_clauses): New variable.
1165         (mio_omp_declare_simd): New function.
1166         (mio_symbol): Call it.
1167         * trans.c (trans_code): Handle EXEC_OMP_CANCEL,
1168         EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
1169         EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
1170         * resolve.c (gfc_resolve_blocks): Handle EXEC_OMP_DO_SIMD,
1171         EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
1172         (resolve_code): Handle EXEC_OMP_CANCEL,
1173         EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
1174         EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
1175         (resolve_types): Call gfc_resolve_omp_declare_simd.
1176
1177 2014-05-11  Tobias Burnus  <burnus@net-b.de>
1178
1179         * trans-intrinsic.c (gfc_build_builtin_function_decls):
1180         Change type of second argument to int.
1181
1182 2014-05-09  Mike Stump  <mikestump@comcast.net>
1183
1184         PR fortran/61109
1185         * trans-array.c (gfc_conv_array_initializer): Fix wide-int
1186         conversion bug.
1187
1188 2014-05-08  Tobias Burnus  <burnus@net-b.de>
1189
1190         * gfortran.h (gfc_isym_id): Add GFC_ISYM_CAF_GET
1191         and GFC_ISYM_CAF_SEND.
1192         * intrinsic.c (add_functions): Add only internally
1193         accessible caf_get and caf_send functions.
1194         * resolve.c (add_caf_get_intrinsic,
1195         remove_caf_get_intrinsic): New functions.
1196         (resolve_variable): Resolve expression rank and
1197         prepare for add_caf_get_intrinsic call.
1198         (gfc_resolve_expr): For variables, remove rank
1199         resolution.
1200         (resolve_ordinary_assign): Prepare call to
1201         GFC_ISYM_CAF_SEND.
1202         (resolve_code): Avoid call to GFC_ISYM_CAF_GET for
1203         the LHS of an assignment.
1204
1205 2014-05-08  Tobias Burnus  <burnus@net-b.de>
1206
1207         * trans-intrinsic.c (conv_co_minmaxsum): Change condition style.
1208
1209 2014-05-08  Tobias Burnus  <burnus@net-b.de>
1210
1211         * check.c (check_co_minmaxsum, gfc_check_co_minmax,
1212         gfc_check_co_sum): New.
1213         * error.c (gfc_notify_std): Update -std=f2008ts.
1214         * gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
1215         GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
1216         * intrinsic.h (gfc_check_co_minmax,
1217         gfc_check_co_sum): Declare.
1218         * intrinsic.c (add_subroutines): Add co_min, co_max
1219         and co_sum.
1220         (gfc_check_intrinsic_standard): Update text for
1221         -std=f2008ts.
1222         * intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
1223         them.
1224         * invoke.texi (-std=f2008ts): Update wording.
1225         * trans.h (gfor_fndecl_co_max,
1226         gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
1227         * trans-decl.c (gfor_fndecl_co_max,
1228         gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
1229         (gfc_build_builtin_function_decls): Assign to it.
1230         * trans-intrinsic.c (conv_co_minmaxsum): New.
1231         (gfc_conv_intrinsic_subroutine): Call it.
1232
1233 2014-05-06  Kenneth Zadeck  <zadeck@naturalbridge.com>
1234             Mike Stump  <mikestump@comcast.net>
1235             Richard Sandiford  <rdsandiford@googlemail.com>
1236
1237         * target-memory.c: Include wide-int.h.
1238         (gfc_interpret_logical): Use wide-int interfaces.
1239         * trans-array.c: Include wide-int.h.
1240         (gfc_conv_array_initializer): Use wide-int interfaces.
1241         * trans-const.c: Include wide-int.h.
1242         (gfc_conv_string_init): Use wide-int interfaces.
1243         (gfc_conv_mpz_to_tree): Likewise.
1244         (gfc_conv_tree_to_mpz): Likewise.
1245         * trans-decl.c (gfc_can_put_var_on_stack): Use tree_fits_uhwi_p.
1246         * trans-expr.c: Include wide-int.h.
1247         (gfc_conv_cst_int_power): Use wide-int interfaces.
1248         (gfc_string_to_single_character): Likewise.
1249         (gfc_optimize_len_trim): Likewise.
1250         * trans-intrinsic.c: Include wide-int.h.
1251         (trans_this_image): Use wide-int interfaces.
1252         (gfc_conv_intrinsic_bound): Likewise.
1253         (conv_intrinsic_cobound): Likewise.
1254         * trans-types.c (gfc_init_types): Likewise.
1255         (gfc_get_array_type_bounds): Pass an integer of the correct type
1256         instead of using integer_one_node.
1257
1258 2014-04-30  Tobias Burnus  <burnus@net-b.de>
1259
1260         * trans-decl.c (create_function_arglist): Add hidden coarray arguments
1261         also for polymorphic coarrays.
1262         * trans-expr.c (gfc_conv_procedure_call): Pass hidden coarray arguments
1263         also for polymorphic coarrays.
1264
1265 2014-04-30  Tobias Burnus  <burnus@net-b.de>
1266
1267         * resolve.c (resolve_function): Don't do
1268         assumed-size check for lcobound/ucobound.
1269         * trans-types.c (gfc_build_array_type): Only build an array
1270         descriptor with codimensions for allocatable coarrays.
1271
1272 2014-04-30  Tobias Burnus  <burnus@net-b.de>
1273
1274         * gfortran.h (gfc_init_coarray_decl): Remove.
1275         * parse.c (translate_all_program_units): Remove call to it.
1276         (gfc_parse_file): Update call.
1277         * trans.h (gfor_fndecl_caf_this_image,
1278         gfor_fndecl_caf_num_images): Add.
1279         (gfort_gvar_caf_num_images,
1280         gfort_gvar_caf_this_image): Remove.
1281         * trans-decl.c (gfor_fndecl_caf_this_image,
1282         gfor_fndecl_caf_num_images): Add.
1283         (gfort_gvar_caf_num_images,
1284         gfort_gvar_caf_this_image): Remove.
1285         (gfc_build_builtin_function_decls): Init new decl.
1286         (gfc_init_coarray_dec): Remove.
1287         (create_main_function): Change calls.
1288         * trans-intrinsic.c (trans_this_image, trans_image_index,
1289         conv_intrinsic_cobound): Generate call to new library function
1290         instead of to a static variable.
1291         * trans-stmt.c (gfc_trans_sync): Ditto.
1292
1293 2014-04-30  Tobias Burnus  <burnus@net-b.de>
1294
1295         * trans-expr.c (get_tree_for_caf_expr): Fix handling of polymorphic
1296         and derived-type coarrays.
1297
1298 2014-04-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1299
1300         PR fortran/59604
1301         PR fortran/58003
1302         * gfortran.h (gfc_convert_mpz_to_signed):  Add prototype.
1303         * arith.c (gfc_int2int):  Convert number to signed if
1304         arithmetic overflow is not checked.
1305         * simplify.c (convert_mpz_to_unsigned): Only trigger assert for
1306         size if range checking is in force.
1307         (convert_mpz_to_signed):  Make non-static, rename to
1308         (gfc_convert_mpz_to_signed).
1309         (simplify_dshift): Use gfc_convert_mpz_to_signed.
1310         (gfc_simplify_ibclr):  Likewise.
1311         (gfc_simplify_ibits):  Likewise.
1312         (gfc_simplify_ibset):  Likewise.
1313         (simplify_shift):  Likewise.
1314         (gfc_simplify_ishiftc):  Likewise.
1315         (gfc_simplify_maskr):  Likewise.
1316         (gfc_simplify_maskl):  Likewise.
1317
1318 2014-04-22  Tobias Burnus  <burnus@net-b.de>
1319
1320         PR fortran/60881
1321         * trans-expr.c (gfc_trans_subcomponent_assign): Fix handling
1322         of scalar coarrays.
1323
1324 2014-04-17  Jakub Jelinek  <jakub@redhat.com>
1325
1326         * trans-types.c (gfc_init_kinds): Make sure GET_MODE_BITSIZE
1327         argument is enum machine_mode.
1328
1329 2014-04-13  Paul Thomas  <pault@gcc.gnu.org>
1330
1331         PR fortran/58085
1332         PR fortran/60717
1333         * trans.h: Add 'use_offset' bitfield to gfc_se.
1334         * trans-array.c (gfc_conv_expr_descriptor): Use 'use_offset'
1335         as a trigger to unconditionally recalculate the offset for
1336         array slices and constant arrays.
1337         trans-expr.c (gfc_conv_intrinsic_to_class): Use it.
1338         trans-stmt.c (trans_associate_var): Ditto.
1339         (gfc_conv_procedure_call): Ditto.
1340
1341 2014-04-11  Tobias Burnus  <burnus@net-b.de>
1342
1343         PR fortran/58880
1344         PR fortran/60495
1345         * resolve.c (gfc_resolve_finalizers): Ensure that vtables
1346         and finalization wrappers are generated.
1347
1348 2014-04-11  Janne Blomqvist  <jb@gcc.gnu.org>
1349
1350         * intrinsic.texi (RANDOM_SEED): Improve example.
1351
1352 2014-04-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1353
1354         * class.c (gfc_build_class_symbol): Append "_t" to target class
1355         names to make the generated type names unique.
1356
1357 2014-04-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1358
1359         PR fortran/60191
1360         * trans-types.c (gfc_get_function_type): In case of recursion
1361         build a variadic function type with empty argument list instead of a
1362         stdarg-like function type with incomplete argument list.
1363
1364 2014-04-04  Tobias Burnus  <burnus@net-b.de>
1365
1366         * check.c (gfc_check_cmplx): Fix typo.
1367
1368 2014-03-28  Mikael Morin  <mikael@gcc.gnu.org>
1369             Tobias Burnus  <burnus@net-b.de>
1370
1371         PR fortran/60576
1372         * trans-expr.c (gfc_conv_derived_to_class): Avoid
1373         generation of out-of-bounds range expr.
1374
1375 2014-03-28  Mikael Morin  <mikael@gcc.gnu.org>
1376
1377         PR fortran/60677
1378         * trans-intrinsic.c (gfc_conv_intrinsic_ichar): Enlarge argument
1379         list buffer.
1380
1381 2014-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1382
1383         PR fortran/60522
1384         * frontend-passes.c (cfe_code):  Do not walk subtrees
1385         for WHERE.
1386
1387 2014-03-27  Tobias Burnus  <burnus@net-b.de>
1388
1389         PR fortran/58880
1390         * trans-expr.c (gfc_conv_scalar_to_descriptor): Fix handling
1391         of nonpointers.
1392
1393 2014-03-26 Dominique d'Humieres <dominiq@lps.ens.fr>
1394
1395         PR fortran/34928
1396         * fortran.texi: Document Volatile COMMON as not supported.
1397
1398 2014-03-22  Jakub Jelinek  <jakub@redhat.com>
1399
1400         PR debug/60603
1401         * cpp.c (gfc_cpp_init): Restore cb_change_file call to
1402         <built-in>.
1403
1404 2014-03-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1405
1406         PR fortran/60148
1407         * gfortran.texi: Add description of namelist DELIM= behavior.
1408
1409 2014-03-19  Tobias Burnus  <burnus@net-b.>
1410
1411         PR fortran/60543
1412         * io.c (check_io_constraints): Use gfc_unset_implicit_pure.
1413         * resolve.c (resolve_ordinary_assign): Ditto.
1414
1415 2014-03-19  Tobias Burnus  <burnus@net-b.de>
1416
1417         PR fortran/60543
1418         PR fortran/60283
1419         * gfortran.h (gfc_unset_implicit_pure): New prototype.
1420         * resolve.c (gfc_unset_implicit_pure): New.
1421         (resolve_structure_cons, resolve_function,
1422         pure_subroutine): Use it.
1423         * decl.c (match_old_style_init, gfc_match_data,
1424         match_pointer_init, variable_decl): Ditto.
1425         * expr.c (gfc_check_pointer_assign): Ditto.
1426         * intrinsic.c (gfc_intrinsic_sub_interface): Ditto.
1427         * io.c (match_vtag, gfc_match_open, gfc_match_close,
1428         match_filepos, gfc_match_inquire, gfc_match_print,
1429         gfc_match_wait): Ditto.
1430         * match.c (gfc_match_critical, gfc_match_stopcode,
1431         lock_unlock_statement, sync_statement, gfc_match_allocate,
1432         gfc_match_deallocate): Ditto.
1433         * parse.c (decode_omp_directive): Ditto.
1434         * symbol.c (gfc_add_save): Ditto.
1435
1436 2014-03-18  Janus Weil  <janus@gcc.gnu.org>
1437
1438         PR fortran/55207
1439         PR fortran/60549
1440         * decl.c (match_attr_spec): Revert r208590.
1441
1442 2014-03-18  Jakub Jelinek  <jakub@redhat.com>
1443
1444         PR ipa/58721
1445         * trans.c (gfc_unlikely, gfc_likely): Don't add __builtin_expect
1446         if !optimize.
1447
1448 2014-03-18  Tobias Burnus  <burnus@net-b.de>
1449
1450         PR ipa/58721
1451         * trans.h (gfc_unlikely, gfc_likely): Add predictor as argument.
1452         (gfc_trans_io_runtime_check): Remove.
1453         * trans-io.c (gfc_trans_io_runtime_check): Make static; add has_iostat
1454         as argument, add predictor to block.
1455         (set_parameter_value, gfc_trans_open, gfc_trans_close, build_filepos,
1456         gfc_trans_inquire, gfc_trans_wait, build_dt): Update calls.
1457         * trans.c (gfc_unlikely, gfc_likely): Add predictor as argument.
1458         (gfc_trans_runtime_check, gfc_allocate_using_malloc,
1459         gfc_allocate_allocatable, gfc_deallocate_with_status): Set explicitly
1460         branch predictor.
1461         * trans-expr.c (gfc_conv_procedure_call): Ditto.
1462         * trans-stmt.c (gfc_trans_allocate): Ditto.
1463         * trans-array.c (gfc_array_init_size, gfc_array_allocate): Ditto.
1464
1465 2014-03-15  Janus Weil  <janus@gcc.gnu.org>
1466
1467         PR fortran/55207
1468         * decl.c (match_attr_spec): Variables in the main program implicitly
1469         get the SAVE attribute in Fortran 2008.
1470
1471 2014-03-14  Mikael Morin  <mikael@gcc.gnu.org>
1472
1473         PR fortran/60392
1474         * trans-array.c (gfc_conv_array_parameter): Don't reuse the descriptor
1475         if it has transposed dimensions.
1476
1477 2014-03-08  Tobias Burnus  <burnus@net-b.de>
1478
1479         PR fortran/60447
1480         * f95-lang.c (gfc_init): Return false when only
1481         preprocessing.
1482         * options.c (gfc_post_options): Ditto.
1483
1484 2014-03-08  Tobias Burnus  <burnus@net-b.de>
1485
1486         * gfortran.texi (Fortran 2003 Status): Mention finalization,
1487         deferred-length character support and input rounding.
1488         (Fortran 2008 Status): Mention that at termination
1489         signalling exceptions are shown.
1490
1491 2014-03-06  Paul Thomas  <pault@gcc.gnu.org>
1492             Janus Weil  <janus@gcc.gnu.org>
1493
1494         PR fortran/51976
1495         * gfortran.h (symbol_attribute): Add deferred_parameter attribute.
1496         * primary.c (build_actual_constructor): It is not an error if
1497         a missing component has the deferred_parameter attribute;
1498         equally, if one is given a value, it is an error.
1499         * resolve.c (resolve_fl_derived0): Remove error for deferred
1500         character length components.  Add the hidden string length
1501         field to the structure. Give it the deferred_parameter
1502         attribute.
1503         * trans-array.c (duplicate_allocatable): Add a strlen field
1504         which is used as the element size if it is non-null.
1505         (gfc_duplicate_allocatable, gfc_copy_allocatable_data): Pass a
1506         NULL to the new argument in duplicate_allocatable.
1507         (structure_alloc_comps): Set the hidden string length as
1508         appropriate. Use it in calls to duplicate_allocatable.
1509         (gfc_alloc_allocatable_for_assignment): When a deferred length
1510         backend declaration is variable, use that; otherwise use the
1511         string length from the expression evaluation.
1512         * trans-expr.c (gfc_conv_component_ref): If this is a deferred
1513         character length component, the string length should have the
1514         value of the hidden string length field.
1515         (gfc_trans_subcomponent_assign): Set the hidden string length
1516         field for deferred character length components.  Allocate the
1517         necessary memory for the string.
1518         (alloc_scalar_allocatable_for_assignment): Same change as in
1519         gfc_alloc_allocatable_for_assignment above.
1520         * trans-stmt.c (gfc_trans_allocate): Likewise.
1521         * trans-intrinsic (size_of_string_in_bytes): Make non-static.
1522         * trans-types.c (gfc_get_derived_type): Set the tree type for
1523         a deferred character length component.
1524         * trans.c (gfc_deferred_strlen): New function.
1525         * trans.h (size_of_string_in_bytes,gfc_deferred_strlen): New prototypes.
1526
1527 2014-03-01  Mikael Morin  <mikael@gcc.gnu.org>
1528
1529         PR fortran/60341
1530         * frontend-passes.c (optimize_comparison): Guard two union accesses
1531         with the corresponding tag checks.
1532
1533 2014-02-28  Janus Weil  <janus@gcc.gnu.org>
1534
1535         PR fortran/60359
1536         * class.c (find_intrinsic_vtab): Prevent duplicate creation of copy
1537         procedure for characters.
1538
1539 2014-02-21  Janus Weil  <janus@gcc.gnu.org>
1540
1541         PR fortran/60302
1542         * check.c (gfc_check_c_f_pointer): Only clear 'size' if 'gfc_array_size'
1543         is successful.
1544
1545 2014-02-21  Janus Weil  <janus@gcc.gnu.org>
1546
1547         PR fortran/60234
1548         * gfortran.h (gfc_build_class_symbol): Removed argument.
1549         * class.c (gfc_add_component_ref): Fix up missing vtype if necessary.
1550         (gfc_build_class_symbol): Remove argument 'delayed_vtab'. vtab is always
1551         delayed now, except for unlimited polymorphics.
1552         (comp_is_finalizable): Procedure pointer components are not finalizable.
1553         * decl. (build_sym, build_struct, attr_decl1): Removed argument of
1554         'gfc_build_class_symbol'.
1555         * match.c (copy_ts_from_selector_to_associate, select_type_set_tmp):
1556         Ditto.
1557         * symbol.c (gfc_set_default_type): Ditto.
1558
1559 2014-02-19  Janus Weil  <janus@gcc.gnu.org>
1560
1561         PR fortran/60232
1562         * expr.c (gfc_get_variable_expr): Don't add REF_ARRAY for dimensionful
1563         functions, which are used as procedure pointer target.
1564
1565 2014-02-18  Tobias Burnus  <burnus@net-b.de>
1566
1567         PR fortran/49397
1568         * expr.c (gfc_check_pointer_assign): Add check for
1569         F2008Cor2, C729.
1570         * trans-decl.c (gfc_get_symbol_decl): Correctly generate external
1571         decl in a corner case.
1572
1573 2014-02-18  Janus Weil  <janus@gcc.gnu.org>
1574
1575         PR fortran/60231
1576         * resolve.c (check_generic_tbp_ambiguity): Check for presence of dummy
1577         arguments to prevent ICE.
1578
1579 2014-02-17  Janus Weil  <janus@gcc.gnu.org>
1580
1581         PR fortran/55907
1582         * resolve.c (build_default_init_expr): Don't initialize character
1583         variable if -fno-automatic is given.
1584
1585 2014-02-15  Mikael Morin  <mikael@gcc.gnu.org>
1586
1587         PR fortran/59599
1588         * trans-intrinsic.c (gfc_conv_intrinsic_ichar): Calculate the
1589         number of arguments.
1590
1591 2014-02-11  Jakub Jelinek  <jakub@redhat.com>
1592
1593         PR fortran/52370
1594         * trans-decl.c (gfc_build_dummy_array_decl): Set TREE_NO_WARNING
1595         on decl if sym->attr.optional.
1596
1597 2014-02-09  Paul Thomas  <pault@gcc.gnu.org>
1598
1599         PR fortran/57522
1600         * resolve.c (resolve_assoc_var): Set the subref_array_pointer
1601         attribute for the 'associate-name' if necessary.
1602         * trans-stmt.c (trans_associate_var): If the 'associate-name'
1603         is a subref_array_pointer, assign the element size of the
1604         associate variable to 'span'.
1605
1606 2014-02-09  Paul Thomas  <pault@gcc.gnu.org>
1607
1608         PR fortran/59026
1609         * trans-expr.c (gfc_conv_procedure_call): Pass the value of the
1610         actual argument to a formal argument with the value attribute
1611         in an elemental procedure.
1612
1613 2014-02-08  Janus Weil  <janus@gcc.gnu.org>
1614             Mikael Morin <mikael.morin@gcc.gnu.org>
1615
1616         PR fortran/58470
1617         * class.c (generate_finalization_wrapper): Assert that proc_tree has
1618         been set in gfc_resolve_finalizers.
1619         * resolve.c (resolve_fl_derived0): Remove unnecessary call to
1620         gfc_is_finalizable.
1621
1622 2014-02-07  Benno Schulenberg  <bensberg@justemail.net>
1623
1624         PR translation/52289
1625         * fortran/resolve.c (resolve_ordinary_assign): Fix typoed word
1626         in an error message.
1627
1628 2014-02-02  Mikael Morin  <mikael@gcc.gnu.org>
1629
1630         PR fortran/57033
1631         * primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
1632         dereference.
1633
1634 2014-02-01  Paul Thomas  <pault@gcc.gnu.org>
1635
1636         PR fortran/59906
1637         * trans-stmt.c (gfc_add_loop_ss_code): In the case of character
1638         SS_REFERENCE, use gfc_conv_string_parameter to ensure that a
1639         pointer to the string is stored.
1640         * trans-expr.c (gfc_conv_expr_reference): Likewise, use
1641         gfc_conv_string_parameter to ensure that a pointer to is passed
1642         to the elemental function.
1643
1644 2014-01-28  Paul Thomas  <pault@gcc.gnu.org>
1645
1646         PR fortran/59414
1647         * trans-stmt.c (gfc_trans_allocate): Before the pointer
1648         assignment to transfer the source _vptr to a class allocate
1649         expression, the final class reference should be exposed. The
1650         tail that includes the _data and array references is stored.
1651         This reduced expression is transferred to 'lhs' and the _vptr
1652         added. Then the tail is restored to the allocate expression.
1653
1654 2014-01-26  Mikael Morin  <mikael@gcc.gnu.org>
1655
1656         PR fortran/58007
1657         * module.c (read_module): Assert for component name correctness.
1658
1659 2014-01-18  Mikael Morin  <mikael@gcc.gnu.org>
1660
1661         PR fortran/58007
1662         * module.c (MOD_VERSION): Bump.
1663         (fp2, find_pointer2): Remove.
1664         (mio_component_ref): Don't forcedfully set the containing derived type
1665         symbol for loading.  Remove unused argument.
1666         (mio_ref): Update caller
1667         (mio_symbol): Dump component list earlier.
1668         (skip_list): New argument nest_level.  Initialize level with the new
1669         argument.
1670         (read_module): Add forced pointer components association for derived
1671         type symbols.
1672
1673 2014-01-12  Janus Weil  <janus@gcc.gnu.org>
1674
1675         PR fortran/58026
1676         * decl.c (gfc_match_data_decl): Improve error recovery.
1677
1678 2014-01-09  Tobias Burnus  <burnus@net-b.de>
1679
1680         * cpp.c (gfc_cpp_handle_option): Add missing break.
1681         * trans-io.c (transfer_expr): Silence unused value warning.
1682
1683 2014-01-08  Janus Weil  <janus@gcc.gnu.org>
1684
1685         PR fortran/58182
1686         * resolve.c (gfc_verify_binding_labels): Modify order of checks.
1687
1688 2014-01-06  Janus Weil  <janus@gcc.gnu.org>
1689
1690         PR fortran/59589
1691         * class.c (comp_is_finalizable): New function to dermine if a given
1692         component is finalizable.
1693         (finalize_component, generate_finalization_wrapper): Use it.
1694
1695 2014-01-06  Janus Weil  <janus@gcc.gnu.org>
1696
1697         PR fortran/59023
1698         PR fortran/59662
1699         * resolve.c (resolve_global_procedure): Don't apply to c-binding
1700         procedures.
1701         (gfc_verify_binding_labels): Remove duplicate line.
1702
1703 2014-01-04  Janus Weil  <janus@gcc.gnu.org>
1704
1705         PR fortran/59547
1706         * class.c (add_proc_comp): Copy pure attribute.
1707
1708 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1709
1710         Update copyright years
1711
1712 2014-01-02  Tobias Burnus  <burnus@net-b.de>
1713
1714         * gfortranspec.c (lang_specific_driver): Update copyright notice
1715         dates.
1716         * gfc-internals.texi: Bump @copying's copyright year.
1717         * gfortran.texi: Ditto.
1718         * intrinsic.texi: Ditto.
1719         * invoke.texi: Ditto.
1720
1721 2014-01-02  Janus Weil  <janus@gcc.gnu.org>
1722
1723         PR fortran/59654
1724         * resolve.c (resolve_typebound_procedures): No need to create the vtab
1725         here.
1726 \f
1727 Copyright (C) 2014 Free Software Foundation, Inc.
1728
1729 Copying and distribution of this file, with or without modification,
1730 are permitted in any medium without royalty provided the copyright
1731 notice and this notice are preserved.