2017-12-30 Tom de Vries <tom@codesourcery.com>
PR libgomp/83046
* omp-expand.c (expand_omp_target): If in_lto_p, mark offload_funcs with
DECL_PRESERVE_P.
* lto-streamer-out.c (prune_offload_funcs): New function. Remove
offload_funcs entries that no longer have a corresponding cgraph_node.
Mark the remaining ones as DECL_PRESERVE_P.
(output_lto): Call prune_offload_funcs.
* testsuite/libgomp.oacc-c-c++-common/pr83046.c: New test.
* testsuite/libgomp.c-c++-common/pr83046.c: New test.
From-SVN: r256045
2017-12-27 Tom de Vries <tom@codesourcery.com>
PR c++/83046
* testsuite/libgomp.oacc-c-c++-common/gang-static-2.c (test_static)
(test_nonstatic): Fix return type to workaround PR83046.
From-SVN: r256008
PR fortran/81304
* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
attr.implicit_type in intrinsic_sym to avoid undesirable warning.
* testsuite/libgomp.fortran/pr81304.f90: New test.
From-SVN: r255144
2017-11-15 Tom de Vries <tom@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-1.c: New test, copied
from asyncwait-1.f90. Rewrite into C. Rewrite from float to int.
* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-2.c: New test, copied
from asyncwait-2.f90. Rewrite into C. Rewrite from float to int.
* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-3.c: New test, copied
from asyncwait-3.f90. Rewrite into C. Rewrite from float to int.
From-SVN: r254769
2017-11-14 Tom de Vries <tom@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Allow to run for
non-nvidia devices.
From-SVN: r254723
PR c++/82835
* cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
convert_default_arg instead of i.
* testsuite/libgomp.c++/pr82835.C: New test.
From-SVN: r254511
2017-10-31 Tom de Vries <tom@codesourcery.com>
* plugin/plugin-hsa.c (HSA_LOG): Remove semicolon after
"do {} while (false)".
(init_single_kernel, GOMP_OFFLOAD_async_run): Add missing semicolon
after HSA_DEBUG call.
From-SVN: r254264
* target.c (struct gomp_coalesce_buf): New type.
(MAX_COALESCE_BUF_SIZE, MAX_COALESCE_BUF_GAP): Define.
(gomp_coalesce_buf_add, gomp_to_device_kind_p): New functions.
(gomp_copy_host2dev): Add CBUF argument, if copying into
the cached ranges, memcpy into buffer instead of copying
into device.
(gomp_map_vars_existing, gomp_map_pointer, gomp_map_fields_existing):
Add CBUF argument, pass it through to other calls.
(gomp_map_vars): Aggregate copies from host to device if small enough
and with small enough gaps in between into memcpy into a buffer and
fewer host to device copies from the buffer.
(gomp_update): Adjust gomp_copy_host2dev caller.
From-SVN: r254194
2017-10-09 Martin Jambor <mjambor@suse.cz>
PR hsa/82416
gcc/
* hsa-common.h (hsa_op_with_type): New method extend_int_to_32bit.
* hsa-gen.c (hsa_extend_inttype_to_32bit): New function.
(hsa_type_for_scalar_tree_type): Use it. Always force min32int for
COMPLEX types.
(hsa_fixup_mov_insn_type): New function.
(hsa_op_with_type::get_in_type): Use it.
(hsa_build_append_simple_mov): Likewise. Allow sub-32bit
immediates in an assert.
(hsa_op_with_type::extend_int_to_32bit): New method.
(gen_hsa_insns_for_bitfield): Fixup instruction and intermediary
types. Convert to dest type if necessary.
(gen_hsa_insns_for_bitfield_load): Fixup load type if necessary.
(reg_for_gimple_ssa): Pass false as min32int to
hsa_type_for_scalar_tree_type.
(gen_hsa_addr): Fixup type when creating addresable temporary.
(gen_hsa_cmp_insn_from_gimple): Extend operands if necessary.
(gen_hsa_unary_operation): Extend operands and convert to dest type if
necessary. Call hsa_fixup_mov_insn_type.
(gen_hsa_binary_operation): Changed operand types to hsa_op_with_type,
extend operands and convert to dest type if necessary.
(gen_hsa_insns_for_operation_assignment): Extend operands and convert
to dest type if necessary.
(set_output_in_type): Call hsa_fixup_mov_insn_type. Just ude dest
if conversion nt necessary and size matches.
(gen_hsa_insns_for_load): Call hsa_fixup_mov_insn_type, convert
to dest type if necessary.
(gen_hsa_insns_for_store): Call hsa_fixup_mov_insn_type.
(gen_hsa_insns_for_switch_stmt): Likewise. Also extend operands if
necessary.
(gen_hsa_clrsb): Likewise.
(gen_hsa_ffs): Likewise.
(gen_hsa_divmod): Extend operands and convert to dest type if
necessary.
(gen_hsa_atomic_for_builtin): Change type of op to hsa_op_with_type.
libgomp/
* testsuite/libgomp.hsa.c/pr82416.c: New test.
From-SVN: r253538
2017-10-04 Tom de Vries <tom@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c
(main): Reduce sum of arr elements. Assert that hres is exactly
representable in 32-bit floating point.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c
(main): Reduce sum of arr elements. Assert that hres and hmres are
exactly representable in 32-bit floating point.
* testsuite/libgomp.oacc-c-c++-common/reduction-7.c (gwv_np_4): Same.
From-SVN: r253398
2017-09-16 Tom de Vries <tom@codesourcery.com>
PR c/81875
* c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
cond itself.
* testsuite/libgomp.c-c++-common/pr81875.c: New test.
From-SVN: r252873
2017-09-14 Tom de Vries <tom@codesourcery.com>
* testsuite/libgomp.c++/cancel-taskgroup-1.C: Remove.
* testsuite/libgomp.c/cancel-taskgroup-1.c: Move to ...
* testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c: ... here.
* testsuite/libgomp.c/c.exp: Include test-cases from
libgomp.c-c++-common.
* testsuite/libgomp.c++/c++.exp: Same. Force c++-mode compilation of .c
files.
From-SVN: r252775
2017-08-07 Tom de Vries <tom@codesourcery.com>
PR middle-end/78266
* omp-expand.c (expand_oacc_for): Ensure diff_type is large enough.
* testsuite/libgomp.oacc-c-c++-common/vprop-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove xfail.
From-SVN: r250925
PR c/45784
* c-omp.c (c_finish_omp_for): If the condition is wrapped in
rhs of COMPOUND_EXPR(s), skip them and readd their lhs into
new COMPOUND_EXPRs around the rhs of the comparison.
* testsuite/libgomp.c/pr45784.c: New test.
* testsuite/libgomp.c++/pr45784.C: New test.
From-SVN: r250635
2017-06-27 Tom de Vries <tom@codesourcery.com>
* plugin/plugin-nvptx.c (notify_var): New function.
(nvptx_exec): Use notify_var for GOMP_OPENACC_DIM.
From-SVN: r249695
2017-06-27 Tom de Vries <tom@codesourcery.com>
* env.c (parse_unsigned_long_1): Factor out of ...
(parse_unsigned_long): ... here.
(parse_int_1): Factor out of ...
(parse_int): ... here.
(parse_int_secure): New function.
(initialize_env): Use parse_int_secure for GOMP_DEBUG.
* secure_getenv.h: Factor out of ...
* plugin/plugin-hsa.c: ... here.
* testsuite/libgomp.oacc-c-c++-common/gomp-debug-env.c: New test.
From-SVN: r249694
PR c++/81130
* gimplify.c (omp_add_variable): Don't force GOVD_SEEN for types
with ctors/dtors if GOVD_SHARED is set.
* testsuite/libgomp.c++/pr81130.C: New test.
From-SVN: r249445
PR libgomp/80822
* config/linux/affinity.c (gomp_affinity_init_level_1): New function.
(gomp_affinity_init_level): Use it. Always analyze the core and thread
sibling lists, depending on level just pick up what CPUs to put
together into a place vs. whether add multiple ordered places.
From-SVN: r248683
libgomp/
* openacc_lib.h (acc_pcopyin, acc_pcreate): Route to
acc_present_or_copyin and acc_present_or_create procedures,
respectively.
* testsuite/libgomp.oacc-fortran/lib-32-1.f: Exercise these, and
generally different variants of OpenACC Runtime Library functions.
* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.
From-SVN: r248412
libgomp/
* openacc.h (acc_pcopyin, acc_pcreate): Provide prototypes instead
of preprocessor definitions.
* libgomp.h (strong_alias): Guard by "#ifdef
HAVE_ATTRIBUTE_ALIAS".
* oacc-mem.c: Provide "acc_pcreate" as alias for
"acc_present_or_create", and "acc_pcopyin" as alias for
"acc_present_or_copyin".
* libgomp.map: New version "OACC_2.0.1".
(OACC_2.0.1): Add "acc_pcopyin", and "acc_pcreate".
* testsuite/libgomp.oacc-c-c++-common/lib-38.c: Remove, merging
its content into...
* testsuite/libgomp.oacc-c-c++-common/lib-32.c: ... this file.
Extend testing.
From-SVN: r248410
PR middle-end/80809
* omp-low.c (finish_taskreg_remap): New function.
(finish_taskreg_scan): If unit size of ctx->record_type
is non-constant, unshare the size expression and replace
decls in it with possible outer var refs.
* testsuite/libgomp.c/pr80809-2.c: New test.
* testsuite/libgomp.c/pr80809-3.c: New test.
From-SVN: r248346
PR middle-end/80809
* gimplify.c (omp_add_variable): For GOVD_DEBUG_PRIVATE use
GOVD_SHARED rather than GOVD_PRIVATE with it.
(gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Expect
GOVD_SHARED rather than GOVD_PRIVATE with GOVD_DEBUG_PRIVATE.
* testsuite/libgomp.c/pr80809-1.c: New test.
From-SVN: r248345