]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years agoFix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)
Julian Brown [Tue, 26 Feb 2019 22:22:41 +0000 (14:22 -0800)] 
Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)

2018-08-28  Julian Brown  <julian@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>

gcc/
* gimplify.c (oacc_array_mapping_info): New struct.
(gimplify_omp_ctx): Add decl_data_clause hash map.
(new_omp_context): Zero-initialise above.
(delete_omp_context): Delete above if allocated.
(gimplify_scan_omp_clauses): Scan for array mappings on data constructs,
and record in above map.
(gomp_oacc_needs_data_present): New function.
(gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array
slices) declared in lexically-enclosing data constructs.
* omp-low.c (lower_omp_target): Allow decl for bias not to be present
in OpenACC context.

gcc/testsuite/
* c-c++-common/goacc/acc-data-chain.c: New test.
* gfortran.dg/goacc/pr70828.f90: New test.
* gfortran.dg/goacc/pr70828-2.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/pr70828.c: New test.
* testsuite/libgomp.oacc-fortran/implicit_copy.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70828.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70828-2.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70828-3.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70828-4.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70828-5.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70828-6.f90: New test.

(cherry picked from openacc-gcc-9-branch commit
846842be6a21b3e0818441dd2454ea1f05c8ab86)

5 years agoDefault compute dimensions (compile time)
Julian Brown [Tue, 26 Feb 2019 22:12:06 +0000 (14:12 -0800)] 
Default compute dimensions (compile time)

Typo fix relative to last posted version.

2018-10-05  Nathan Sidwell  <nathan@acm.org>
    Tom de Vries  <tdevries@suse.de>
    Thomas Schwinge  <thomas@codesourcery.com>
    Julian Brown  <julian@codesourcery.com>

gcc/
* doc/invoke.texi (fopenacc-dim): Update.
* omp-offload.c (oacc_parse_default_dims): Update.
(oacc_validate_dims): Emit warnings about strange partitioning choices.

gcc/testsuite/
* c-c++-common/goacc/acc-icf.c: Update.
* c-c++-common/goacc/parallel-dims-1.c: Likewise.
* c-c++-common/goacc/parallel-reduction.c: Likewise.
* c-c++-common/goacc/pr70688.c: Likewise.
* c-c++-common/goacc/routine-1.c: Likewise.
* c-c++-common/goacc/uninit-dim-clause.c: Likewise.
* gfortran.dg/goacc/parallel-tree.f95: Likewise.
* gfortran.dg/goacc/routine-4.f90: Likewise.
* gfortran.dg/goacc/routine-level-of-parallelism-1.f90: Likewise.
* gfortran.dg/goacc/uninit-dim-clause.f95: Likewise.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Add -w.
* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-warn-1.c: New.
* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Update.
* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/mode-transitions.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/private-variables.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: Likewise.
* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/pr84028.f90: Likewise.
* testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
* testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-default-compile.c: New.

(cherry picked from openacc-gcc-9-branch commit
0dd9e6ac878a47ebf021b700e56d4a8d31938bd1)

5 years agoGenerate sequential loop for OpenACC loop directive inside kernels
Julian Brown [Tue, 26 Feb 2019 21:39:03 +0000 (13:39 -0800)] 
Generate sequential loop for OpenACC loop directive inside kernels

2019-09-20  Chung-Lin Tang <cltang@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

gcc/
* omp-expand.c (struct omp_region): Add inside_kernels_p field.
(expand_omp_for_generic): Adjust to generate a 'sequential' loop
when GOMP builtin arguments are BUILT_IN_NONE.
(expand_omp_for): Use expand_omp_for_generic to generate a
non-parallelized loop for OMP_FORs inside OpenACC kernels regions.
(expand_omp): Mark inside_kernels_p field true for regions
nested inside OpenACC kernels constructs.
gcc/testsuite/
* c-c++-common/goacc/kernels-loop-acc-loop.c: New test.
* c-c++-common/goacc/kernels-loop-2-acc-loop.c: New test.
* c-c++-common/goacc/kernels-loop-3-acc-loop.c: New test.
* c-c++-common/goacc/kernels-loop-n-acc-loop.c: New test.
* c-c++-common/goacc/kernels-acc-loop-reduction.c: New test.
* c-c++-common/goacc/kernels-acc-loop-smaller-equal.c: New test.

(cherry picked from openacc-gcc-9-branch commit
691d1aa4a69aac5230ada0f116efee445a2ea4fe)

5 years agoReinstate kernels-restrict behaviour
Julian Brown [Wed, 6 Mar 2019 22:44:56 +0000 (14:44 -0800)] 
Reinstate kernels-restrict behaviour

This patch contains a small fix for upstream churn relative to the last version
posted.

2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>
    Julian Brown  <julian@codesourcery.com>

* omp-low.c (install_var_field): New base_pointer_restrict
argument.
(scan_sharing_clauses): Update call to install_var_field.
(omp_target_base_pointers_restrict_p): New function.
(scan_omp_target): Update call to install_var_field.

(cherry picked from openacc-gcc-9-branch commit
99a4260fe264624136eda666363464eba48bdc3e)

5 years agoAdjustments and additions to testcases
Julian Brown [Tue, 26 Feb 2019 21:18:36 +0000 (13:18 -0800)] 
Adjustments and additions to testcases

Some additions of redundant "present" clauses dropped.

2018-10-22  Cesar Philippidis  <cesar@codesourcery.com>

gcc/testsuite/
* g++.dg/goacc/loop-1.c: New test.
* g++.dg/goacc/loop-2.c: New test.
* g++.dg/goacc/loop-3.c: New test.

2018-10-22  James Norris  <jnorris@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>
    Tom de Vries  <tom@codesourcery.com>

libgomp/
* testsuite/libgomp.oacc-c-c++-common/data-2.c: Update parallel
regions to denote variables copyied in via acc enter data as
present.
* testsuite/libgomp.oacc-fortran/data-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/data-4.f90: Likewise.
* testsuite/libgomp.oacc-c-c++-common/subr.h: Reimplement.
* testsuite/libgomp.oacc-c-c++-common/subr.ptx: Regenerated PTX.
* testsuite/libgomp.oacc-c-c++-common/timer.h: Removed.
* testsuite/libgomp.oacc-c-c++-common/lib-69.c: Change async checks.
* testsuite/libgomp.oacc-c-c++-common/lib-70.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-71.c: Rework kernel i/f.
* testsuite/libgomp.oacc-c-c++-common/lib-72.c: Rework kernel i/f and
change async checks.
* testsuite/libgomp.oacc-c-c++-common/lib-73.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-74.c: Rework kernel i/f and
timing checks.
* testsuite/libgomp.oacc-c-c++-common/lib-75.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-76.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-77.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-78.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-79.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-80.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-81.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-82.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-93.c: New test.

(cherry picked from openacc-gcc-9-branch commit
18e5e71a03b69316246a417f5d957cbaa64245a5)

5 years agoVarious OpenACC reduction enhancements - test cases
Julian Brown [Tue, 12 Feb 2019 23:14:22 +0000 (15:14 -0800)] 
Various OpenACC reduction enhancements - test cases

2018-12-13  Cesar Philippidis  <cesar@codesourcery.com>
            Nathan Sidwell  <nathan@acm.org>
            Julian Brown  <julian@codesourcery.com>

        gcc/testsuite/
        * c-c++-common/goacc/orphan-reductions-1.c: New test.
        * c-c++-common/goacc/reduction-7.c: New test.
        * c-c++-common/goacc/routine-4.c: Update.
        * g++.dg/goacc/reductions-1.C: New test.
        * gcc.dg/goacc/loop-processing-1.c: Update.
        * gfortran.dg/goacc/orphan-reductions-1.f90: New test.

        libgomp/
        * libgomp.oacc-c-c++-common/par-reduction-3.c: New test.
        * libgomp.oacc-c-c++-common/reduction-cplx-flt-2.c: New test.
        * libgomp.oacc-fortran/reduction-9.f90: New test.

(cherry picked from openacc-gcc-9-branch commit
e3cdb913b543ebd719dc8fe33f92f504c141d9f6)

5 years agoVarious OpenACC reduction enhancements - ME and nvptx changes
Julian Brown [Tue, 12 Feb 2019 23:06:55 +0000 (15:06 -0800)] 
Various OpenACC reduction enhancements - ME and nvptx changes

Parts of the first posting got lost in the second posting, above.
This version hopefully contains everything.

2018-10-30  Cesar Philippidis  <cesar@codesourcery.com>

