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