2016-08-14 Chung-Lin Tang <cltang@codesourcery.com>
PR fortran/70598
gcc/fortran/
* openmp.c (resolve_omp_clauses): Adjust use_device clause
handling to only allow pointers and arrays.
gcc/testsuite/
* gfortran.dg/goacc/host_data-tree.f95: Adjust to use pointers
in use_device clause.
* gfortran.dg/goacc/uninit-use-device-clause.f95: Likewise.
* gfortran.dg/goacc/list.f95: Adjust to catch
"neither a POINTER nor an array" error messages.
libgomp/
* testsuite/libgomp.oacc-fortran/host_data-1.f90: New test.
From-SVN: r239457
gcc/c/
* c-parser.c (c_parser_oacc_declare): Don't scan for
GOMP_MAP_POINTER.
* c-typeck.c (handle_omp_array_sections): Mark data clauses with
GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
zero-length subarrays.
gcc/cp/
* parser.c (cp_parser_oacc_declare): Don't scan for
GOMP_MAP_POINTER.
* semantics.c (handle_omp_array_sections): Mark data clauses with
GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
zero-length subarrays.
gcc/
* omp-low.c (lower_omp_target): Mark data clauses with
GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
zero-length subarrays.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c: New
test.
From-SVN: r238376
simd3.f90 and simd4.f90 fail only with -msse2. But they are compiled
with -mavx on AVX machines. Add 2 tests to compile simd3.f90 and
simd4.f90 with -msse2 on AVX machines.
PR middle-end/71734
* testsuite/libgomp.fortran/pr71734-1.f90: New test.
* testsuite/libgomp.fortran/pr71734-2.f90: Likewise.
From-SVN: r237950
* semantics.c (handle_omp_array_sections_1): Don't ICE when
processing_template_decl when checking for bitfields and unions.
Look through REFERENCE_REF_P as base of COMPONENT_REF.
(finish_omp_clauses): Look through REFERENCE_REF_P even for
array sections with COMPONENT_REF bases.
* testsuite/libgomp.c++/target-21.C: New test.
From-SVN: r237554
* gimplify.c (gimplify_scan_omp_clauses): Handle COMPONENT_REFs
with base of reference to struct.
* parser.c (cp_parser_omp_var_list_no_open): Call
convert_from_reference before cp_parser_postfix_dot_deref_expression.
* semantics.c (finish_omp_clauses): Don't ICE when
processing_template_decl when checking for bitfields and unions.
Look through REFERENCE_REF_P as base of COMPONENT_REF.
* testsuite/libgomp.c++/target-20.C: New test.
From-SVN: r237538
* c-parser.c (c_parser_omp_clause_schedule): Warn if
OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
* semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
* openmp.c (resolve_omp_clauses): Warn if chunk_size is known not to
be positive.
* c-c++-common/gomp/schedule-1.c: New test.
* gfortran.dg/gomp/schedule-1.f90: New test.
* testsuite/libgomp.c/doacross-1.c (main): Use schedule(static)
instead of invalid schedule(static, 0).
* testsuite/libgomp.c/doacross-2.c (main): Likewise.
From-SVN: r236793
2016-05-23 Martin Jambor <mjambor@suse.cz>
* hsa-gen.c (gen_hsa_insns_for_switch_stmt): Create an empty
default block if a PHI node in the original one would be resized.
libgomp/
* testsuite/libgomp.hsa.c/switch-sbr-2.c: New test.
From-SVN: r236585
2016-05-16 Martin Jambor <mjambor@suse.cz>
* hsa-gen.c (fillup_for_decl): Increase alignment to natural one.
(get_symbol_for_decl): Sorry if a global symbol in under-aligned.
libgomp/
* testsuite/libgomp.hsa.c/complex-align-2.c: New test.
From-SVN: r236295
PR middle-end/70680
* gimplify.c (gimplify_omp_for): Call omp_notice_variable for
implicitly linear or lastprivate iterator on the outer context.
* testsuite/libgomp.c/pr70680-1.c: New test.
* testsuite/libgomp.c/pr70680-2.c: New test.
From-SVN: r235232
PR middle-end/70643
gcc/
* omp-low.c (lower_oacc_reductions): Check for TREE_CONSTANT
when building a mem ref for the incoming reduction variable.
libgomp/
* testsuite/libgomp.oacc-fortran/pr70643.f90: New test.
From-SVN: r234973
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary. Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.
gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.
From-SVN: r234840
PR c++/70376
* cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
for OMP_TASKLOOP here.
(cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
* testsuite/libgomp.c++/pr70376.C: New test.
From-SVN: r234437
PR libgomp/69555
* gimplify.c (gimplify_decl_expr): For decls with REFERENCE_TYPE, also
gimplify_type_sizes the type they refer to.
(omp_notice_variable): Handle reference vars to VLAs.
* omp-low.c (lower_omp_target): Emit setup of OMP_CLAUSE_PRIVATE reference
to VLA decls in the second pass instead of first pass.
* testsuite/libgomp.c++/pr69555-1.C: New test.
* testsuite/libgomp.c++/pr69555-2.C: New test.
From-SVN: r233913
2016-02-26 Keith McDaniel <k.allen.mcdaniel@gmail.com>
Martin Jambor <mjambor@suse.cz>
* testsuite/lib/libgomp.exp
(check_effective_target_offload_device_shared_as): New proc.
* testsuite/libgomp.c++/declare_target-1.C: New test.
Co-Authored-By: Martin Jambor <mjambor@suse.cz>
From-SVN: r233757
gcc/
PR driver/68463
* config/gnu-user.h (CRTOFFLOADBEGIN): Define. Add crtoffloadbegin.o if
offloading is enabled and -fopenacc or -fopenmp is specified.
(CRTOFFLOADEND): Likewise.
(GNU_USER_TARGET_STARTFILE_SPEC): Add CRTOFFLOADBEGIN.
(GNU_USER_TARGET_ENDFILE_SPEC): Add CRTOFFLOADEND.
* lto-wrapper.c (offloadbegin, offloadend): Remove static vars.
(offload_objects_file_name): New static var.
(tool_cleanup): Remove offload_objects_file_name file.
(find_offloadbeginend): Replace with ...
(find_crtoffloadtable): ... this.
(run_gcc): Remove offload_argc and offload_argv.
Get offload_objects_file_name from -foffload-objects=... option.
Read names of object files with offload from this file, pass them to
compile_images_for_offload_targets. Don't call find_offloadbeginend and
don't pass offloadbegin and offloadend to the linker. Don't pass
offload non-LTO files to the linker, because now they're not claimed.
libgcc/
PR driver/68463
* Makefile.in (crtoffloadtable$(objext)): New rule.
* configure.ac (extra_parts): Add crtoffloadtable$(objext) if
enable_offload_targets is not empty.
* configure: Regenerate.
* offloadstuff.c: Move __OFFLOAD_TABLE__ from crtoffloadend to
crtoffloadtable.
libgomp/
PR driver/68463
* testsuite/libgomp.oacc-c-c++-common/parallel-dims-2.c: Remove.
lto-plugin/
PR driver/68463
* lto-plugin.c (struct plugin_offload_file): New.
(offload_files): Change type.
(offload_files_last, offload_files_last_obj): New.
(offload_files_last_lto): New.
(free_2): Adjust accordingly.
(all_symbols_read_handler): Don't add offload files to lto_arg_ptr.
Don't call free_1 for offload_files. Write names of object files with
offloading to the temporary file. Add new option to lto_arg_ptr.
(claim_file_handler): Don't claim file if it contains offload sections
without LTO sections. If it contains offload sections, add to the list.
From-SVN: r233712
gcc/
* config/nvptx/nvptx.c (nvptx_gen_shuffle): Add support for QImode
and HImode registers.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/vprop.c: New test.
From-SVN: r233607
PR driver/69805
* gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): Use
:%* in %:gt() argument.
(greater_than_spec_func): Adjust for expecting only numbers,
if there are more than two numbers, compare the last two.
* testsuite/libgomp.c/pr69805.c: New test.
From-SVN: r233573
2016-02-16 Tom de Vries <tom@codesourcery.com>
PR lto/67709
* omp-low.c (simd_clone_create): Remove call to
symtab->call_cgraph_insertion_hooks.
* testsuite/libgomp.fortran/declare-simd-4.f90: New test.
From-SVN: r233447
2016-02-09 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/69599
* tree-ssa-structalias.c (fndecl_maybe_in_other_partition): New
function.
(find_func_aliases_for_builtin_call, find_func_clobbers)
(ipa_pta_execute): Handle case that foo and foo._0 are not in same lto
partition.
* testsuite/libgomp.c/omp-nested-3.c: New test.
* testsuite/libgomp.c/pr46032-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/kernels-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/parallel-2.c: New test.
From-SVN: r233240