gcc/
* config/nvptx/nvptx.c (nvptx_propagate_unified): New.
(nvptx_split_blocks): Call it for cond_uni insn.
(nvptx_expand_cond_uni): New.
(enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI.
(nvptx_init_builtins): Initialize it.
(nvptx_expand_builtin):
(nvptx_generate_vector_shuffle): Change integral SHIFT operand to
tree BITS operand.
(nvptx_vector_reduction): New.
(nvptx_adjust_reduction_type): New.
(nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res.
(nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist.
(nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector.
Use it to adjust the type of ref_to_res.
(nvptx_goacc_reduction_teardown):
* config/nvptx/nvptx.md (cond_uni): New pattern.

(cherry picked from openacc-gcc-9-branch commit
6f456aa7d21e587debff82f3cbf89750528018d1)

5 years agoVarious OpenACC reduction enhancements - FE changes
Julian Brown [Tue, 12 Feb 2019 22:56:12 +0000 (14:56 -0800)] 
Various OpenACC reduction enhancements - FE changes

This version differs somewhat from the last version posted upstream
(and addresses some of Jakub's review comments).

2018-12-13  Cesar Philippidis  <cesar@codesourcery.com>
            Nathan Sidwell  <nathan@acm.org>
            Julian Brown  <julian@codesourcery.com>

        gcc/c/
        * c-parser.c (c_parser_omp_variable_list): New c_omp_region_type
        argument.  Use it to specialize handling of OMP_CLAUSE_REDUCTION for
        OpenACC.
(c_parser_oacc_data_clause): Add region-type argument.
(c_parser_oacc_data_clause_deviceptr): Likewise.
        (c_parser_omp_clause_reduction): Change is_omp boolean parameter to
        c_omp_region_type.  Update call to c_parser_omp_variable_list.
        (c_parser_oacc_all_clauses): Update calls to
        c_parser_omp_clause_reduction.
        (c_parser_omp_all_clauses): Likewise.
(c_parser_oacc_cache): Update call to c_parser_omp_var_list_parens.
        * c-typeck.c (c_finish_omp_clauses): Emit an error on orphan OpenACC
        gang reductions.  Suppress user-defined reduction error for OpenACC.

        gcc/cp/
        * parser.c (cp_parser_omp_var_list_no_open):  New c_omp_region_type
        argument.  Use it to specialize handling of OMP_CLAUSE_REDUCTION for
        OpenACC.
(cp_parser_omp_var_list): Add c_omp_region_type argument. Update call
to cp_parser_omp_var_list_parens.
(cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
        (cp_parser_omp_clause_reduction): Change is_omp boolean parameter to
        c_omp_region_type.  Update call to cp_parser_omp_var_list_no_open.
        (cp_parser_oacc_all_clauses): Update call to
        cp_parser_omp_clause_reduction.
        (cp_parser_omp_all_clauses): Likewise.
        * semantics.c (finish_omp_reduction_clause): Add c_omp_region_type
argument.  Suppress user-defined reduction error for OpenACC.
(finish_omp_clauses): Emit an error on orphan OpenACC gang reductions.

        gcc/fortran/
        * openmp.c (resolve_oacc_loop_blocks): Emit an error on orphan OpenACC
        gang reductions.
        * trans-openmp.c (gfc_omp_clause_copy_ctor): Permit reductions.

(cherry picked from openacc-gcc-9-branch commit
533beb2ec19f8486e4b1b645a153746f96b41f04)

5 years agoAdd OpenACC Fortran support for deviceptr and variable in common blocks
Julian Brown [Tue, 12 Feb 2019 22:32:34 +0000 (14:32 -0800)] 
Add OpenACC Fortran support for deviceptr and variable in common blocks

2018-06-29  Cesar Philippidis  <cesar@codesourcery.com>
    James Norris  <jnorris@codesourcery.com>

gcc/fortran/
* openmp.c (gfc_match_omp_map_clause): Re-write handling of the
deviceptr clause.  Add new common_blocks argument.  Propagate it to
gfc_match_omp_variable_list.
(gfc_match_omp_clauses): Update calls to gfc_match_omp_map_clauses.
(resolve_positive_int_expr): Promote the warning to an error.
(check_array_not_assumed): Remove pointer check.
(resolve_oacc_nested_loops): Error on do concurrent loops.
* trans-openmp.c (gfc_omp_finish_clause): Don't create pointer data
mappings for deviceptr clauses.
(gfc_trans_omp_clauses): Likewise.

gcc/
* gimplify.c (enum gimplify_omp_var_data): Add GOVD_DEVICETPR.
(oacc_default_clause): Privatize fortran common blocks.
(omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate.
Defer the expansion of DECL_VALUE_EXPR for common block decls.
(gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when
appropriate.
(gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for
implicit deviceptr mappings.

gcc/testsuite/
* c-c++-common/goacc/deviceptr-4.c: Update.
* gfortran.dg/goacc/common-block-1.f90: New test.
* gfortran.dg/goacc/common-block-2.f90: New test.
* gfortran.dg/goacc/loop-2.f95: Update.
* gfortran.dg/goacc/loop-3-2.f95: Update.
* gfortran.dg/goacc/loop-3.f95: Update.
* gfortran.dg/goacc/loop-5.f95: Update.
* gfortran.dg/goacc/pr72715.f90: New test.
* gfortran.dg/goacc/sie.f95: Update.
* gfortran.dg/goacc/tile-1.f90: Update.
* gfortran.dg/gomp/pr77516.f90: Update.

libgomp/
* oacc-parallel.c (GOACC_parallel_keyed): Handle Fortran deviceptr
clause.
(GOACC_data_start): Likewise.
* testsuite/libgomp.oacc-fortran/common-block-1.f90: New test.
* testsuite/libgomp.oacc-fortran/common-block-2.f90: New test.
* testsuite/libgomp.oacc-fortran/common-block-3.f90: New test.
* testsuite/libgomp.oacc-fortran/deviceptr-1.f90: New test.

(cherry picked from openacc-gcc-9-branch commit
ac6c90812344f4f4cfe4d2f5901c1a9d038a4000)

5 years agoTweak error return value for acc_set_cuda_stream.
Julian Brown [Tue, 12 Feb 2019 14:36:03 +0000 (06:36 -0800)] 
Tweak error return value for acc_set_cuda_stream.

The return value of acc_set_cuda_stream is unspecified in OpenACC 2.6.
The testsuite changes might be unnecessary with the current async code.

libgomp/
* oacc-cuda.c (acc_set_cuda_stream): Return 0 on error/invalid
arguments.
* testsuite/libgomp.oacc-c-c++-common/lib-84.c: Handle unnumbered
async stream being an alias for a numbered async stream.
* testsuite/libgomp.oacc-c-c++-common/lib-85.c: Likewise.

(cherry picked from openacc-gcc-9-branch commit
6b0f72aad2030b3efa651652d75ad3d3cc9a76f6)

5 years agoUse oacc_verify_routine_clauses for C/C++
Julian Brown [Thu, 7 Feb 2019 13:19:53 +0000 (05:19 -0800)] 
Use oacc_verify_routine_clauses for C/C++

2018-10-02  Thomas Schwinge  <thomas@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

gcc/
* omp-general.c (oacc_build_routine_dims): Move some of its
processing into...
(oacc_verify_routine_clauses): ... this new function.
* omp-general.h (oacc_verify_routine_clauses): New prototype.

gcc/c/
* c-parser.c (c_parser_oacc_routine): Normalize order of clauses.
(c_finish_oacc_routine): Call oacc_verify_routine_clauses.

gcc/cp/
* parser.c (cp_parser_oacc_routine)
(cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
(cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.

gcc/testsuite/
* c-c++-common/goacc/routine-level-of-parallelism-1.c: New test.

(cherry picked from openacc-gcc-9-branch commit
1cf459e23c2048b5800cd06e96a6041c17fabbc7)

5 years agoAdd support for OpenACC routine nohost clause
Julian Brown [Thu, 7 Feb 2019 01:46:25 +0000 (17:46 -0800)] 
Add support for OpenACC routine nohost clause

2018-10-02  Thomas Schwinge  <thomas@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

gcc/
* tree-core.h (omp_clause_code): Add OMP_CLAUSE_NOHOST.
* tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
Update for these.
* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_NOHOST.
* gimplify.c (gimplify_scan_omp_clauses)
(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NOHOST.
* tree-nested.c (convert_nonlocal_omp_clauses)
(convert_local_omp_clauses): Likewise.
* omp-low.c (scan_sharing_clauses): Likewise.
* omp-offload.c (maybe_discard_oacc_function): New function.
(execute_oacc_device_lower) [!ACCEL_COMPILER]: Handle OpenACC
nohost clauses.

gcc/c-family/
* c-attribs.c (c_common_attribute_table): Set min_len to -1 for
"omp declare target".
* c-pragma.h (pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_NOHST.

gcc/c/
* c-parser.c (c_parser_omp_clause_name): Handle "nohost".
(c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_NOHOST.
(c_parser_oacc_routine, c_finish_oacc_routine): Update.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_NOHOST.

gcc/cp/
* parser.c (cp_parser_omp_clause_name): Handle "nohost".
(cp_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_NOHOST,
(cp_parser_oacc_routine, cp_finalize_oacc_routine): Update.
* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_NOHOST.
* semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_NOHOST.

gcc/fortran/
* gfortran.h (gfc_omp_clauses): Add nohost members.
* openmp.c (omp_mask2): Add OMP_CLAUSE_NOHOST.
(gfc_match_omp_clauses): Handle OMP_CLAUSE_NOHOST.
(gfc_match_oacc_routine): Set oacc_function_nohost when appropriate.
* gfortran.h (symbol_attribute): Add oacc_function_nohost member.
* trans-openmp.c (gfc_add_omp_offload_attributes): Use it to decide
whether to generate an OMP_CLAUSE_NOHOST clause.
(gfc_trans_omp_clauses_1): Unreachable code to generate an
OMP_CLAUSE_NOHOST clause.

gcc/testsuite/
* c-c++-common/goacc/classify-routine.c: Adjust test.
* c-c++-common/goacc/routine-1.c: Likewise.
* c-c++-common/goacc/routine-2.c: Likewise.
* c-c++-common/goacc/routine-nohost-1.c: New test.
* g++.dg/goacc/routine-2.C: Adjust test.
* gfortran.dg/goacc/pr72741.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/routine-3.c: New test.
* testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/routine-bind-nohost-1.c:
Update test.
* testsuite/libgomp.oacc-fortran/routine-6.f90: Likewise.

(cherry picked from openacc-gcc-9-branch commit
a6ec4f19ff50a91a7b0a8c3663e49c071b506016)

5 years agoInteraction of dynamic/multidimensional arrays with attach/detach.
Julian Brown [Tue, 5 Feb 2019 21:43:21 +0000 (13:43 -0800)] 
Interaction of dynamic/multidimensional arrays with attach/detach.

gcc/
* omp-low.c (scan_sharing_clauses): Disallow dynamic (multidimensional)
arrays within structs.

gcc/testsuite/
* c-c++-common/goacc/deep-copy-multidim.c: Add test.

(cherry picked from openacc-gcc-9-branch commit
857f3bc94d843467db9857b82512a1a5a470b1ef)

5 years ago[8/8] Multi-dimensional dynamic array support for OpenACC data clauses, libgomp tests...
Julian Brown [Tue, 5 Feb 2019 20:51:36 +0000 (12:51 -0800)] 
[8/8] Multi-dimensional dynamic array support for OpenACC data clauses, libgomp testsuite additions

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

libgomp/
* testsuite/libgomp.oacc-c-c++-common/da-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/da-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/da-3.c: New test.
* testsuite/libgomp.oacc-c-c++-common/da-4.c: New test.
* testsuite/libgomp.oacc-c-c++-common/da-utils.h: New test.

(cherry picked from openacc-gcc-9-branch commit
26413f817be2e0e0ec02333930c3d01acea4f1c7)

5 years ago[7/8] Multi-dimensional dynamic array support for OpenACC data clauses, libgomp support
Julian Brown [Thu, 14 Mar 2019 21:25:15 +0000 (14:25 -0700)] 
[7/8] Multi-dimensional dynamic array support for OpenACC data clauses, libgomp support

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

libgomp/
* target.c (struct da_dim): New struct declaration.
(struct da_descr_type): Likewise.
(struct da_info): Likewise.
(gomp_dynamic_array_count_rows): New function.
(gomp_dynamic_array_compute_info): Likewise.
(gomp_dynamic_array_fill_rows_1): Likewise.
(gomp_dynamic_array_fill_rows): Likewise.
(gomp_dynamic_array_create_ptrblock): Likewise.
(gomp_map_vars): Add code to handle dynamic array map kinds.

(cherry picked from openacc-gcc-9-branch commit
e2266a0a7f99e40ca91bdc70174426a249b3dd7a)

5 years ago[6/8] Multi-dimensional dynamic array support for OpenACC data clauses, tree pretty...
Julian Brown [Tue, 5 Feb 2019 15:38:41 +0000 (07:38 -0800)] 
[6/8] Multi-dimensional dynamic array support for OpenACC data clauses, tree pretty-printing additions

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/
* tree-pretty-print.c (dump_omp_clauses): Add cases for printing
GOMP_MAP_DYNAMIC_ARRAY map kinds.

(cherry picked from openacc-gcc-9-branch commit
1851ac580e2727cd8d2a3a8793e19fc02e8716b4)

5 years ago[5/8] Multi-dimensional dynamic array support for OpenACC data clauses, omp-low:...
Julian Brown [Tue, 5 Feb 2019 15:37:12 +0000 (07:37 -0800)] 
[5/8] Multi-dimensional dynamic array support for OpenACC data clauses, omp-low: bias scanning/adjustment during omp-lowering

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/
* omp-low.c (dynamic_array_lookup): New function.
(dynamic_array_reference_start): Likewise.
(scan_for_op): Likewise.
(scan_for_reference): Likewise.
(da_create_bias): Likewise.
(da_dimension_peel): Likewise.
(lower_omp_1): Add case to look for start of dynamic array reference,
and handle bias adjustments for the code sequence.

(cherry picked from openacc-gcc-9-branch commit
b84089be096efbaf5bd7825074df215e22eb9d14)

5 years ago[4/8] Multi-dimensional dynamic array support for OpenACC data clauses, omp-low:...
Julian Brown [Tue, 5 Feb 2019 15:35:18 +0000 (07:35 -0800)] 
[4/8] Multi-dimensional dynamic array support for OpenACC data clauses, omp-low: dynamic array descriptor creation

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/
* omp-low.c (struct omp_context):
Add 'hash_map<tree_operand_hash, tree> *dynamic_arrays' field, also
added include of "tree-hash-traits.h".
(append_field_to_record_type): New function.
(create_dynamic_array_descr_type): Likewise.
(create_dynamic_array_descr_init_code): Likewise.
(new_omp_context): Add initialize of dynamic_arrays field.
(delete_omp_context): Add delete of dynamic_arrays field.
(scan_sharing_clauses): For dynamic array map kinds, check for
supported dimension structure, and install dynamic array variable into
current omp_context.
(lower_omp_target): Add handling for dynamic array map kinds.

(cherry picked from openacc-gcc-9-branch commit
428bb933e9720f9f3dcfadbfe7bb499b45c5e6b2)

5 years ago[3/8] Multi-dimensional dynamic array support for OpenACC data clauses, gimplify...
Julian Brown [Tue, 5 Feb 2019 15:33:25 +0000 (07:33 -0800)] 
[3/8] Multi-dimensional dynamic array support for OpenACC data clauses, gimplify patch

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/
* gimplify.c (gimplify_scan_omp_clauses): For dynamic array map kinds,
make sure bias in each dimension are put into firstprivate variables.

(cherry picked from openacc-gcc-9-branch commit
a9cde8c122c4dc48bd8aad71e0c543e07b08a4ca)

5 years ago[2/8] Multi-dimensional dynamic array support for OpenACC data clauses, C/C++ front...
Julian Brown [Tue, 5 Feb 2019 15:32:29 +0000 (07:32 -0800)] 
[2/8] Multi-dimensional dynamic array support for OpenACC data clauses, C/C++ front-end parts

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/c/
* c-typeck.c (handle_omp_array_sections_1): Add 'bool &non_contiguous'
parameter, adjust recursive call site, add cases for allowing
pointer based multi-dimensional arrays for OpenACC.
(handle_omp_array_sections): Adjust handle_omp_array_sections_1 call,
handle non-contiguous case to create dynamic array map.

gcc/cp/
* semantics.c (handle_omp_array_sections_1): Add 'bool &non_contiguous'
parameter, adjust recursive call site, add cases for allowing
pointer based multi-dimensional arrays for OpenACC.
(handle_omp_array_sections): Adjust handle_omp_array_sections_1 call,
handle non-contiguous case to create dynamic array map.

(cherry picked from openacc-gcc-9-branch commit
245dc26efd584c444902fd5453b79a6efebd0e57)

5 years ago[1/8] Multi-dimensional dynamic array support for OpenACC data clauses, gomp-constant...
Julian Brown [Tue, 5 Feb 2019 14:25:31 +0000 (06:25 -0800)] 
[1/8] Multi-dimensional dynamic array support for OpenACC data clauses, gomp-constants.h additions

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

include/
* gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_3): Define.
(enum gomp_map_kind): Add GOMP_MAP_DYNAMIC_ARRAY,
GOMP_MAP_DYNAMIC_ARRAY_TO, GOMP_MAP_DYNAMIC_ARRAY_FROM,
GOMP_MAP_DYNAMIC_ARRAY_TOFROM, GOMP_MAP_DYNAMIC_ARRAY_FORCE_TO,
GOMP_MAP_DYNAMIC_ARRAY_FORCE_FROM, GOMP_MAP_DYNAMIC_ARRAY_FORCE_TOFROM,
GOMP_MAP_DYNAMIC_ARRAY_ALLOC, GOMP_MAP_DYNAMIC_ARRAY_FORCE_ALLOC,
GOMP_MAP_DYNAMIC_ARRAY_FORCE_PRESENT.
(GOMP_MAP_DYNAMIC_ARRAY_P): Define.

(cherry picked from openacc-gcc-9-branch commit
378239a91cd9d2253991edd85c777b377d312c0e)

5 years ago[og8] Attach/detach array slices on dereferenced struct members
Julian Brown [Thu, 31 Jan 2019 16:39:15 +0000 (08:39 -0800)] 
[og8] Attach/detach array slices on dereferenced struct members

A couple of fixes folded in relative to og8 version.

2019-01-31  Julian Brown  <julian@codesourcery.com>

gcc/c/
* c-typeck.c (handle_omp_array_sections_1): Handle chained dereferences.
(c_finish_omp_clauses): Likewise.

gcc/cp/
* semantics.c (handle_omp_array_sections_1): Handle array section on
dereferenced struct member.
(finish_omp_clauses): Don't error on multiple dereferenced struct
elements with the same base.

gcc/
* gimplify.c (gimplify_scan_omp_clauses): Handle array sections on
dereferenced struct members.

gcc/testsuite/
* c-c++-common/goacc/deep-copy-arrayofstruct.c: New test.

libgomp/
* testsuite/libgomp.oacc-c++/deep-copy-12.C: New test.
* testsuite/libgomp.oacc-c++/deep-copy-13.C: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-9.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-11.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-14.c: New test.

(cherry picked from openacc-gcc-9-branch commit
ad36f2e3a8ad481c6bbd6376a1ab25fce1da4d8d)

5 years agoOpenACC reference count consistency checking
Julian Brown [Fri, 30 Nov 2018 10:40:49 +0000 (02:40 -0800)] 
OpenACC reference count consistency checking

2018-11-28  Julian Brown  <julian@codesourcery.com>

libgomp/
* libgomp.h (RC_CHECKING): New macro, disabled by default, guarding all
hunks in this patch.
(target_mem_desc): Add forward declaration.
(async_tgt_use): New struct.
(target_mem_desc): Add refcount_chk, mark fields.
(acc_dispatch_t): Add tgt_uses, au_lock fields.
(dump_tgt, gomp_rc_check): Add prototypes.
* oacc-async (goacc_async_unmap_tgt): Add refcount self-check code.
(goacc_async_copyout_unmap_vars): Likewise.
(goacc_remove_var_async): Likewise.
* oacc-parallel.c (GOACC_parallel_keyed_internal): Add refcount
self-check code.
(GOACC_data_start, GOACC_data_end, GOACC_enter_exit_data): Likewise.
* target.c (stdio.h): Include.
(dump_tgt, rc_check_clear, rc_check_count, rc_check_verify)
(gomp_rc_check): New functions to consistency-check reference counts.
(gomp_target_init): Initialise self-check-related device fields.

(cherry picked from openacc-gcc-9-branch commit
ee87cb3436ca56c7ebe96768f7d13e3d959fbbd5)

5 years agoOpenACC 2.6 manual deep copy support (attach/detach)
Julian Brown [Fri, 4 Jan 2019 01:58:51 +0000 (17:58 -0800)] 
OpenACC 2.6 manual deep copy support (attach/detach)

2018-12-14  Julian Brown  <julian@codesourcery.com>

gcc/c-family/
* c-pragma.h (pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_ATTACH and
PRAGMA_OACC_CLAUSE_DETACH.
* c-common.h (c_omp_map_clause_name): Add prototype.
* c-omp.c (c_omp_map_clause_name): New function.

gcc/c/
* c-parser.c (c_parser_omp_clause_name): Add parsing of attach and
detach clauses.
(c_parser_omp_variable_list): Add ALLOW_DEREF optional parameter.
Allow deref (->) in variable lists if true.
(c_parser_omp_var_list_parens): Add ALLOW_DEREF optional parameter.
Pass to c_parser_omp_variable_list.
(c_parser_oacc_data_clause): Support attach and detach clauses.  Update
call to c_parser_omp_variable_list.
(c_parser_oacc_all_clauses): Support attach and detach clauses.
(OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
(OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK): Add
PRAGMA_OACC_CLAUSE_ATTACH.
(OACC_EXIT_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DETACH.
* c-typeck.c (handle_omp_array_sections_1): Reject subarrays for attach
and detach.  Support deref.
(c_oacc_check_attachments): New function.
(c_finish_omp_clauses): Check attach/detach arguments for being
pointers using above.  Support deref.

gcc/cp/
* parser.c (cp_parser_omp_clause_name): Support attach and detach
clauses.
(cp_parser_omp_var_list_no_open): Add ALLOW_DEREF optional parameter.
Parse deref if true.
(cp_parser_omp_var_list): Add ALLOW_DEREF optional parameter.  Pass to
cp_parser_omp_var_list_no_open.
(cp_parser_oacc_data_clause): Support attach and detach clauses.
Update call to cp_parser_omp_var_list_no_open.
(cp_parser_oacc_all_clauses): Support attach and detach.
(OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
(OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK): Add
PRAGMA_OACC_CLAUSE_ATTACH.
(OACC_EXIT_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DETACH.
* semantics.c (handle_omp_array_sections_1): Reject subarrays for
attach and detach.
(cp_oacc_check_attachments): New function.
(finish_omp_clauses): Use above function.  Allow structure fields and
class members to appear in OpenACC data clauses.  Support deref.

gcc/fortran/
* gfortran.h (gfc_omp_map_op): Add OMP_MAP_ATTACH, OMP_MAP_DETACH.
* openmp.c (gfc_match_omp_variable_list): Add allow_derived parameter.
Parse derived-type member accesses if true.
(omp_mask2): Add OMP_CLAUSE_ATTACH and OMP_CLAUSE_DETACH.
(gfc_match_omp_map_clause): Add allow_derived parameter.  Pass to
gfc_match_omp_variable_list.
(gfc_match_omp_clauses): Support attach and detach.  Support derived
types for appropriate OpenACC directives.
(OACC_PARALLEL_CLAUSES, OACC_KERNELS_CLAUSES, OACC_DATA_CLAUSES)
(OACC_ENTER_DATA_CLAUSES): Add OMP_CLAUSE_ATTACH.
(OACC_EXIT_DATA_CLAUSES): Add OMP_CLAUSE_DETACH.
(check_symbol_not_pointer): Don't disallow pointer objects of derived
type.
(resolve_oacc_data_clauses): Don't disallow allocatable derived types.
(resolve_omp_clauses): Perform duplicate checking only for non-derived
type component accesses (plain variables and arrays or array sections).
Support component refs.
* trans-openmp.c (gfc_omp_privatize_by_reference): Support component
refs.
(gfc_trans_omp_clauses): Support component refs, attach and detach
clauses.

gcc/
* gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_HAS_ATTACHMENTS.
(insert_struct_component_mapping): Support derived-type member mappings
for arrays with descriptors which use GOMP_MAP_TO_PSET.
(gimplify_scan_omp_clauses): Rewrite GOMP_MAP_ALWAYS_POINTER to
GOMP_MAP_ATTACH for OpenACC struct/derived-type component pointers.
Handle pointer mappings that use GOMP_MAP_TO_PSET.  Handle attach/detach
clauses.
(gimplify_adjust_omp_clauses_1): Skip adjustments for explicit
attach/detach clauses.
(gimplify_omp_target_update): Handle finalize for detach.
* omp-low.c (lower_omp_target): Support GOMP_MAP_ATTACH,
GOMP_MAP_DETACH, GOMP_MAP_FORCE_DETACH.
* tree-pretty-print.c (dump_omp_clause): Likewise.

include/
* gomp-constants.h (GOMP_MAP_DEEP_COPY): Define.
(gomp_map_kind): Add GOMP_MAP_ATTACH, GOMP_MAP_DETACH,
GOMP_MAP_FORCE_DETACH.

gcc/testsuite/
* c-c++-common/goacc/mdc-1.c: New test.
* c-c++-common/goacc/mdc-2.c: New test.
* gcc.dg/goacc/mdc.C: New test.
* gfortran.dg/goacc/data-clauses.f95: New test.
* gfortran.dg/goacc/derived-types.f90: New test.
* gfortran.dg/goacc/enter-exit-data.f95: New test.

libgomp/
* libgomp.h (struct target_var_desc): Add do_detach flag.
(VREFCOUNT_LINK_KEY): New macro.
(struct splay_tree_key_s): Put link_key and new attach_count field into
a new union.  Substitute dynamic_refcount field for virtual_refcount.
(struct acc_dispatch_t): Remove data_environ field.
(enum gomp_map_vars_kind): Add GOMP_MAP_VARS_OPENACC_ENTER_DATA.
(gomp_acc_insert_pointer): Remove prototype.
(gomp_acc_remove_pointer): Update prototype.
(struct gomp_coalesce_buf): Add forward declaration.
(gomp_map_val, gomp_attach_pointer, gomp_detach_pointer): Add
prototypes.
* libgomp.map (OACC_2.6): New section. Add acc_attach, acc_attach_async,
acc_detach, acc_detach_async, acc_detach_finalize,
acc_detach_finalize_async.
* oacc-async.c (goacc_remove_var_async): New function.
* oacc-host.c (host_dispatch): Don't initialise removed data_environ
field.
* oacc-init.c (acc_shutdown_1): Use gomp_remove_var instead of
gomp_unmap_vars to remove mappings by splay tree key instead of target
memory descriptor.
* oacc-int.h (splay_tree_key_s): Add forward declaration.
(goacc_remove_var_async): Add prototype.
* oacc-mem.c (lookup_dev_1): New function.
(lookup_dev): Reimplement using above.
(acc_free, acc_hostptr): Update calls to lookup_dev.
(acc_map_data): Likewise.  Don't add to data_environ list.
(acc_unmap_data): Remove call to gomp_unmap_vars.  Fix semantics to
remove mapping, but not mapped data.
(present_create_copy): Use virtual_refcount instead of
dynamic_refcount.  Don't manipulate data_environ.  Fix target pointer
return value.
(delete_copyout): Update for virtual_refcount semantics.  Use
goacc_remove_var_async for asynchronous delete/copyouts.
(gomp_acc_insert_pointer): Remove function.
(gomp_acc_remove_pointer): Reimplement.
(acc_attach_async, acc_attach, goacc_detach_internal, acc_detach)
(acc_detach_async, acc_detach_finalize, acc_detach_finalize_async): New
functions.
* oacc-parallel.c (find_pointer): Support attach/detach.  Make a little
more strict.
(GOACC_parallel_keyed): Use gomp_map_val to calculate device addresses.
(GOACC_enter_exit_data): Support attach/detach and GOMP_MAP_STRUCT.
Don't call gomp_acc_insert_pointer.
* openacc.h (acc_attach, acc_attach_async, acc_detach)
(acc_detach_async, acc_detach_finalize, acc_detach_finalize_async): Add
prototypes.
* target.c (gomp_map_vars_existing): Initialise do_detach field of
tgt_var_desc.
(gomp_attach_pointer, gomp_detach_pointer): New functions.
(gomp_map_val): Make global.
(gomp_map_vars_async): Handle GOMP_MAP_VARS_OPENACC_ENTER_DATA.  Update
for virtual_refcount semantics.  Support attach and detach.
(gomp_remove_var): Free attach count array if present.
(gomp_unmap_vars_async): Support detach and update for virtual_refcount
semantics.  Disambiguate link_key/attach_count using virtual_refcount
with magic value as a tag.
(gomp_load_image_to_device): Zero-initialise virtual_refcount fields.
(gomp_free_memmap): Remove function.
(gomp_exit_data): Check virtual_refcount for tag value before using
link_key.
(omp_target_associate_ptr): Zero-initialise virtual_refcount and
link_key splay tree key fields.
(gomp_target_init): Don't initialise removed data_environ field.
* testsuite/libgomp.oacc-c-c++-common/context-2.c: Use correct API to
deallocate acc_copyin'd data.
* testsuite/libgomp.oacc-c-c++-common/context-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-3.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-4.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-5.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-7.c: New test.
* testsuite/libgomp.oacc-c-c++-common/deep-copy-8.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-1.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-2.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-3.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-4.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-5.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-6.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-7.c: New test.
* testsuite/libgomp.oacc-fortran/deep-copy-8.c: New test.
* testsuite/libgomp.oacc-fortran/data-2.f90: Update test.
* testsuite/libgomp.oacc-fortran/derived-type-1.f90: New test.
* testsuite/libgomp.oacc-fortran/update-2.f90: New test.

(cherry picked from openacc-gcc-9-branch commit
1242d5e6581365913f4dc3968206893970be4d07)

5 years agoFactor out duplicate code in gimplify_scan_omp_clauses
Julian Brown [Mon, 5 Nov 2018 23:51:46 +0000 (15:51 -0800)] 
Factor out duplicate code in gimplify_scan_omp_clauses

2018-11-10  Julian Brown  <julian@codesourcery.com>

gcc/
* gimplify.c (insert_struct_comp_map, check_base_and_compare_lt): New.
(gimplify_scan_omp_clauses): Outline duplicated code into calls to
above two functions.

(cherry picked from openacc-gcc-9-branch commit
e7f6d3b9a0b10f6b86e83bb19cb54ebd8ca61545)

5 years agoHost-to-device transfer coalescing & magic offset value self-documentation
Julian Brown [Mon, 5 Nov 2018 23:11:12 +0000 (15:11 -0800)] 
Host-to-device transfer coalescing & magic offset value self-documentation

2018-11-10  Julian Brown  <julian@codesourcery.com>

libgomp/
* libgomp.h (OFFSET_INLINED, OFFSET_POINTER, OFFSET_STRUCT): Define.
* target.c (FIELD_TGT_EMPTY): Define.
(gomp_map_val): Use OFFSET_* macros instead of magic constants.  Write
as switch instead of list of ifs.
(gomp_map_vars_internal): Use OFFSET_* and FIELD_TGT_EMPTY macros.

(cherry picked from openacc-gcc-9-branch commit
dc9711235460a559ab9bafca5f9b4bae155ac798)

5 years agoAsync rework (v6)
Julian Brown [Tue, 26 Feb 2019 16:41:05 +0000 (08:41 -0800)] 
Async rework (v6)

2019-02-26  Chung-Lin Tang  <cltang@codesourcery.com>

include/
* gomp-constants.h (GOMP_ASYNC_DEFAULT): Define.
(GOMP_PLUGIN_IF_VERSION): New version symbol for plugin interface.
Update surrounding comments.

libgomp/
* target.c (goacc_device_copy_async): New function.
(gomp_copy_host2dev): Remove 'static', add goacc_asyncqueue parameter,
add goacc_device_copy_async case.
(gomp_copy_dev2host): Likewise.
(gomp_map_vars_existing): Add goacc_asyncqueue parameter, adjust code.
(gomp_map_pointer): Likewise.
(gomp_map_fields_existing): Likewise.
(gomp_map_vars_internal): New always_inline function, renamed from
gomp_map_vars.
(gomp_map_vars): Implement by calling gomp_map_vars_internal.
(gomp_map_vars_async): Implement by calling gomp_map_vars_internal,
passing goacc_asyncqueue argument.
(gomp_unmap_tgt): Remove statis, add attribute_hidden.
(gomp_unmap_vars_internal): New always_inline function, renamed from
gomp_unmap_vars.
(gomp_unmap_vars): Implement by calling gomp_unmap_vars_internal.
(gomp_unmap_vars_async): Implement by calling gomp_unmap_vars_internal,
passing goacc_asyncqueue argument.
(gomp_fini_device): New function.
(gomp_exit_data): Adjust gomp_copy_dev2host call.
(gomp_load_plugin_for_device): Remove old interface, adjust to load
new async interface.
(gomp_target_fini): Adjust code to call gomp_fini_device.

* oacc-async.c (get_goacc_thread): New function.
(get_goacc_thread_device): New function.
(lookup_goacc_asyncqueue): New function.
(validate_async_val): New function.
(lookup_goacc_asyncqueue): New function.
(get_goacc_asyncqueue): New function.
(acc_async_test): Adjust code to use new async design.
(acc_async_test_all): Likewise.
(acc_wait): Likewise.
(acc_wait_async): Likewise.
(acc_wait_all): Likewise.
(acc_wait_all_async): Likewise.
(acc_get_default_async): New API function.
(acc_set_default_async): Likewise.
(goacc_async_unmap_tgt): New function.
(goacc_async_copyout_unmap_vars): Likewise.
(goacc_async_free): Likewise.
(goacc_init_asyncqueues): Likewise.
(goacc_fini_asyncqueues): Likewise.

* oacc-cuda.c (acc_get_cuda_stream): Adjust code to use new async
design.
(acc_set_cuda_stream): Likewise.

* oacc-host.c (host_version): Update to return GOMP_PLUGIN_IF_VERSION.
(host_openacc_exec): Adjust parameters, remove 'async'.
(host_openacc_register_async_cleanup): Remove.
(host_openacc_async_exec): New function.
(host_openacc_async_test): Adjust parameters.
(host_openacc_async_test_all): Remove.
(host_openacc_async_wait): Remove.
(host_openacc_async_wait_async): Remove.
(host_openacc_async_wait_all): Remove.
(host_openacc_async_wait_all_async): Remove.
(host_openacc_async_set_async): Remove.
(host_openacc_async_synchronize): New function.
(host_openacc_async_serialize): New function.
(host_openacc_async_host2dev): New function.
(host_openacc_async_dev2host): New function.
(host_openacc_async_queue_callback): New function.
(host_openacc_async_construct): New function.
(host_openacc_async_destruct): New function.
(struct gomp_device_descr host_dispatch): Remove initialization of old
interface, add intialization of new async sub-struct.

* oacc-init.c (acc_shutdown_1): Adjust to use gomp_fini_device.
(goacc_attach_host_thread_to_device): Remove old async code usage, add
initialization of per-thread default_async.

* oacc-int.h (goacc_init_asyncqueues): New declaration.
(goacc_fini_asyncqueues): Likewise.
(goacc_async_free): Likewise.
(get_goacc_asyncqueue): Likewise.
(lookup_goacc_asyncqueue): Likewise.

* oacc-mem.c (memcpy_tofrom_device): Adjust code to use new async
design.
(present_create_copy): Likewise.
(delete_copyout): Likewise.
(update_dev_host): Likewise.
(gomp_acc_insert_pointer): Add async parameter, adjust code to use new
async design.
(gomp_acc_remove_pointer): Adjust code to use new async design.

* oacc-parallel.c (GOACC_parallel_keyed): Likewise.
(GOACC_enter_exit_data): Likewise.
(goacc_wait): Likewise.
(GOACC_update): Likewise.

* oacc-plugin.c (GOMP_PLUGIN_async_unmap_vars): Change to assert fail
when called, warn as obsolete in comment.

* libgomp-plugin.h (struct goacc_asyncqueue): Declare.
(struct goacc_asyncqueue_list): Likewise.
(goacc_aq): Likewise.
(goacc_aq_list): Likewise.
(GOMP_OFFLOAD_openacc_register_async_cleanup): Remove.
(GOMP_OFFLOAD_openacc_async_test): Remove.
(GOMP_OFFLOAD_openacc_async_test_all): Remove.
(GOMP_OFFLOAD_openacc_async_wait): Remove.
(GOMP_OFFLOAD_openacc_async_wait_async): Remove.
(GOMP_OFFLOAD_openacc_async_wait_all): Remove.
(GOMP_OFFLOAD_openacc_async_wait_all_async): Remove.
(GOMP_OFFLOAD_openacc_async_set_async): Remove.
(GOMP_OFFLOAD_openacc_exec): Adjust declaration.
(GOMP_OFFLOAD_openacc_cuda_get_stream): Likewise.
(GOMP_OFFLOAD_openacc_cuda_set_stream): Likewise.
(GOMP_OFFLOAD_openacc_async_exec): Declare.
(GOMP_OFFLOAD_openacc_async_construct): Declare.
(GOMP_OFFLOAD_openacc_async_destruct): Declare.
(GOMP_OFFLOAD_openacc_async_test): Declare.
(GOMP_OFFLOAD_openacc_async_synchronize): Declare.
(GOMP_OFFLOAD_openacc_async_serialize): Declare.
(GOMP_OFFLOAD_openacc_async_queue_callback): Declare.
(GOMP_OFFLOAD_openacc_async_host2dev): Declare.
(GOMP_OFFLOAD_openacc_async_dev2host): Declare.

* openacc.h (acc_async_t): Add acc_async_default enum.
(acc_set_default_async): Declare API function.
(acc_get_default_async): Likewise.

* libgomp.h (struct acc_dispatch_t): Define 'async' sub-struct.
Delete register_async_cleanup_func, async_test_func,
async_test_all_func, async_wait_func, async_wait_async_func,
async_wait_all_func, async_wait_all_async_func, async_set_async_func
hook fields.
(gomp_acc_insert_pointer): Adjust declaration.
(gomp_copy_host2dev): New declaration.
(gomp_copy_dev2host): Likewise.
(gomp_map_vars_async): Likewise.
(gomp_unmap_tgt): Likewise.
(gomp_unmap_vars_async): Likewise.
(gomp_fini_device): Likewise.

* libgomp.map (OACC_2.5): Add acc_get_default_async,
acc_get_default_async_h_, acc_set_default_async, and
acc_set_default_async_h_.

* openacc.f90 (acc_async_default): Declare.
(acc_set_default_async): Likewise.
(acc_get_default_async): Likewise.

* openacc_lib.h (acc_async_default): Declare.
 (acc_set_default_async): Likewise.
(acc_get_default_async): Likewise.

* plugin/plugin-hsa.c (GOMP_OFFLOAD_version): Update to return
GOMP_PLUGIN_IF_VERSION.

* plugin/plugin-nvptx.c (struct cuda_map): Remove.
(struct ptx_stream): Remove.
(struct nvptx_thread): Remove current_stream field.
(cuda_map_create): Remove.
(cuda_map_destroy): Remove.
(map_init): Remove.
(map_fini): Remove.
(map_pop): Remove.
(map_push): Remove.
(struct goacc_asyncqueue): Define.
(struct nvptx_callback): Define.
(struct ptx_free_block): Define.
(struct ptx_device): Remove null_stream, active_streams, async_streams,
stream_lock, and next fields.
(enum ptx_event_type): Remove.
(struct ptx_event): Remove.
(ptx_event_lock): Remove.
(ptx_events): Remove.
(init_streams_for_device): Remove.
(fini_streams_for_device): Remove.
(select_stream_for_async): Remove.
(nvptx_init): Remove ptx_events and ptx_event_lock references.
(nvptx_attach_host_thread_to_device): Remove CUDA_ERROR_NOT_PERMITTED
case.
(nvptx_open_device): Add free_blocks initialization, remove
init_streams_for_device call.
(nvptx_close_device): Remove fini_streams_for_device call, add
free_blocks destruct code.
(event_gc): Remove.
(event_add): Remove.
(nvptx_exec): Adjust parameters and code.
(nvptx_free): Likewise.
(nvptx_host2dev): Remove.
(nvptx_dev2host): Remove.
(nvptx_set_async): Remove.
(nvptx_async_test): Remove.
(nvptx_async_test_all): Remove.
(nvptx_wait): Remove.
(nvptx_wait_async): Remove.
(nvptx_wait_all): Remove.
(nvptx_wait_all_async): Remove.
(nvptx_get_cuda_stream): Remove.
(nvptx_set_cuda_stream): Remove.
(GOMP_OFFLOAD_alloc): Adjust code.
(GOMP_OFFLOAD_free): Likewise.
(GOMP_OFFLOAD_openacc_register_async_cleanup): Remove.
(GOMP_OFFLOAD_openacc_exec): Adjust parameters and code.
(GOMP_OFFLOAD_openacc_async_test_all): Remove.
(GOMP_OFFLOAD_openacc_async_wait): Remove.
(GOMP_OFFLOAD_openacc_async_wait_async): Remove.
(GOMP_OFFLOAD_openacc_async_wait_all): Remove.
(GOMP_OFFLOAD_openacc_async_wait_all_async): Remove.
(GOMP_OFFLOAD_openacc_async_set_async): Remove.
(cuda_free_argmem): New function.
(GOMP_OFFLOAD_openacc_async_exec): New plugin hook function.
(GOMP_OFFLOAD_openacc_create_thread_data): Adjust code.
(GOMP_OFFLOAD_openacc_cuda_get_stream): Adjust code.
(GOMP_OFFLOAD_openacc_cuda_set_stream): Adjust code.
(GOMP_OFFLOAD_openacc_async_construct): New plugin hook function.
(GOMP_OFFLOAD_openacc_async_destruct): New plugin hook function.
(GOMP_OFFLOAD_openacc_async_test): Remove and re-implement.
(GOMP_OFFLOAD_openacc_async_synchronize): New plugin hook function.
(GOMP_OFFLOAD_openacc_async_serialize): New plugin hook function.
(GOMP_OFFLOAD_openacc_async_queue_callback): New plugin hook function.
(cuda_callback_wrapper): New function.
(cuda_memcpy_sanity_check): New function.
(GOMP_OFFLOAD_host2dev): Remove and re-implement.
(GOMP_OFFLOAD_dev2host): Remove and re-implement.
(GOMP_OFFLOAD_openacc_async_host2dev): New plugin hook function.
(GOMP_OFFLOAD_openacc_async_dev2host): New plugin hook function.

* testsuite/libgomp.oacc-c-c++-common/asyncwait-2.c: New testcase.
* testsuite/libgomp.oacc-c-c++-common/lib-81.c: Adjust testcase.
* testsuite/libgomp.oacc-fortran/lib-12.f90: Likewise.

liboffloadmic/
* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_version):
Update to return GOMP_PLUGIN_IF_VERSION.

(cherry picked from openacc-gcc-9-branch commit
b7d99d5bc7b4391eecbd0b7521c149dbb516b2c4)

5 years ago[PATCH] Forward -foffload=[...] from the driver (compile-time) to libgomp (run-time)
Julian Brown [Thu, 28 Feb 2019 16:53:54 +0000 (08:53 -0800)] 
[PATCH] Forward -foffload=[...] from the driver (compile-time) to libgomp (run-time)

gcc/
PR libgomp/81886
* doc/invoke.texi (-ffixed-@var{reg}): Document conflict with
Fortran options.
* gcc.c (add_omp_infile_spec_func, spec_lang_mask_accept): New.
(driver_self_specs): Add spec to use %:add-omp-infile().
(static_spec_functions): Add add-omp-infile.
(struct switchstr): Add lang_mask field.  Expand comment.
(struct infile): Add lang_mask field.
(add_infile, save_switch, do_spec): Add lang_mask argument.
(driver_unknown_option_callback, driver_wrong_lang_callback)
(driver_handle_option, process_command, do_self_spec)
(driver::do_spec_on_infiles, driver::maybe_run_linker): All
callers changed.
(give_switch): Check languages of switch against
spec_lang_mask_accept.
(driver::maybe_putenv_OFFLOAD_TARGETS): Don't free
offload_targets.
* gcc.h (do_spec): Update prototype.
gcc/fortran/
PR libgomp/81886
* gfortranspec.c (lang_specific_pre_link): Update call to do_spec.
libgomp/
PR libgomp/81886
* plugin/configfrag.ac (tgt_name): Do not set.
(offload_targets): Separate with colons not commas.
* config.h.in, configure: Regenerate.
* libgomp.h (gomp_offload_target_available_p): New prototype.
* libgomp.map (GOACC_2.0.GOMP_4_BRANCH): Add
GOMP_set_offload_targets.
* libgomp_g.h (GOMP_set_offload_targets): New prototype.
* oacc-init.c (resolve_device): Use
gomp_offload_target_available_p.
* target.c (resolve_device): Use host fallback when offload data
not available.
(gomp_offload_target_available_p, offload_target_to_plugin_name)
(gomp_offload_targets, gomp_offload_targets_init)
(GOMP_set_offload_targets, gomp_plugin_prefix)
(gomp_plugin_suffix): New.
(gomp_load_plugin_for_device): Add gomp_debug call.
(gomp_target_init): Use gomp_offload_targets instead of
OFFLOAD_TARGETS.  Handle and rewrie colon-separated string.
* openacc.h (enum acc_device_t): Add _acc_device_intel_mic,
_acc_device_hsa.
* oacc-init.c (get_openacc_name): Handle these.
(resolve_device): Debugging output.
* target.c (resolve_device, gomp_init_device)
(gomp_offload_target_available_p): Likewise.
* testsuite/lib/libgomp.exp: Expect offload targets to be
colon-separated.  Adjust matching of offload targets.
(libgomp_init)
(check_effective_target_openacc_nvidia_accel_configured)
(check_effective_target_openacc_host_selected): Adjust checks of
offload target names.
* testsuite/libgomp.oacc-c++/c++.exp: Adjust set of offload targets.
Use -foffload instead of setenv ACC_DEVICE_TYPE.  Provide offload
target in "-DACC_DEVICE_TYPE_host", and "-DACC_DEVICE_TYPE_nvidia".
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Adapt.
* testsuite/libgomp.oacc-c/offload-targets-1.c: New file.
* testsuite/libgomp.oacc-c/offload-targets-2.c: Likewise.
* testsuite/libgomp.oacc-c/offload-targets-3.c: Likewise.
* testsuite/libgomp.oacc-c/offload-targets-4.c: Likewise.
* testsuite/libgomp.oacc-c/offload-targets-5.c: Likewise.
* testsuite/libgomp.oacc-c/offload-targets-6.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c: Adjust.
* testsuite/libgomp.oacc-c-c++-common/acc_on_device-1.c: Likewise.
* testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f: Likewise.

(cherry picked from gomp-4_0-branch r227045, r227154, r227175, r248030, and
openacc-gcc-7-branch commit 917e247055a37f912129ed545719182de0046adb)

(cherry picked from openacc-gcc-9-branch commit
789c1d022a871eb06ab08bbb63dcb89006361d93)

6 years agore PR middle-end/89765 (Multiple problems with vec-insert implementation on PowerPC)
Richard Biener [Thu, 25 Apr 2019 17:58:56 +0000 (17:58 +0000)] 
re PR middle-end/89765 (Multiple problems with vec-insert implementation on PowerPC)

PR middle-end/89765
* gimplify.c (gimplify_expr): Avoid turning a lvalue
VIEW_CONVERT_EXPR into one operating on an rvalue.

From-SVN: r270579

6 years agox86: Update message for target_clones and unsupported ISAs
H.J. Lu [Thu, 25 Apr 2019 17:00:28 +0000 (10:00 -0700)] 
x86: Update message for target_clones and unsupported ISAs

Before AVX512F, processors with the newer ISAs also support the older
ISAs, i.e., AVX2 processors also support AVX and SSE4, SSE4 processors
also support SSSE3, ...   After AVX512F, an AVX512XX processor may not
support AVX512YY.  It means AVX512XX features, except for AVX512F, can't
be used to decide priority in target_clones.

This patch updates error message for ISAs with P_ZERO priority.  It also
merges _feature_list into _isa_names_table and marks ISAs, which have
unknown priority, with P_ZERO so that we only need to update one place
to add a new ISA feature.

gcc/

2019-04-25  H.J. Lu  <hongjiu.lu@intel.com>

PR target/89929
* config/i386/i386.c (feature_priority): Moved to file scope.
(processor_features): Likewise.
(processor_model): Likewise.
(_arch_names_table): Likewise.
(arch_names_table): Likewise.
(_feature_list): Removed.
(feature_list): Likewise.
(_isa_names_table): Moved to file scope.  Add priority.
(isa_names_table): Likewise.
(get_builtin_code_for_version): Replace feature_list with
isa_names_table.  Update error message for P_ZERO priority.

gcc/testsuite/

2019-04-25  Martin Liska  <mliska@suse.cz>
    H.J. Lu  <hongjiu.lu@intel.com>

PR target/89929
* g++.target/i386/mv28.C: New test.
* gcc.target/i386/mvc14.c: Likewise.
* g++.target/i386/pr57362.C: Updated.

From-SVN: r270578

6 years agolibphobos: Fix segfault in runtime caused by unexpected GC of TLS data.
Iain Buclaw [Thu, 25 Apr 2019 15:31:35 +0000 (15:31 +0000)] 
libphobos: Fix segfault in runtime caused by unexpected GC of TLS data.

libphobos/ChangeLog:

2019-04-25  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/90250
* libdruntime/gcc/sections/elf_shared.d (initTLSRanges): Populate
_tlsRanges in every startup thread.
* testsuite/libphobos.thread/thread.exp: Load libphobos-dg.exp.
* testsuite/libphobos.thread/tlsgc_sections.d: New test.

From-SVN: r270576

6 years agotree-pass.h (make_pass_phi_only_cprop): Remove.
Richard Biener [Thu, 25 Apr 2019 14:55:42 +0000 (14:55 +0000)] 
tree-pass.h (make_pass_phi_only_cprop): Remove.

2019-04-25  Richard Biener  <rguenther@suse.de>

* tree-pass.h (make_pass_phi_only_cprop): Remove.
* timevar.def (TV_TREE_PHI_CPROP): Likewise.

From-SVN: r270575

6 years agore PR tree-optimization/90037 (-Wnull-dereference false positive after r269302)
Jeff Law [Thu, 25 Apr 2019 14:32:16 +0000 (08:32 -0600)] 
re PR tree-optimization/90037 (-Wnull-dereference false positive after r269302)

PR tree-optimization/90037
* Makefile.in (OBJS): Remove tree-ssa-phionlycprop.c
* passes.def: Replace all instance of phi-only cprop with the
lattice propagator.  Move propagation pass from after erroneous
path isolation to before erroneous path isolation.
* tree-ssa-phionlycprop.c: Remove.

* gcc.dg/tree-ssa/20030710-1.c: Update dump file to scan.
* gcc.dg/isolate-2.c: Likewise.
* gcc.dg/isolate-4.c: Likewise.
* gcc.dg/pr19431.c: Accept either ordering of PHI args.
* gcc.dg/pr90037.c: New test.

From-SVN: r270574

6 years agoFix typo in m4/druntime/cpu.m4
Rainer Orth [Thu, 25 Apr 2019 12:39:33 +0000 (12:39 +0000)] 
Fix typo in m4/druntime/cpu.m4

* m4/druntime/cpu.m4 (DRUNTIME_CPU_SOURCES): Quote brackets.
* configure: Regenerate.

From-SVN: r270573

6 years agore PR c++/44648 (missing -Wunused warning on a const variable in if statement)
Jakub Jelinek [Thu, 25 Apr 2019 12:18:07 +0000 (14:18 +0200)] 
re PR c++/44648 (missing -Wunused warning on a const variable in if statement)

PR c++/44648
* g++.dg/warn/Wunused-var-35.C: Remove xfail.

From-SVN: r270572

6 years agoD: Do not add target_libs if phobos is disabled
Johannes Pfau [Thu, 25 Apr 2019 11:22:27 +0000 (11:22 +0000)] 
D: Do not add target_libs if phobos is disabled

From-SVN: r270571

6 years agore PR tree-optimization/90213 (UBSAN: signed integer overflow: -5621332293356458048...
Richard Biener [Thu, 25 Apr 2019 11:17:49 +0000 (11:17 +0000)] 
re PR tree-optimization/90213 (UBSAN: signed integer overflow: -5621332293356458048 * 8 cannot be represented in type 'long int')

2019-04-24  Richard Biener  <rguenther@suse.de>

PR middle-end/90213
* gimple-fold.c (fold_const_aggregate_ref_1): Do multiplication
by size and BITS_PER_UNIT on poly-wide-ints.

From-SVN: r270570

6 years agore PR middle-end/90194 (ICE in expand_debug_expr, at cfgexpand.c:5244)
Richard Biener [Thu, 25 Apr 2019 11:15:35 +0000 (11:15 +0000)] 
re PR middle-end/90194 (ICE in expand_debug_expr, at cfgexpand.c:5244)

2019-04-25  Richard Biener  <rguenther@suse.de>

PR middle-end/90194
* match.pd: Add pattern to simplify view-conversion of an
empty constructor.

* g++.dg/torture/pr90194.C: New testcase.

From-SVN: r270569

6 years agoD: Implement GCC emutls in druntime
Johannes Pfau [Thu, 25 Apr 2019 11:11:39 +0000 (11:11 +0000)] 
D: Implement GCC emutls in druntime

* libdruntime/Makefile.am: Add emutls and gthread files.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/gcc/emutls.d: New file. Implement GC-compatible emutls.
* libdruntime/gcc/gthread.d: New file.
* libdruntime/gcc/sections/elf_shared.d: Integrate emutls support.
* testsuite/libphobos.allocations/tls_gc_integration.d: New test for
TLS.

From-SVN: r270568

6 years agolibphobos: Add missing PWD_COMMAND to Makefile.
Iain Buclaw [Thu, 25 Apr 2019 06:26:57 +0000 (06:26 +0000)] 
libphobos: Add missing PWD_COMMAND to Makefile.

2019-04-25  Iain Buclaw  <ibuclaw@gdcproject.org>

* testsuite/Makefile.am: Set PWD_COMMAND.
* testsuite/Makefile.in: Regenerate.

From-SVN: r270566

6 years agocompiler: fix glitch when inlining method with empty param/receiver
Ian Lance Taylor [Thu, 25 Apr 2019 01:13:22 +0000 (01:13 +0000)] 
compiler: fix glitch when inlining method with empty param/receiver

    Fix a problem with Function_declaration::import_function relating to
    how no-name or "sink" parameters are handled. In Gogo::start_function
    (for the non-inline case) when parameter bindings are being added,
    parameters with empty/sink names are renamed to synthesized "r.%d" /
    "p.%d" names so as to avoid collisions. This same handling needs to be
    present when creating the bindings for an inline function that's being
    instantiated after being read from export data.

    Fixes golang/go#31637.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/173538

From-SVN: r270564

6 years agoDaily bump.
GCC Administrator [Thu, 25 Apr 2019 00:16:17 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r270563

6 years agolibphobos: Fix linker warning and SEGV in core.thread tests.
Iain Buclaw [Wed, 24 Apr 2019 22:46:59 +0000 (22:46 +0000)] 
libphobos: Fix linker warning and SEGV in core.thread tests.

The monolithic core/threadasm.S source has been removed, and split into
multiple parts, one for each intended target CPU/OS.

Added .type and .size directives for all asm implementations of
fiber_switchContent and callWithStackShell where they were missing.

libphobos/ChangeLog:

2019-04-25  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/90086
* m4/druntime/cpu.m4 (DRUNTIME_CPU_SOURCES): New macro.
* configure.ac: Use it.
* configure: Regenerate.
* libdruntime/Makefile.am: Add new config sources to
DRUNTIME_SOURCES_CONFIGURED.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/config/aarch64/switchcontext.S: New file.
* libdruntime/config/arm/switchcontext.S: New file.
* libdruntime/config/common/threadasm.S: New file.
* libdruntime/config/mingw/switchcontext.S: New file.
* libdruntime/config/mips/switchcontext.S: New file.
* libdruntime/config/powerpc/switchcontext.S: New file.
* libdruntime/config/powerpc64/callwithstack.S: New file.
* libdruntime/config/x86/switchcontext.S: New file.
* libdruntime/core/threadasm.S: Remove.

From-SVN: r270560

6 years agoUpdate C++17 library status tables
Jonathan Wakely [Wed, 24 Apr 2019 22:16:45 +0000 (23:16 +0100)] 
Update C++17 library status tables

* doc/xml/manual/status_cxx2017.xml: Document P0024R2 status.
* doc/html/*: Regenerate.

From-SVN: r270559

6 years agoMake filesystem::path comparison operators hidden friends (LWG 3065)
Jonathan Wakely [Wed, 24 Apr 2019 21:35:26 +0000 (22:35 +0100)] 
Make filesystem::path comparison operators hidden friends (LWG 3065)

This change revealed two testsuite bugs where some string comparisons
only compiled by converting the strings to filesystem::path objects.

* include/bits/fs_path.h (operator<, operator<=, operator>)
(operator>=, operator==, operator!=): Make hidden friends, as per
LWG 3065.
* testsuite/27_io/filesystem/path/native/string-char8_t.cc: Fix
string type in test.
* testsuite/27_io/filesystem/path/native/string.cc: Likewise.

From-SVN: r270558

6 years agore PR c++/90236 (bogus error with auto non-type template argument)
Marek Polacek [Wed, 24 Apr 2019 21:28:04 +0000 (21:28 +0000)] 
re PR c++/90236 (bogus error with auto non-type template argument)

PR c++/90236
* g++.dg/cpp1z/nontype-auto16.C: New test.

From-SVN: r270557

6 years agoPR c++/90227 - error with template parameter packs.
Jason Merrill [Wed, 24 Apr 2019 20:37:30 +0000 (16:37 -0400)] 
PR c++/90227 - error with template parameter packs.

If require_all_args, we aren't waiting for more args to be deduced later.

* pt.c (coerce_template_parms): Do add empty pack when
require_all_args.

From-SVN: r270556

6 years agolibphobos: Fix FAIL phobos.exp/core.time on CentOS 5.11, Linux 2.6.18
Iain Buclaw [Wed, 24 Apr 2019 18:57:36 +0000 (18:57 +0000)] 
libphobos: Fix FAIL phobos.exp/core.time on CentOS 5.11, Linux 2.6.18

Merges upstream druntime e03164b5.

Reviewed-on: https://github.com/dlang/druntime/pull/2581

libphobos/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/89432
* testsuite/lib/libphobos.exp (check_effective_target_linux_pre_2639):
New proc.
* testsuite/libphobos.druntime/druntime.exp: Add compiler flag
-fversion=Linux_Pre_2639 if target is linux_pre_2639.
* testsuite/libphobos.druntime_shared/druntime_shared.exp: Likewise.

From-SVN: r270554

6 years agoaix71.h (SUBTARGET_OVERRIDE_OPTIONS): Disable OPTION_MASK_VSX and OPTION_MASK_ALTIVEC...
Clement Chigot [Wed, 24 Apr 2019 18:03:47 +0000 (18:03 +0000)] 
aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Disable OPTION_MASK_VSX and OPTION_MASK_ALTIVEC from rs6000_isa_flags for Go on...

2019-04-24  Clement Chigot  <clement.chigot@atos.net>

        * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Disable
        OPTION_MASK_VSX and OPTION_MASK_ALTIVEC from rs6000_isa_flags
        for Go on 32 bit AIX.
        * config/rs6000/aix72.h: Likewise.

From-SVN: r270553

6 years agoUse __and_v<...> instead of __and_<...>::value
Jonathan Wakely [Wed, 24 Apr 2019 16:25:21 +0000 (17:25 +0100)] 
Use __and_v<...> instead of __and_<...>::value

* include/std/any (any::any(ValueType&&)): Use __and_v.
* include/std/numeric (midpoint(T, T, T), midpoint(T*, T*, T*)):
Likewise.

From-SVN: r270552

6 years agoFinish implementing "Treating Unnecessary decay" (P0777R1)
Jonathan Wakely [Wed, 24 Apr 2019 16:25:17 +0000 (17:25 +0100)] 
Finish implementing "Treating Unnecessary decay" (P0777R1)

* include/std/tuple (apply): Use remove_reference_t instead of decay_t
as per P0777R1.
* include/std/type_traits (__result_of_memfun): Use remove_reference
instead of __remove_cvref_t and remove redundant is_same check.
(__inv_unwrap): Use __remove_cvref_t instead of decay_t.

From-SVN: r270551

6 years agore PR target/90193 (asm goto with TLS "m" input operand generates incorrect assembler...
Jakub Jelinek [Wed, 24 Apr 2019 15:49:36 +0000 (17:49 +0200)] 
re PR target/90193 (asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2)

PR target/90193
* rtl.c (classify_insn): Return JUMP_INSN for asm goto.
* emit-rtl.c (try_split): Copy over REG_LABEL_TARGET.

* gcc.target/i386/pr90193.c: New test.

From-SVN: r270550

6 years agoFix basic_string_view typedefs and enforce preconditions
Jonathan Wakely [Wed, 24 Apr 2019 15:17:53 +0000 (16:17 +0100)] 
Fix basic_string_view typedefs and enforce preconditions

The basic_string_view::pointer and basic_string_view::reference typedefs
are supposed to refer to the non-const value type.

In previous standards having traits_type::char_type different to
value_type was simply undefined, but in the C++2a draft it's ill-formed,
as changed by P1148R0. For std::basic_string and iostreams we might
want to only enforce this conditionally for __cplusplus > 201703L but
for std::basic_string_view we don't have backwards compatibility
concerns. Also add assertions to verify the _CharT argument is a
"char-like" type (non-array, trivial, standard layout type).

Also remove the non-standard basic_string_view::_M_check and
basic_string_view::_M_limit member functions, replacing them with
non-member functions that will still exist even if basic_string_view is
specialized by the program.

* include/experimental/string_view (basic_string_view::pointer)
(basic_string_view::reference): Fix to refer to non-const value_type.
* include/bits/basic_string.h (basic_string): Use __sv_check and
__sv_limit instead of basic_string_view::_M_check and
basic_string_view::_M_limit.
* include/std/string_view (__sv_check, __sv_limit): New
helper functions to replace basic_string_view::_M_check and
basic_string_view::_M_limit.
(basic_string_view): Add static assertions to enforce ill-formed
requirement for traits_type::char_type from P1148R0, and to enforce
required properties of char-like types.
(basic_string_view::pointer, basic_string_view::reference): Fix to
refer to non-const value_type.
(basic_string_view::operator[], basic_string_view::at)
(basic_string_view::front, basic_string_view::back)
(basic_string_view::data): Use const_reference and const_pointer
typedefs for return types.
(basic_string_view::_M_check, basic_string_view::_M_limit): Remove.
(hash<wstring_view>): Fix argument_type typedef.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
char/1.cc: Fix expected return type of basic_string_view::data().
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
wchar_t/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
char/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
wchar_t/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/requirements/traits_neg.cc:
New test.
* testsuite/21_strings/basic_string_view/requirements/typedefs.cc:
Check reference and pointer typedefs.
* testsuite/experimental/string_view/requirements/typedefs.cc:
Likewise.
* testsuite/experimental/string_view/modifiers/remove_prefix/char/1.cc:
Fix expected return type of basic_string_view::data().
* testsuite/experimental/string_view/modifiers/remove_prefix/wchar_t/
1.cc: Likewise.
* testsuite/experimental/string_view/modifiers/remove_suffix/char/1.cc:
Likewise.
* testsuite/experimental/string_view/modifiers/remove_suffix/wchar_t/
1.cc: Likewise.

From-SVN: r270548

6 years agoPR libstdc++/90220 Fix std::any_cast for array types
Jonathan Wakely [Wed, 24 Apr 2019 15:17:43 +0000 (16:17 +0100)] 
PR libstdc++/90220 Fix std::any_cast for array types

Although the std::any constructors use decay_t to determine the type of
the contained value, std::any_cast should use the un-decayed type (and
so always fail for function and array types that decay to pointers).

Using remove_cv_t is correct, because the condition for std::any_cast
to return non-null is operand.type() == typeid(T) and typeid ignores
top-level cv-qualifiers.

PR libstdc++/90220
* include/std/any (__any_caster): Use remove_cv_t instead of decay_t.
Avoid a runtime check for types that can never be stored in std::any.
* testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with
array types.

From-SVN: r270547

6 years agolibphobos: Skip curl tests if libcurl is not installed on the target.
Iain Buclaw [Wed, 24 Apr 2019 14:17:34 +0000 (14:17 +0000)] 
libphobos: Skip curl tests if libcurl is not installed on the target.

libphobos/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/88654
* testsuite/lib/libphobos.exp (libphobos-dg-test): Check
libphobos_skipped_test_p before running test.
(libphobos-dg-prune): New proc.
(libphobos_init): Set libphobos_skip_tests.
(libphobos_skipped_test_p): New proc.
(check_effective_target_libcurl_available): New proc.
* testsuite/libphobos.phobos/phobos.exp: Skip curl tests if library
not found.
* testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.

From-SVN: r270545

6 years agoS/390: Fix PR89952 incorrect CFI
Andreas Krebbel [Wed, 24 Apr 2019 13:40:38 +0000 (13:40 +0000)] 
S/390: Fix PR89952 incorrect CFI

This patch fixes a cases where inconsistent CFI is generated.

After restoring the hard frame pointer (r11) from an FPR we have to
set the CFA register.  In order to be able to set it back to the stack
pointer (r15) we have to make sure that r15 has been restored already.

The patch also adds a scheduler dependency to prevent the instruction
scheduler from swapping the r11 and r15 restore again.

gcc/ChangeLog:

2019-04-24  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/89952
* config/s390/s390.c (s390_restore_gprs_from_fprs): Restore GPRs
     from FPRs in reverse order.  Generate REG_CFA_DEF_CFA note also
     for restored hard frame pointer.
(s390_sched_dependencies_evaluation): Implement new target hook.
(TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): New macro definition.

gcc/testsuite/ChangeLog:

2019-04-24  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/89952
* gcc.target/s390/pr89952.c: New test.

From-SVN: r270544

6 years agore PR target/89093 (C++ exception handling clobbers d8 VFP register)
Ian Lance Taylor [Wed, 24 Apr 2019 12:45:45 +0000 (12:45 +0000)] 
re PR target/89093 (C++ exception handling clobbers d8 VFP register)

PR target/89093
    runtime: mark unwind functions general-regs-only on ARM

    For https://gcc.gnu.org/PR89093.

    Change-Id: Ic426b43d633c77104bda01d4e7835bc9ab4695ef
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/173657
Reviewed-by: Ian Lance Taylor <iant@golang.org>
From-SVN: r270542

6 years agolibphobos: Fix assert in core.sys.posix.sys.stat for aarch64/ilp32.
Iain Buclaw [Wed, 24 Apr 2019 11:04:22 +0000 (11:04 +0000)] 
libphobos: Fix assert in core.sys.posix.sys.stat for aarch64/ilp32.

Merges upstream druntime 51365217.

Reviewed-on: https://github.com/dlang/druntime/pull/2579

From-SVN: r270541

6 years ago[ARC][COMMITTED] Fix typos.
Claudiu Zissulescu [Wed, 24 Apr 2019 10:15:47 +0000 (12:15 +0200)] 
[ARC][COMMITTED] Fix typos.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc-options.def: Fix typos and spelling mistakes.
* config/arc/arc.c (arc_init): Cleanup warning message.
(arc_override_options): Likewise.

From-SVN: r270540

6 years agocall.c (null_ptr_cst_p): Order checks according to expensiveness.
Richard Biener [Wed, 24 Apr 2019 10:08:07 +0000 (10:08 +0000)] 
call.c (null_ptr_cst_p): Order checks according to expensiveness.

2019-04-24  Richard Biener  <rguenther@suse.de>

cp/
* call.c (null_ptr_cst_p): Order checks according to expensiveness.
(conversion_null_warnings): Likewise.
* typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
early if type1 == type2.

From-SVN: r270539

6 years agoPR libstdc++/90220 Fix std::any_cast for function pointers
Jonathan Wakely [Wed, 24 Apr 2019 09:46:07 +0000 (10:46 +0100)] 
PR libstdc++/90220 Fix std::any_cast for function pointers

PR libstdc++/90220 (partial)
* include/std/any (any_cast<T>(any*), any_cast<T>(const any*)): Do
not attempt ill-formed static_cast to pointers to non-object types.
* testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with
function types.

From-SVN: r270538

6 years agore PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)
Jakub Jelinek [Wed, 24 Apr 2019 09:27:14 +0000 (11:27 +0200)] 
re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)

PR target/90187
* config/i386/i386.c (ix86_expand_sse_fp_minmax): Force if_true into
a register if both if_true and if_false are MEMs.

* g++.target/i386/pr90187.C: New test.

From-SVN: r270537

6 years agod/dmd: Merge upstream dmd 423758078
Iain Buclaw [Wed, 24 Apr 2019 09:15:59 +0000 (09:15 +0000)] 
d/dmd: Merge upstream dmd 423758078

Fixes another failing test to pass on BigEndian.

Initial patch by Robin Dapp.

Reviewed-on: https://github.com/dlang/dmd/pull/9684

gcc/testsuite/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

* gdc.test/README.gcc: New file.

From-SVN: r270536

6 years agore PR target/89093 (C++ exception handling clobbers d8 VFP register)
Ramana Radhakrishnan [Wed, 24 Apr 2019 08:16:07 +0000 (08:16 +0000)] 
re PR target/89093 (C++ exception handling clobbers d8 VFP register)

PR target/89093
* raise-gcc.c (TARGET_ATTRIBUTE): Define.
(continue_unwind, personality_body, PERSONALITY_FUNCTION): Add
TARGET_ATTRIBUTE.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r270535

6 years agore PR tree-optimization/90208 (error: EH landing pad label)
Jakub Jelinek [Wed, 24 Apr 2019 08:14:50 +0000 (10:14 +0200)] 
re PR tree-optimization/90208 (error: EH landing pad label)

PR tree-optimization/90208
* tree-cfg.c (remove_bb): Move forced labels from removed bbs
after labels of new_bb, not before them.

* gcc.dg/tsan/pr90208-1.c: New test.
* gcc.dg/tsan/pr90208-2.c: New test.

From-SVN: r270534

6 years agore PR tree-optimization/90211 (ICE: tree check: expected ssa_name, have real_cst...
Jakub Jelinek [Wed, 24 Apr 2019 08:13:29 +0000 (10:13 +0200)] 
re PR tree-optimization/90211 (ICE: tree check: expected ssa_name, have real_cst in first_readonly_imm_use, at ssa-iterators.h:351)

PR tree-optimization/90211
* tree-parloops.c (try_create_reduction_list): Ignore phi arguments
which are not SSA_NAMEs.

* gcc.dg/autopar/pr90211.c: New test.

From-SVN: r270533

6 years agolibphobos: Fix link build errors when compiling with unsupported options
Iain Buclaw [Wed, 24 Apr 2019 02:04:04 +0000 (02:04 +0000)] 
libphobos: Fix link build errors when compiling with unsupported options

The first compilation test to get baseline warnings was getting more
messages due to a missing object.d file, compared to later configure
tests where libphobos is in the include paths.

Because there must always be an object module during compilation, let
the tests themselves be an empty object module instead.

libphobos/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/88431
* configure: Regenerate.
* m4/libtool.m4 (lt_simple_compile_test_code): Update to not have
dependencies on libphobos.
(lt_simple_link_test_code): Likewise.
(GDCFLAGS): Don't override for D compiler tests.

From-SVN: r270531

6 years agoDaily bump.
GCC Administrator [Wed, 24 Apr 2019 00:16:17 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r270530

6 years agoAvoid -Wcatch-value warning in testsuite
Jonathan Wakely [Tue, 23 Apr 2019 23:17:52 +0000 (00:17 +0100)] 
Avoid -Wcatch-value warning in testsuite

* testsuite/20_util/variant/run.cc: Catch exception by reference to
prevent -Wcatch-value warning.

From-SVN: r270527

6 years agoFix whitespace in ChangeLog
Jonathan Wakely [Tue, 23 Apr 2019 23:01:35 +0000 (00:01 +0100)] 
Fix whitespace in ChangeLog

From-SVN: r270526

6 years agoImplement LWG 2904 for std::variant assignment
Jonathan Wakely [Tue, 23 Apr 2019 23:01:12 +0000 (00:01 +0100)] 
Implement LWG 2904 for std::variant assignment

* include/std/variant (__variant_construct): Use template parameter
type instead of equivalent decltype-specifier.
(_Move_ctor_base<false, Types...>::_Move_ctor_base(_Move_ctor_base&&)):
Replace forward with move.
(_Move_ctor_base<false, Types...>::_M_destructive_move)
(_Move_ctor_base<false, Types...>::_M_destructive_copy)
(_Move_ctor_base<true, Types...>::_M_destructive_move)
(_Move_ctor_base<true, Types...>::_M_destructive_copy): Only set the
index after construction succeeds.
(_Copy_assign_base<false, Types...>::operator=): Remove redundant
if-constexpr checks that are always true. Use __remove_cvref_t instead
of remove_reference so that is_nothrow_move_constructible check
doesn't use a const rvalue parameter. In the potentially-throwing case
construct a temporary and move assign it, as per LWG 2904.
(_Move_assign_base<false, Types...>::operator=): Remove redundant
if-constexpr checks that are always true. Use emplace as per LWG 2904.
(variant::operator=(T&&)): Only use emplace conditionally, otherwise
construct a temporary and move assign from it, as per LWG 2904.
* testsuite/20_util/variant/exception_safety.cc: Check that
assignment operators have strong exception safety guarantee.

From-SVN: r270525

6 years agolibphobos: Add AArch64 Linux as a supported target.
Iain Buclaw [Tue, 23 Apr 2019 22:53:35 +0000 (22:53 +0000)] 
libphobos: Add AArch64 Linux as a supported target.

libphobos/ChangeLog:

2019-04-24  Iain Buclaw  <ibuclaw@gdcproject.org>

* configure.tgt: Add aarch64*-*-linux* as a supported target.

From-SVN: r270524

6 years agolibphobos: Add D support for S/390 Linux
Iain Buclaw [Tue, 23 Apr 2019 22:53:25 +0000 (22:53 +0000)] 
libphobos: Add D support for S/390 Linux

gcc/d/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
    Robin Dapp  <rdapp@linux.ibm.com>

* typeinfo.cc (create_typeinfo): Write typeinfo flags as uint.

gcc/testsuite/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
    Robin Dapp  <rdapp@linux.ibm.com>

* gdc.dg/link.d: Test if target d_runtime.
* gdc.dg/runnable.d: Fix tests to work on BigEndian.
* gdc.dg/simd.d: Likewise.

libphobos/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
    Robin Dapp  <rdapp@linux.ibm.com>

* configure.tgt: Add s390*-linux* as a supported target.
* libdruntime/gcc/sections/elf_shared.d: import gcc.builtins.
(__tls_get_addr_internal): Declare.
(TLS_DTV_OFFSET): Define as zero on SystemZ.
(getTLSRange): Support getting TLS on SystemZ.
* testsuite/libphobos.typeinfo/struct-align.d: New test.

Co-Authored-By: Robin Dapp <rdapp@linux.ibm.com>
From-SVN: r270523

6 years agolibphobos: Add D support for RISC-V Linux
Iain Buclaw [Tue, 23 Apr 2019 22:53:12 +0000 (22:53 +0000)] 
libphobos: Add D support for RISC-V Linux

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>

* configure.tgt: Add riscv*-*-linux* as supported target.
* libdruntime/gcc/sections/elf_shared.d (getDependencies): Adjust
dlpi_addr on RISCV32 and RISCV64.
* src/std/math.d: Add IEEE FPU control support for RISCV.

From-SVN: r270522

6 years agoDocument PSTL linker flags
Thomas Rodgers [Tue, 23 Apr 2019 21:03:24 +0000 (21:03 +0000)] 
Document PSTL linker flags

* doc/xml/manual/using.xml: Add PSTL linker flags to table
        3.1.

From-SVN: r270521

6 years agoUpdate .po files.
Joseph Myers [Tue, 23 Apr 2019 21:03:01 +0000 (22:03 +0100)] 
Update .po files.

* be.po, da.po, de.po, el.po, fi.po, fr.po, hr.po, id.po, ja.po,
nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po,
zh_TW.po: Update.

From-SVN: r270520

6 years agod: Add support for compiling without libphobos library.
Iain Buclaw [Tue, 23 Apr 2019 20:08:46 +0000 (20:08 +0000)] 
d: Add support for compiling without libphobos library.

Merges upstream dmd 3b3dca8be

Reviewed-on: https://github.com/dlang/dmd/pull/9678

gcc/d/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>

* d-builtins.cc (d_init_versions): Add D_BetterC, D_ModuleInfo,
D_Exceptions, D_TypeInfo as predefined version conditions.
* d-codegen.cc (build_bounds_condition): Generate trap if D asserts
are turned off.
* d-frontend.cc (getTypeInfoType): Add error when -fno-rtti is set.
* d-lang.cc (d_init_options): Initialize new front-end options.
(d_handle_option): Handle -fdruntime, -fexceptions, and -frtti.
(d_post_options): Turn off D runtime features if -fno-druntime is set.
* d-spec.cc (lang_specific_driver): Handle -fdruntime.
* d-tree.h (have_typeinfo_p): Add prototype.
(build_typeinfo): Update prototype.
* decl.cc (DeclVisitor::visit(StructDeclaration)): Create typeinfo
only if TypeInfo exists.
(DeclVisitor::visit(ClassDeclaration)): Likewise.
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
(DeclVisitor::visit(EnumDeclaration)): Likewise.
* expr.cc: Update all calls to build_typeinfo.
* gdc.texi (Runtime Options): Document -fdruntime and -frtti.
* lang.opt: Add -fdruntime and -frtti.
* modules.cc (build_module_tree): Create module info only if
ModuleInfo exists.
* toir.cc (IRVisitor::visit(ThrowStatement)): Update test for
-fno-exceptions.
* typeinfo.cc (create_tinfo_types): Build internal typeinfo classes
only if Object exists.
(have_typeinfo_p): New function.
(class TypeInfoVisitor): Update all calls to build_typeinfo.
(build_typeinfo): Add error when -fno-rtti is set.

gcc/testsuite/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>

* gdc.test/fail_compilation/fail2456.d: New test.
* gdc.test/fail_compilation/test18312.d: New test.
* gdc.test/gdc-test.exp (gdc-convert-args): Handle -betterC.

From-SVN: r270518

6 years ago[GCC, AARCH64] Add GNU note section with BTI and PAC.
Sudakshina Das [Tue, 23 Apr 2019 15:51:25 +0000 (15:51 +0000)] 
[GCC, AARCH64] Add GNU note section with BTI and PAC.

This patch adds the GNU NOTE section to the BTI and/or PAC
enabled objects for linux targets.

The patches for needed for these in binutils are already approved
and committed.
https://sourceware.org/ml/binutils/2019-03/msg00072.html

*** gcc/ChangeLog ***

2018-04-23  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define for
AArch64.
(aarch64_file_end_indicate_exec_stack): Add gnu note section.

gcc/testsuite/ChangeLog:

2018-04-23  Sudakshina Das  <sudi.das@arm.com>

* gcc.target/aarch64/bti-1.c: Add scan directive for gnu note section
for linux targets.
* gcc.target/aarch64/va_arg_1.c: Update scan directive to not clash
with GNU note section.

From-SVN: r270515

6 years agore PR d/90079 (SEGV in _aaKeys, _aaValues on 32-bit SPARC)
Iain Buclaw [Tue, 23 Apr 2019 15:19:55 +0000 (15:19 +0000)] 
re PR d/90079 (SEGV in _aaKeys, _aaValues on 32-bit SPARC)

PR d/90079
libphobos: Fix SEGV in _aaKeys, _aaValues on 32-bit SPARC

Merges upstream druntime b43203a1

Reviewed-on: https://github.com/dlang/druntime/pull/2572

From-SVN: r270514

6 years ago* lib/target-supports.exp
Jeff Law [Tue, 23 Apr 2019 14:39:50 +0000 (08:39 -0600)] 
* lib/target-supports.exp
(check_effective_target_keeps_null_pointer_checks): Add cr16.

From-SVN: r270513

6 years agomodulo-sched: prevent division by zero (PR87979)
Roman Zhuykov [Tue, 23 Apr 2019 13:14:57 +0000 (13:14 +0000)] 
modulo-sched: prevent division by zero (PR87979)

PR rtl-optimization/87979
* modulo-sched.c (sms_schedule): Start ii value "mii" should
not equal zero.

testsuite:

PR rtl-optimization/87979
* gcc.dg/pr87979.c: New test.

From-SVN: r270512

6 years agomodulo-sched: fix branch scheduling issue (PR84032)
Roman Zhuykov [Tue, 23 Apr 2019 12:53:43 +0000 (12:53 +0000)] 
modulo-sched: fix branch scheduling issue (PR84032)

PR rtl-optimization/84032
* modulo-sched.c (ps_insn_find_column): Change condition so that
branch will always be the last insn in a row inside partial
schedule.

testsuite:

PR rtl-optimization/84032
* gcc.dg/pr84032.c: New test.

From-SVN: r270511

6 years agoImplement correct std::variant triviality rules from P0602R4
Jonathan Wakely [Tue, 23 Apr 2019 12:48:28 +0000 (13:48 +0100)] 
Implement correct std::variant triviality rules from P0602R4

The std::variant move assignment operator should not be trivial if the
variant is not trivially move constructible.

* include/std/variant (__detail::__variant::_Traits): Make
_S_trivial_copy_assign depend on _S_trivial_copy_ctor and make
_S_trivial_move_assign depend on _S_trivial_move_ctor, as per
P0602R4.
(__detail::__variant::_Copy_assign_alias): Only depend on
_S_trivial_copy_assign, which subsumes _S_trivial_copy_ctor now.
* testsuite/20_util/variant/compile.cc: Correct checks for trivial
move assignment operators.

From-SVN: r270510

6 years agoPR libstdc++/90165 constrain variant(T&&) constructor
Jonathan Wakely [Tue, 23 Apr 2019 12:48:18 +0000 (13:48 +0100)] 
PR libstdc++/90165 constrain variant(T&&) constructor

Also refactor some constraints slightly to be more readable.

PR libstdc++/90165
* include/std/variant (variant::__not_self): New helper for the
is_same_v<remove_cvref_t<T>, variant>==false constraints.
(variant::__to_type_impl): Remove.
(variant::__to_type): Add default argument to check pack size, instead
of using __to_type_impl.
(variant::__accepted_type): Add default argument using __not_self.
(variant::__is_in_place_tag, variant::__not_in_place_tag): New helpers
for variant(T&&) constructor constraint.
(variant::variant(T&&)): Use __not_in_place_tag in constraints.
Extract __accepted_type into a named template parameter for reuse in
other constraints and in the exception specification.
(variant::variant(in_place_type_t<T>, Args&&...))
(variant::variant(in_place_type_t<T>, initializer_list<U>, Args&&...))
(variant::variant(in_place_index_t<T>, Args&&...))
(variant::variant(in_place_index_t<T>, initializer_list<U>, Args&&...))
(variant::operator=T&&)): Remove redundant && from trait arguments.
* testsuite/20_util/variant/compile.cc: Check variant(T&&) constructor
isn't used for in_place_type or in_place_index arguments.

From-SVN: r270509

6 years agoCorrections for C++2a std::unwrap_reference traits
Jonathan Wakely [Tue, 23 Apr 2019 10:27:14 +0000 (11:27 +0100)] 
Corrections for C++2a std::unwrap_reference traits

The P0318R1 paper added to the C++2a draft recently was not the latest
version of the paper, and should have included these changes. These
changes will be made to the working draft via a Defect Report, so I'm
applying them to libstdc++ now.

* include/std/type_traits (unwrap_reference_t): Define for C++2a.
(unwrap_ref_decay): Remove inheritance from unwrap_reference.
* testsuite/20_util/unwrap_reference/1.cc: Adjust test to use alias.

From-SVN: r270506

6 years agore PR debug/90131 (wrong debug info at -O3)
Richard Biener [Tue, 23 Apr 2019 10:10:10 +0000 (10:10 +0000)] 
re PR debug/90131 (wrong debug info at -O3)

2019-04-23  Richard Biener  <rguenther@suse.de>

PR debug/90131
* tree-cfgcleanup.c (move_debug_stmts_from_forwarder): Add
dest_single_pred_p argument.
(remove_forwarder_block): Adjust.
(remove_forwarder_block_with_phi): Likewise.

From-SVN: r270505

6 years agore PR target/89093 (C++ exception handling clobbers d8 VFP register)
Ramana Radhakrishnan [Tue, 23 Apr 2019 10:03:41 +0000 (10:03 +0000)] 
re PR target/89093 (C++ exception handling clobbers d8 VFP register)

PR target/89093
* config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Diagnose
if used with general-regs-only.
(arm_conditional_register_usage): Don't add non-general regs if
general-regs-only.
(arm_valid_target_attribute_rec): Handle general-regs-only.
* config/arm/arm.h (TARGET_HARD_FLOAT): Return false if
general-regs-only.
(TARGET_HARD_FLOAT_SUB): Define.
(TARGET_SOFT_FLOAT): Define as negation of TARGET_HARD_FLOAT_SUB.
(TARGET_REALLY_IWMMXT): Add && !TARGET_GENERAL_REGS_ONLY.
(TARGET_REALLY_IWMMXT2): Likewise.
* config/arm/arm.opt: Add -mgeneral-regs-only.
* doc/extend.texi: Document ARM general-regs-only target.
* doc/invoke.texi: Document ARM -mgeneral-regs-only.
libgcc/
* config/arm/pr-support.c: Add #pragma GCC target("general-regs-only").
* config/arm/unwind-arm.c: Likewise.
* unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target
attribute for ARM.
libobjc/
* exception.c (PERSONALITY_FUNCTION): Add general-regs-only target
attribute for ARM.
libphobos/
* libdruntime/gcc/deh.d: Import gcc.attribute.
(personality_fn_attributes): New enum.
(scanLSDA, CONTINUE_UNWINDING, gdc_personality, __gdc_personality):
Add @personality_fn_attributes.
libstdc++-v3/
* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Add
general-regs-only target attribute for ARM.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r270504

6 years agoFix whitespace in ChangeLog
Jonathan Wakely [Tue, 23 Apr 2019 09:55:36 +0000 (10:55 +0100)] 
Fix whitespace in ChangeLog

From-SVN: r270503

6 years agoFix std::variant regression caused by never-valueless optimization
Jonathan Wakely [Tue, 23 Apr 2019 09:55:33 +0000 (10:55 +0100)] 
Fix std::variant regression caused by never-valueless optimization

A regression was introduced by the recent changes to provide the strong
exception safety guarantee for "never valueless" types that have O(1),
non-throwing move assignment. The problematic code is:

  else if constexpr (__detail::__variant::_Never_valueless_alt<type>())
    {
      // This construction might throw:
      variant __tmp(in_place_index<_Np>, __il,
                    std::forward<_Args>(__args)...);
      // But _Never_valueless_alt<type> means this won't:
      *this = std::move(__tmp);
    }

When the variant is not assignable, the assignment is ill-formed, so
should not be attempted. When the variant has a copy assignment operator
but not a move assignment operator, the assignment performs a copy
assignment and that could throw, so should not be attempted.

The solution is to only take that branch when the variant has a move
assignment operator, which is determined by the _Traits::_S_move_assign
constant. When that is false the strong exception safety guarantee is
not possible, and so the __never_valueless function should also depend
on _S_move_assign.

While testing the fixes for this I noticed that the partial
specialization _Never_valueless_alt<basic_string<C,T,A>> incorrectly
assumed that is_nothrow_move_constructible<basic_string<C,T,A>> is
always true, but that's wrong for fully-dynamic COW strings. Fix the
partial specialization, and improve the comment describing
_Never_valueless_alt to be clear it depends on move construction as well
as move assignment.

Finally, I also observed that _Variant_storage<false, T...>::_M_valid()
was not taking advantage of the __never_valueless<T...>() function to
avoid a runtime check. Only the _Variant_storage<true, T...>::_M_valid()
function was using __never_valueless. That is also fixed.

PR libstdc++/87431
* include/bits/basic_string.h (_Never_valueless_alt): Make partial
specialization also depend on is_nothrow_move_constructible.
* include/std/variant (__detail::__variant::__never_valueless()):
Only true if the variant would have a move assignment operator.
(__detail::__variant::_Variant_storage<false, T...>::_M_valid()):
Check __never_valueless<T...>().
(variant::emplace): Only perform non-throwing move assignments
for never-valueless alternatives if the variant has a move assignment
operator.
* testsuite/20_util/variant/compile.cc: Check that never-valueless
types can be emplaced into non-assignable variants.
* testsuite/20_util/variant/run.cc: Check that never-valueless types
don't get copied when emplaced into non-assignable variants.

From-SVN: r270502

6 years agoMake some std::variant helper functions noexcept
Jonathan Wakely [Tue, 23 Apr 2019 09:55:28 +0000 (10:55 +0100)] 
Make some std::variant helper functions noexcept

* include/std/variant (__detail::__variant::__ref_cast): Remove
unused function.
(__detail::__variant::_Uninitialized::_M_get)
(__detail::__variant::__get)
(__gen_vtable_impl::__element_by_index_or_cookie): Add noexcept.

From-SVN: r270501

6 years agore PR tree-optimization/90078 (ICE with deep templates caused by overflow)
Bin Cheng [Tue, 23 Apr 2019 04:07:46 +0000 (04:07 +0000)] 
re PR tree-optimization/90078 (ICE with deep templates caused by overflow)

PR tree-optimization/90078
* tree-ssa-loop-ivopts.c (comp_cost::operator +,-,+=,-+,/=,*=): Add
checks for infinite_cost overflow.

gcc/testsuite
* gcc/testsuite/g++.dg/tree-ssa/pr90078.C: New test.

Also fix typo in ChangeLog entry for revision 270499.

From-SVN: r270500

6 years agore PR tree-optimization/90021 (ICE in index_in_loop_nest, at tree-data-ref.h:587...
Bin Cheng [Tue, 23 Apr 2019 03:54:59 +0000 (03:54 +0000)] 
re PR tree-optimization/90021 (ICE in index_in_loop_nest, at tree-data-ref.h:587 since r270203)

PR tree-optimization/92001
* tree-chrec.c (evolution_function_is_univariate_p): New parameter
and check univariate against it.
* tree-chrec.h (evolution_function_is_univariate_p): New parameter.
* tree-data-ref.c (add_other_self_distances): Pass new argument.

gcc/testsuite
* gcc/testsuite/gfortran.dg/pr90021.f90: New test.

From-SVN: r270499

6 years agoDaily bump.
GCC Administrator [Tue, 23 Apr 2019 00:16:13 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r270498

6 years agore PR fortran/90166 (Compiler Fails at Assembler)
Steven G. Kargl [Mon, 22 Apr 2019 21:00:40 +0000 (21:00 +0000)] 
re PR fortran/90166 (Compiler Fails at Assembler)

2019-04-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/90166
* decl.c (in_module_or_interface): New function to check that the
current state is in a module, submodule, or interface.
(gfc_match_prefix): Use it.

2019-04-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/90166
* gfortran.dg/submodule_22.f08: Add additional dg-error comments.

From-SVN: r270495

6 years agoPR c++/87366 - wrong error with alias template.
Jason Merrill [Mon, 22 Apr 2019 19:16:46 +0000 (15:16 -0400)] 
PR c++/87366 - wrong error with alias template.

With this testcase the code in template_args_equal to treat aliases as
distinct wasn't sufficient, because it only looked at the top level, whereas
here we have a reference to the alias.  So let's also handle treating them
as distinct in structural_comptypes.  For GCC 10 I have a more comprehensive
patch, but for GCC 9 let's go with this smaller change.

* typeck.c (structural_comptypes): When comparing_specializations,
aliases are unequal.
(comptypes): When comparing_specializations, do structural
comparison.

From-SVN: r270494

6 years agoAdd myself to MAINTAINERS
Roman Zhuykov [Mon, 22 Apr 2019 16:05:36 +0000 (16:05 +0000)] 
Add myself to MAINTAINERS

2019-04-22  Roman Zhuykov  <zhroma@ispras.ru>

* MAINTAINERS (Various Maintainers): Remove Ayal Zaks and add myself
as modulo-scheduler maintainer.

From-SVN: r270492

6 years agolibphobos: Merge upstream phobos b538f758a
Iain Buclaw [Mon, 22 Apr 2019 13:46:25 +0000 (13:46 +0000)] 
libphobos: Merge upstream phobos b538f758a

Fixes endian bugs in std.uni, and corrects unit-tests that failed on
version(BigEndian) targets.

Initial patch by Robin Dapp.

Reviewed-on: https://github.com/dlang/phobos/pull/6975

From-SVN: r270491

6 years agolibphobos: Merge upstream druntime 109f0f2e
Iain Buclaw [Mon, 22 Apr 2019 13:46:13 +0000 (13:46 +0000)] 
libphobos: Merge upstream druntime 109f0f2e

Backports more extern(C) bindings and platform ports.

Reviewed-on: https://github.com/dlang/druntime/pull/2569

From-SVN: r270490

6 years agore PR fortran/57284 ([OOP] ICE with find_array_spec for polymorphic arrays)
Paul Thomas [Mon, 22 Apr 2019 06:50:33 +0000 (06:50 +0000)] 
re PR fortran/57284 ([OOP] ICE with find_array_spec for polymorphic arrays)

2019-04-22  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/57284
* resolve.c (find_array_spec): If this is a class expression
and the symbol and component array specs are the same, this is
not an error.
*trans-intrinsic.c (gfc_conv_intrinsic_size): If a class symbol
argument, has no namespace, it has come from the interface
mapping and the _data component must be accessed directly.

2019-04-22  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/57284
* gfortran.dg/class_70.f03

From-SVN: r270489

6 years agoDaily bump.
GCC Administrator [Mon, 22 Apr 2019 00:16:16 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r270488