Tom de Vries [Tue, 13 Oct 2015 22:10:45 +0000 (22:10 +0000)]
Check no unreachable blocks in inverted_post_order_compute
2015-10-14 Tom de Vries <tom@codesourcery.com>
* cfganal.c (verify_no_unreachable_blocks): New function.
(inverted_post_order_compute) [ENABLE_CHECKING]: Call
verify_no_unreachable_blocks.
cfganal.h (verify_no_unreachable_blocks): Declare.
From-SVN: r228789
Mikhail Maltsev [Tue, 13 Oct 2015 21:31:48 +0000 (21:31 +0000)]
[PATCH 1/9] ENABLE_CHECKING refactoring
[PATCH 1/9] ENABLE_CHECKING refactoring
gcc/ChangeLog:
2015-10-05 Mikhail Maltsev <maltsevm@gmail.com>
* common.opt: Add flag_checking.
* system.h (CHECKING_P): Define.
libcpp/ChangeLog:
2015-10-05 Mikhail Maltsev <maltsevm@gmail.com>
* system.h (CHECKING_P, gcc_checking_assert): Define.
From-SVN: r228787
Nathan Froyd [Tue, 13 Oct 2015 20:55:44 +0000 (20:55 +0000)]
opt_random.h: Include pmmintrin.h instead of x86intrin.h, and only do so when __SSE3__
* config/cpu/i486/opt/bits/opt_random.h: Include pmmintrin.h instead
of x86intrin.h, and only do so when __SSE3__
* include/ext/random: Include emmintrin.h instead of x86intrin.h
From-SVN: r228786
Jakub Jelinek [Tue, 13 Oct 2015 19:06:23 +0000 (21:06 +0200)]
builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, [...]): New.
gcc/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
Ilya Verbin <ilya.verbin@intel.com>
* builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New.
(BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove.
* cgraph.h (enum cgraph_simd_clone_arg_type): Add
SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP,
SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and
SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP.
(struct cgraph_simd_clone_arg): Adjust comment.
* coretypes.h (struct gomp_ordered): New forward decl.
* gimple.c (gimple_build_omp_critical): Add CLAUSES argument,
set critical clauses to it.
(gimple_build_omp_ordered): Return gomp_ordered * instead of
gimple *. Add CLAUSES argument, set ordered clauses to it.
(gimple_copy): Unshare clauses on GIMPLE_OMP_CRITICAL and
GIMPLE_OMP_ORDERED.
* gimple.def (GIMPLE_OMP_ORDERED): Change from GSS_OMP to
GSS_OMP_SINGLE_LAYOUT, move it after GIMPLE_OMP_TEAMS.
* gimple.h (enum gf_mask): Add GF_OMP_TASK_TASKLOOP. Add another bit
to GF_OMP_FOR_KIND_MASK mask. Add GF_OMP_FOR_KIND_TASKLOOP, renumber
GF_OMP_FOR_KIND_CILKFOR and GF_OMP_FOR_KIND_OACC_LOOP. Adjust
GF_OMP_FOR_SIMD, GF_OMP_FOR_COMBINED and GF_OMP_FOR_COMBINED_INTO.
Add another bit to GF_OMP_TARGET_KIND_MASK mask. Add
GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA,
renumber
GF_OMP_TARGET_KIND_OACC_{PARALLEL,KERNELS,DATA,UPDATE,ENTER_EXIT_DATA}.
(gomp_critical): Add clauses field.
(gomp_ordered): New struct.
(is_a_helper <gomp_ordered *>::test): New inline.
(gimple_build_omp_critical): Add CLAUSES argument.
(gimple_build_omp_ordered): Likewise. Return gomp_ordered *
instead of gimple *.
(gimple_omp_critical_clauses, gimple_omp_critical_clauses_ptr,
gimple_omp_critical_set_clauses, gimple_omp_ordered_clauses,
gimple_omp_ordered_clauses_ptr, gimple_omp_ordered_set_clauses,
gimple_omp_task_taskloop_p, gimple_omp_task_set_taskloop_p): New
inline functions.
* gimple-pretty-print.c (dump_gimple_omp_for): Handle taskloop.
(dump_gimple_omp_target): Handle enter data and exit data.
(dump_gimple_omp_block): Don't handle GIMPLE_OMP_ORDERED here.
(dump_gimple_omp_critical): Print clauses.
(dump_gimple_omp_ordered): New function.
(dump_gimple_omp_task): Handle taskloop.
(pp_gimple_stmt_1): Use dump_gimple_omp_ordered for
GIMPLE_OMP_ORDERED.
* gimple-walk.c (walk_gimple_op): Walk clauses on
GIMPLE_OMP_CRITICAL and GIMPLE_OMP_ORDERED.
* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_0LEN_ARRAY.
(enum omp_region_type): Add ORT_COMBINED_TARGET and ORT_NONE.
(struct gimplify_omp_ctx): Add loop_iter_var,
target_map_scalars_firstprivate, target_map_pointers_as_0len_arrays
and target_firstprivatize_array_bases fields.
(delete_omp_context): Release loop_iter_var.
(gimplify_bind_expr): Handle ORT_NONE.
(maybe_fold_stmt): Adjust check for ORT_TARGET for the addition of
ORT_COMBINED_TARGET.
(is_gimple_stmt): Return true for OMP_TASKLOOP, OMP_TEAMS and
OMP_TARGET{,_DATA,_UPDATE,_ENTER_DATA,_EXIT_DATA}.
(omp_firstprivatize_variable): Handle ORT_NONE. Adjust check for
ORT_TARGET for the addition of ORT_COMBINED_TARGET. Handle
ctx->target_map_scalars_firstprivate.
(omp_add_variable): Handle ORT_NONE. Allow map clause together with
data sharing clauses. For data sharing clause with VLA decl
on omp target/target data don't add firstprivate for the pointer.
Call omp_notice_variable on TYPE_SIZE_UNIT only if it is a DECL_P.
(omp_notice_threadprivate_variable): Adjust check for ORT_TARGET for
the addition of ORT_COMBINED_TARGET.
(omp_notice_variable): Handle ORT_NONE. Adjust check for ORT_TARGET
for the addition of ORT_COMBINED_TARGET. Handle implicit mapping of
pointers as zero length array sections and
ctx->target_map_scalars_firstprivate mapping of scalars as firstprivate
data sharing.
(omp_check_private): Handle omp_member_access_dummy_var vars.
(find_decl_expr): New function.
(gimplify_scan_omp_clauses): Add CODE argument. For OMP_CLAUSE_IF
complain if OMP_CLAUSE_IF_MODIFIER is present and does not match code.
Handle OMP_CLAUSE_GANG separately. Handle
OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN}
clauses. Diagnose linear clause on combined
distribute {, parallel for} simd construct, unless it is the loop
iterator. Handle struct element GOMP_MAP_FIRSTPRIVATE_POINTER.
Handle map clauses with COMPONENT_REF. Initialize
ctx->target_map_scalars_firstprivate,
ctx->target_firstprivatize_array_bases and
ctx->target_map_pointers_as_0len_arrays. Add firstprivate for
linear clause even to target region if combined. Remove
map clauses with GOMP_MAP_FIRSTPRIVATE_POINTER kind from
OMP_TARGET_{,ENTER_,EXIT_}DATA. For GOMP_MAP_FIRSTPRIVATE_POINTER
map kind with non-INTEGER_CST OMP_CLAUSE_SIZE firstprivatize the bias.
Handle OMP_CLAUSE_DEPEND_{SINK,SOURCE}. Handle
OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}.
For linear clause on worksharing loop combined with parallel add
shared clause on the parallel. Handle OMP_CLAUSE_REDUCTION
with MEM_REF OMP_CLAUSE_DECL. Set DECL_NAME on
omp_member_access_dummy_var vars. Add lastprivate clause to outer
taskloop if needed.
(gimplify_adjust_omp_clauses_1): Handle GOVD_MAP_0LEN_ARRAY.
If gimplify_omp_ctxp->target_firstprivatize_array_bases, use
GOMP_MAP_FIRSTPRIVATE_POINTER map kind instead of
GOMP_MAP_POINTER.
(gimplify_adjust_omp_clauses): Add CODE argument. Handle removal
of GOMP_MAP_FIRSTPRIVATE_POINTER struct elements for struct not seen
in target body. Handle removal of struct mapping if struct is not
seen in target body. Remove GOMP_MAP_STRUCT map clause on
OMP_TARGET_EXIT_DATA. Adjust check for ORT_TARGET for the
addition of ORT_COMBINED_TARGET. Use GOMP_MAP_FIRSTPRIVATE_POINTER
instead of GOMP_MAP_POINTER if ctx->target_firstprivatize_array_bases
for VLAs. Set OMP_CLAUSE_MAP_PRIVATE if both data sharing and map
clause appear together. Handle
OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}. Don't remove map
clause if it has map-type-modifier always. Handle
OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN}
clauses.
(gimplify_oacc_cache, gimplify_omp_parallel, gimplify_omp_task):
Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses
callers.
(gimplify_omp_for): Likewise. Handle OMP_TASKLOOP. Initialize
loop_iter_var. Use OMP_FOR_ORIG_DECLS. Fix handling of lastprivate
iterators in doacross loops.
(gimplify_omp_workshare): Adjust gimplify_scan_omp_clauses and
gimplify_adjust_omp_clauses callers. Use ORT_COMBINED_TARGET
for OMP_TARGET_COMBINED. Adjust check for ORT_TARGET
for the addition of ORT_COMBINED_TARGET.
(gimplify_omp_target_update): Adjust gimplify_scan_omp_clauses and
gimplify_adjust_omp_clauses callers. Handle OMP_TARGET_ENTER_DATA
and OMP_TARGET_EXIT_DATA.
(gimplify_omp_ordered): New function.
(gimplify_expr): Handle OMP_TASKLOOP, OMP_TARGET_ENTER_DATA and
OMP_TARGET_EXIT_DATA. Use gimplify_omp_ordered for OMP_ORDERED.
Gimplify clauses on OMP_CRITICAL.
* internal-fn.c (expand_GOMP_SIMD_ORDERED_START,
expand_GOMP_SIMD_ORDERED_END): New functions.
* internal-fn.def (GOMP_SIMD_ORDERED_START,
GOMP_SIMD_ORDERED_END): New internal functions.
* omp-builtins.def (BUILT_IN_GOMP_LOOP_DOACROSS_STATIC_START,
BUILT_IN_GOMP_LOOP_DOACROSS_DYNAMIC_START,
BUILT_IN_GOMP_LOOP_DOACROSS_GUIDED_START,
BUILT_IN_GOMP_LOOP_DOACROSS_RUNTIME_START,
BUILT_IN_GOMP_LOOP_ULL_DOACROSS_STATIC_START,
BUILT_IN_GOMP_LOOP_ULL_DOACROSS_DYNAMIC_START,
BUILT_IN_GOMP_LOOP_ULL_DOACROSS_GUIDED_START,
BUILT_IN_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START,
BUILT_IN_GOMP_DOACROSS_POST, BUILT_IN_GOMP_DOACROSS_WAIT,
BUILT_IN_GOMP_DOACROSS_ULL_POST, BUILT_IN_GOMP_DOACROSS_ULL_WAIT,
BUILT_IN_GOMP_TARGET_ENTER_EXIT_DATA, BUILT_IN_GOMP_TASKLOOP,
BUILT_IN_GOMP_TASKLOOP_ULL): New built-ins.
(BUILT_IN_GOMP_TASK): Add INT argument to the end.
(BUILT_IN_GOMP_TARGET): Rename from GOMP_target to GOMP_target_41,
adjust type.
(BUILT_IN_GOMP_TARGET_DATA): Rename from GOMP_target_data to
GOMP_target_data_41, adjust type.
(BUILT_IN_GOMP_TARGET_UPDATE): Rename from GOMP_target_update to
GOMP_target_update_41, adjust type.
* omp-low.c (struct omp_region): Adjust comments, add ord_stmt
field.
(struct omp_for_data): Add ordered and simd_schedule fields.
(omp_member_access_dummy_var, unshare_and_remap_1,
unshare_and_remap, is_taskloop_ctx): New functions.
(is_taskreg_ctx): Use is_parallel_ctx and is_task_ctx.
(extract_omp_for_data): Handle taskloops and doacross loops
and simd schedule modifier.
(omp_adjust_chunk_size): New function.
(get_ws_args_for): Use it.
(lookup_sfield): Change first argument to splay_tree_key,
add overload with first argument tree.
(maybe_lookup_field): Likewise.
(use_pointer_for_field): Handle omp_member_access_dummy_var.
(omp_copy_decl_2): If var is TREE_ADDRESSABLE listed in
task_shared_vars, clear TREE_ADDRESSABLE on the copy.
(build_outer_var_ref): Add LASTPRIVATE argument, handle
taskloops and omp_member_access_dummy_var vars.
(build_sender_ref): Change first argument to splay_tree_key,
add overload with first argument tree.
(install_var_field): For mask & 8 use &DECL_UID as key instead
of the tree itself.
(fixup_child_record_type): Const qualify *.omp_data_i.
(scan_sharing_clauses): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE,
C/C++ array reductions, OMP_CLAUSE_{IS,USE}_DEVICE_PTR clauses,
OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,SIMDLEN,THREADS,SIMD} and
OMP_CLAUSE_{NOGROUP,DEFAULTMAP} clauses, OMP_CLAUSE__LOOPTEMP_ clause
on taskloop, GOMP_MAP_FIRSTPRIVATE_POINTER, OMP_CLAUSE_MAP_PRIVATE.
(create_omp_child_function): Set TREE_READONLY on .omp_data_i.
(find_combined_for): Allow searching for different GIMPLE_OMP_FOR
kinds.
(add_taskreg_looptemp_clauses): New function.
(scan_omp_parallel): Use it.
(scan_omp_task): Likewise.
(finish_taskreg_scan): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE.
For taskloop, move fields for the first two _LOOPTEMP_ clauses first.
(check_omp_nesting_restrictions): Handle GF_OMP_TARGET_KIND_ENTER_DATA
and GF_OMP_TARGET_KIND_EXIT_DATA. Formatting fixes. Allow the
sandwiched taskloop constructs. Type check
OMP_CLAUSE_DEPEND_{KIND,SOURCE}. Allow ordered simd inside of simd
region. Diagnose depend(source) or depend(sink:...) on
target constructs or task/taskloop.
(handle_simd_reference): Use get_name.
(lower_rec_input_clauses): Likewise. Ignore all
OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses on taskloop construct.
Allow _LOOPTEMP_ clause on GOMP_TASK. Unshare new_var
before passing it to omp_clause_{default,copy}_ctor. Handle
OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Set
lastprivate_firstprivate flag for linear that needs copyin and
copyout. Use BUILT_IN_ALLOCA_WITH_ALIGN instead of BUILT_IN_ALLOCA.
(lower_lastprivate_clauses): For OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE
on taskloop lookup decl in outer context. Pass true to
build_outer_var_ref lastprivate argument. Handle
OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV lastprivate if the decl is global
outside of outer taskloop for.
(lower_reduction_clauses): Handle OMP_CLAUSE_REDUCTION with MEM_REF
OMP_CLAUSE_DECL.
(lower_send_clauses): Ignore first two _LOOPTEMP_ clauses in taskloop
GOMP_TASK. Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. Handle
omp_member_access_dummy_var vars. Handle OMP_CLAUSE_REDUCTION
with MEM_REF OMP_CLAUSE_DECL. Use new lookup_sfield overload.
(lower_send_shared_vars): Ignore fields with NULL or FIELD_DECL
abstract origin. Handle omp_member_access_dummy_var vars.
(expand_parallel_call): Use expand_omp_build_assign.
(expand_task_call): Handle taskloop construct expansion. Add
REGION argument. Use GOMP_TASK_* defines instead of hardcoded
integers. Add priority argument to GOMP_task* calls. Or in
GOMP_TASK_FLAG_PRIORITY into flags if priority is present for
GOMP_task call.
(expand_omp_build_assign): Add prototype. Add AFTER
argument, if true emit statements after *GSI_P and continue linking.
(expand_omp_taskreg): Adjust expand_task_call caller.
(expand_omp_for_init_counts): Rename zero_iter_bb argument to
zero_iter1_bb and first_zero_iter to first_zero_iter1, add
zero_iter2_bb and first_zero_iter2 arguments, handle computation
of counts even for ordered loops.
(expand_omp_for_init_vars): Handle GOMP_TASK inner_stmt.
(expand_omp_ordered_source, expand_omp_ordered_sink,
expand_omp_ordered_source_sink, expand_omp_for_ordered_loops): New
functions.
(expand_omp_for_generic): Use omp_adjust_chunk_size. Handle linear
clauses on worksharing loop. Handle DOACROSS loop expansion.
(expand_omp_for_static_nochunk): Handle linear clauses on
worksharing loop. Adjust expand_omp_for_init_counts
callers.
(expand_omp_for_static_chunk): Likewise. Use omp_adjust_chunk_size.
(expand_omp_simd): Handle addressable fd->loop.v. Adjust
expand_omp_for_init_counts callers.
(expand_omp_taskloop_for_outer, expand_omp_taskloop_for_inner): New
functions.
(expand_omp_for): Call expand_omp_taskloop_for_* for taskloop.
Handle doacross loops.
(expand_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA and
GF_OMP_TARGET_KIND_EXIT_DATA. Pass flags and depend arguments to
GOMP_target_{41,update_41,enter_exit_data} libcalls.
(expand_omp): Don't expand ordered depend constructs here, record
ord_stmt instead for later expand_omp_for_generic.
(build_omp_regions_1): Handle GF_OMP_TARGET_KIND_ENTER_DATA and
GF_OMP_TARGET_KIND_EXIT_DATA. Treat GIMPLE_OMP_ORDERED with depend
clause as stand-alone directive.
(lower_omp_ordered_clauses): New function.
(lower_omp_ordered): Handle OMP_CLAUSE_SIMD, for OMP_CLAUSE_DEPEND
don't lower anything.
(lower_omp_for_lastprivate): Use last _looptemp_ clause
on taskloop for comparison.
(lower_omp_for): Handle taskloop constructs. Adjust OMP_CLAUSE_DECL
and OMP_CLAUSE_LINEAR_STEP so that expand_omp_for_* can use it during
expansion for linear adjustments.
(create_task_copyfn): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE.
(lower_depend_clauses): Assert not seeing sink/source depend kinds.
Set TREE_ADDRESSABLE on array. Change first argument from gimple *
to tree * pointing to the stmt's clauses.
(lower_omp_taskreg): Adjust lower_depend_clauses caller.
(lower_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA
and GF_OMP_TARGET_KIND_EXIT_DATA, depend clauses,
GOMP_MAP_{RELEASE,ALWAYS_{TO,FROM,TOFROM},FIRSTPRIVATE_POINTER,STRUCT}
map kinds, OMP_CLAUSE_{FIRSTPRIVATE,PRIVATE,{IS,USE}_DEVICE_PTR
clauses. Always use short kind and 8-bit align shift.
(lower_omp_regimplify_p): Use IS_TYPE_OR_DECL_P macro.
(struct lower_omp_regimplify_operands_data): New type.
(lower_omp_regimplify_operands_p, lower_omp_regimplify_operands):
New functions.
(lower_omp_1): Use lower_omp_regimplify_operands instead of
gimple_regimplify_operands.
(make_gimple_omp_edges): Handle GF_OMP_TARGET_KIND_ENTER_DATA and
GF_OMP_TARGET_KIND_EXIT_DATA. Treat GIMPLE_OMP_ORDERED with depend
clause as stand-alone directive.
(simd_clone_clauses_extract): Honor OMP_CLAUSE_LINEAR_KIND.
(simd_clone_mangle): Mangle the various linear kinds
per the new ABI.
(simd_clone_adjust_argument_types): Handle
SIMD_CLONE_ARG_TYPE_LINEAR_*_CONSTANT_STEP.
(simd_clone_init_simd_arrays): Don't do anything for uval.
(simd_clone_adjust): Handle
SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP like
SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP.
Handle SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP.
* omp-low.h (omp_member_access_dummy_var): New prototype.
* passes.def (pass_simduid_cleanup): Schedule another copy of the
pass after all optimizations.
* tree.c (omp_clause_code_name): Add entries for
OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}
and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}.
(omp_clause_num_ops): Likewise. Bump number of OMP_CLAUSE_REDUCTION
arguments to 5 and for OMP_CLAUSE_ORDERED to 1.
(walk_tree_1): Adjust for OMP_CLAUSE_ORDERED having 1 argument and
OMP_CLAUSE_REDUCTION 5 arguments. Handle
OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}
and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}
clauses.
* tree-core.h (enum omp_clause_linear_kind): New.
(struct tree_omp_clause): Change type of map_kind
from unsigned char to unsigned int. Add subcode.if_modifier
and subcode.linear_kind fields.
(enum omp_clause_code): Add
OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}
and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}.
(OMP_CLAUSE_REDUCTION): Document
OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER.
(enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_{SOURCE,SINK}.
* tree.def (OMP_FOR): Add OMP_FOR_ORIG_DECLS operand.
(OMP_CRITICAL): Move before OMP_SINGLE. Add OMP_CRITICAL_CLAUSES
operand.
(OMP_ORDERED): Move before OMP_SINGLE. Add OMP_ORDERED_CLAUSES
operand.
(OMP_TASKLOOP, OMP_TARGET_ENTER_DATA, OMP_TARGET_EXIT_DATA): New tree
codes.
* tree.h (OMP_BODY): Replace OMP_CRITICAL with OMP_TASKGROUP.
(OMP_CLAUSE_SET_MAP_KIND): Cast to unsigned int rather than unsigned
char.
(OMP_CRITICAL_NAME): Adjust to be 3rd operand instead of 2nd.
(OMP_CLAUSE_NUM_TASKS_EXPR): Formatting fix.
(OMP_STANDALONE_CLAUSES): Adjust to cover OMP_TARGET_{ENTER,EXIT}_DATA.
(OMP_CLAUSE_DEPEND_SINK_NEGATIVE, OMP_TARGET_COMBINED,
OMP_CLAUSE_MAP_PRIVATE, OMP_FOR_ORIG_DECLS, OMP_CLAUSE_IF_MODIFIER,
OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CRITICAL_CLAUSES,
OMP_CLAUSE_PRIVATE_TASKLOOP_IV, OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV,
OMP_CLAUSE_HINT_EXPR, OMP_CLAUSE_SCHEDULE_SIMD,
OMP_CLAUSE_LINEAR_KIND, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER,
OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_ORDERED_CLAUSES,
OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES,
OMP_CLAUSE_NUM_TASKS_EXPR, OMP_CLAUSE_GRAINSIZE_EXPR,
OMP_CLAUSE_PRIORITY_EXPR, OMP_CLAUSE_ORDERED_EXPR): Define.
* tree-inline.c (remap_gimple_stmt): Handle clauses on
GIMPLE_OMP_ORDERED and GIMPLE_OMP_CRITICAL. For
IFN_GOMP_SIMD_ORDERED_{START,END} set has_simduid_loops.
* tree-nested.c (convert_nonlocal_omp_clauses): Handle
OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD}
and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP}
clauses. Handle OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER.
(convert_local_omp_clauses): Likewise.
* tree-pretty-print.c (dump_omp_clause): Handle
OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD}
and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP}
clauses. Handle OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_ORDERED_EXPR,
OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_LINEAR_KIND,
OMP_CLAUSE_DEPEND_{SOURCE,SINK}. Use "delete" for
GOMP_MAP_FORCE_DEALLOC. Handle
GOMP_MAP_{ALWAYS_{TO,FROM,TOFROM},RELEASE,FIRSTPRIVATE_POINTER,STRUCT}.
(dump_generic_node): Handle OMP_TASKLOOP, OMP_TARGET_{ENTER,EXIT}_DATA
and clauses on OMP_ORDERED and OMP_CRITICAL.
* tree-vectorizer.c (adjust_simduid_builtins): Adjust comment.
Remove IFN_GOMP_SIMD_ORDERED_{START,END}.
(vectorize_loops): Adjust comments.
(pass_simduid_cleanup::execute): Likewise.
* tree-vect-stmts.c (vectorizable_simd_clone_call): Handle
SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_CONSTANT_STEP.
* wide-int.h (wi::gcd): New.
gcc/c-family/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
* c-common.c (enum c_builtin_type): Define DEF_FUNCTION_TYPE_9,
DEF_FUNCTION_TYPE_10 and DEF_FUNCTION_TYPE_11.
(c_define_builtins): Likewise.
* c-common.h (enum c_omp_clause_split): Add
C_OMP_CLAUSE_SPLIT_TASKLOOP.
(c_finish_omp_critical, c_finish_omp_ordered): Add CLAUSES argument.
(c_finish_omp_for): Add ORIG_DECLV argument.
* c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP as
201511 instead of 201307.
* c-omp.c (c_finish_omp_critical): Add CLAUSES argument, set
OMP_CRITICAL_CLAUSES to it.
(c_finish_omp_ordered): Add CLAUSES argument, set
OMP_ORDERED_CLAUSES to it.
(c_finish_omp_for): Add ORIG_DECLV argument, set OMP_FOR_ORIG_DECLS
to it if OMP_FOR. Clear DECL_INITIAL on the IVs.
(c_omp_split_clauses): Handle OpenMP 4.5 combined/composite
constructs and new OpenMP 4.5 clauses. Clear
OMP_CLAUSE_SCHEDULE_SIMD if not combined with OMP_SIMD. Add
verification code.
* c-pragma.c (omp_pragmas_simd): Add taskloop.
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKLOOP.
(enum pragma_omp_clause): Add
PRAGMA_OMP_CLAUSE_{DEFAULTMAP,GRAINSIZE,HINT,{IS,USE}_DEVICE_PTR}
and PRAGMA_OMP_CLAUSE_{LINK,NOGROUP,NUM_TASKS,PRIORITY,SIMD,THREADS}.
gcc/c/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
* c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here.
(c_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
(c_parser_omp_variable_list): Handle structure elements for
map, to and from clauses. Handle array sections in reduction
clause. Formatting fixes.
(c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
if clause modifiers.
(c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
c_parser_omp_clause_priority, c_parser_omp_clause_hint,
c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr,
c_parser_omp_clause_is_device_ptr): New functions.
(c_parser_omp_clause_ordered): Parse optional parameter.
(c_parser_omp_clause_reduction): Handle array reductions.
(c_parser_omp_clause_schedule): Parse optional simd modifier.
(c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New
functions.
(c_parser_omp_clause_linear): Parse linear clause modifiers.
(c_parser_omp_clause_depend_sink): New function.
(c_parser_omp_clause_depend): Parse source/sink depend kinds.
(c_parser_omp_clause_map): Parse release/delete map kinds and
optional always modifier.
(c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if
and c_finish_omp_clauses callers.
(c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
(c_parser_oacc_cache): Adjust c_finish_omp_clauses caller.
(OMP_CRITICAL_CLAUSE_MASK): Define.
(c_parser_omp_critical): Parse critical clauses.
(c_parser_omp_for_loop): Handle doacross loops, adjust
c_finish_omp_for and c_finish_omp_clauses callers.
(OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
(c_parser_omp_simd): Allow ordered clause if it has no parameter.
(OMP_FOR_CLAUSE_MASK): Add linear clause.
(c_parser_omp_for): Disallow ordered clause when combined with
distribute. Disallow linear clause when combined with distribute
and not combined with simd.
(OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
(c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument,
parse clauses and if depend clause is found, don't parse a body.
(c_parser_omp_parallel): Disallow copyin clause on target parallel.
Allow target parallel without for after it.
(OMP_TASK_CLAUSE_MASK): Add priority clause.
(OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
(c_parser_omp_target_data): Diagnose no map clauses or clauses with
invalid kinds.
(OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
(OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
(c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New
functions.
(OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
defaultmap and is_device_ptr clauses.
(c_parser_omp_target): Parse target parallel and target simd. Set
OMP_TARGET_COMBINED on combined constructs. Parse target enter data
and target exit data. Diagnose invalid map kinds.
(OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
(c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
construct.
(c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for
&omp_priv.
(OMP_TASKLOOP_CLAUSE_MASK): Define.
(c_parser_omp_taskloop): New function.
(c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
handle PRAGMA_OMP_TASKLOOP.
(c_parser_cilk_for): Adjust c_finish_omp_clauses callers.
* c-tree.h (c_finish_omp_clauses): Add two new arguments.
* c-typeck.c (handle_omp_array_sections_1): Fix comment typo.
Add IS_OMP argument, handle structure element bases, diagnose
bitfields, pass IS_OMP recursively, diagnose known zero length
array sections in depend clauses, handle array sections in reduction
clause, diagnose negative length even for pointers.
(handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
types, pass IS_OMP down to handle_omp_array_sections_1, handle
array sections in reduction clause, set
OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
(c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments.
Handle new OpenMP 4.5 clauses and new restrictions for the old ones.
gcc/cp/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
* class.c (finish_struct_1): Call finish_omp_declare_simd_methods.
* cp-gimplify.c (cp_gimplify_expr): Handle OMP_TASKLOOP.
(cp_genericize_r): Likewise.
(cxx_omp_finish_clause): Don't diagnose references.
(cxx_omp_disregard_value_expr): New function.
* cp-objcp-common.h (LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR): Redefine.
* cp-tree.h (OMP_FOR_GIMPLIFYING_P): Document for OMP_TASKLOOP.
(DECL_OMP_PRIVATIZED_MEMBER): Define.
(finish_omp_declare_simd_methods, push_omp_privatization_clauses,
pop_omp_privatization_clauses, save_omp_privatization_clauses,
restore_omp_privatization_clauses, omp_privatize_field,
cxx_omp_disregard_value_expr): New prototypes.
(finish_omp_clauses): Add two new arguments.
(finish_omp_for): Add ORIG_DECLV argument.
* parser.c (cp_parser_lambda_body): Call
save_omp_privatization_clauses and restore_omp_privatization_clauses.
(cp_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
(cp_parser_omp_var_list_no_open): Handle structure elements for
map, to and from clauses. Handle array sections in reduction
clause. Parse this keyword. Formatting fixes.
(cp_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
if clause modifiers.
(cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize,
cp_parser_omp_clause_priority, cp_parser_omp_clause_hint,
cp_parser_omp_clause_defaultmap): New functions.
(cp_parser_omp_clause_ordered): Parse optional parameter.
(cp_parser_omp_clause_reduction): Handle array reductions.
(cp_parser_omp_clause_schedule): Parse optional simd modifier.
(cp_parser_omp_clause_nogroup, cp_parser_omp_clause_orderedkind):
New functions.
(cp_parser_omp_clause_linear): Parse linear clause modifiers.
(cp_parser_omp_clause_depend_sink): New function.
(cp_parser_omp_clause_depend): Parse source/sink depend kinds.
(cp_parser_omp_clause_map): Parse release/delete map kinds and
optional always modifier.
(cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_if
and finish_omp_clauses callers.
(cp_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
(OMP_CRITICAL_CLAUSE_MASK): Define.
(cp_parser_omp_critical): Parse critical clauses.
(cp_parser_omp_for_incr): Use cp_tree_equal if
processing_template_decl.
(cp_parser_omp_for_loop_init): Return tree instead of bool. Handle
non-static data member iterators.
(cp_parser_omp_for_loop): Handle doacross loops, adjust
finish_omp_for and finish_omp_clauses callers.
(cp_omp_split_clauses): Adjust finish_omp_clauses caller.
(OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
(cp_parser_omp_simd): Allow ordered clause if it has no parameter.
(OMP_FOR_CLAUSE_MASK): Add linear clause.
(cp_parser_omp_for): Disallow ordered clause when combined with
distribute. Disallow linear clause when combined with distribute
and not combined with simd.
(OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
(cp_parser_omp_ordered): Add CONTEXT argument, return bool instead
of tree, parse clauses and if depend clause is found, don't parse
a body.
(cp_parser_omp_parallel): Disallow copyin clause on target parallel.
Allow target parallel without for after it.
(OMP_TASK_CLAUSE_MASK): Add priority clause.
(OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
(cp_parser_omp_target_data): Diagnose no map clauses or clauses with
invalid kinds.
(OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
(OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
(cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): New
functions.
(OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
defaultmap and is_device_ptr clauses.
(cp_parser_omp_target): Parse target parallel and target simd. Set
OMP_TARGET_COMBINED on combined constructs. Parse target enter data
and target exit data. Diagnose invalid map kinds.
(cp_parser_oacc_cache): Adjust finish_omp_clauses caller.
(OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
(cp_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
construct.
(OMP_TASKLOOP_CLAUSE_MASK): Define.
(cp_parser_omp_taskloop): New function.
(cp_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
handle PRAGMA_OMP_TASKLOOP.
(cp_parser_pragma): Handle PRAGMA_OMP_ORDERED here directly,
handle PRAGMA_OMP_TASKLOOP, call push_omp_privatization_clauses
and pop_omp_privatization_clauses around parsing calls.
(cp_parser_cilk_for): Adjust finish_omp_clauses caller.
* pt.c (apply_late_template_attributes): Adjust tsubst_omp_clauses
and finish_omp_clauses callers.
(tsubst_omp_clause_decl): Return NULL if decl is NULL.
For TREE_LIST, copy over OMP_CLAUSE_DEPEND_SINK_NEGATIVE bit.
Use tsubst_expr instead of tsubst_copy, undo convert_from_reference
effects.
(tsubst_omp_clauses): Add ALLOW_FIELDS argument. Handle new
OpenMP 4.5 clauses. Use tsubst_omp_clause_decl for more clauses.
If ALLOW_FIELDS, handle non-static data members in the clauses.
Clear OMP_CLAUSE_LINEAR_STEP if it has been cleared before.
(omp_parallel_combined_clauses): New variable.
(tsubst_omp_for_iterator): Add ORIG_DECLV argument, recur on
OMP_FOR_ORIG_DECLS, handle non-static data member iterators.
Improve handling of clauses on combined constructs.
(tsubst_expr): Call push_omp_privatization_clauses and
pop_omp_privatization_clauses around instantiation of certain
OpenMP constructs, improve handling of clauses on combined
constructs, handle OMP_TASKLOOP, adjust tsubst_omp_for_iterator,
tsubst_omp_clauses and finish_omp_for callers, handle clauses on
critical and ordered, handle OMP_TARGET_{ENTER,EXIT}_DATA.
(instantiate_decl): Call save_omp_privatization_clauses and
restore_omp_privatization_clauses around instantiation.
(dependent_omp_for_p): Fix up comment typo. Handle SCOPE_REF.
* semantics.c (omp_private_member_map, omp_private_member_vec,
omp_private_member_ignore_next): New variables.
(finish_non_static_data_member): Return dummy decl for privatized
non-static data members.
(omp_clause_decl_field, omp_clause_printable_decl,
omp_note_field_privatization, omp_privatize_field): New functions.
(handle_omp_array_sections_1): Fix comment typo.
Add IS_OMP argument, handle structure element bases, diagnose
bitfields, pass IS_OMP recursively, diagnose known zero length
array sections in depend clauses, handle array sections in reduction
clause, diagnose negative length even for pointers.
(handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
types, pass IS_OMP down to handle_omp_array_sections_1, handle
array sections in reduction clause, set
OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
(finish_omp_reduction_clause): Handle array sections and arrays.
Use omp_clause_printable_decl.
(finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink):
New functions.
(finish_omp_clauses): Add ALLOW_FIELDS and DECLARE_SIMD arguments.
Handle new OpenMP 4.5 clauses and new restrictions for the old
ones, handle non-static data members, reject this keyword when not
allowed.
(push_omp_privatization_clauses, pop_omp_privatization_clauses,
save_omp_privatization_clauses, restore_omp_privatization_clauses):
New functions.
(handle_omp_for_class_iterator): Handle OMP_TASKLOOP class iterators.
Add collapse and ordered arguments. Fix handling of lastprivate
iterators in doacross loops.
(finish_omp_for): Add ORIG_DECLV argument, handle doacross loops,
adjust c_finish_omp_for, handle_omp_for_class_iterator and
finish_omp_clauses callers. Fill in OMP_CLAUSE_LINEAR_STEP on simd
loops with non-static data member iterators.
gcc/fortran/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Ilya Verbin <ilya.verbin@intel.com>
* f95-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
DEF_FUNCTION_TYPE_11, DEF_FUNCTION_TYPE_VAR_1): Define.
* trans-openmp.c (gfc_trans_omp_clauses): Set
OMP_CLAUSE_IF_MODIFIER to ERROR_MARK, OMP_CLAUSE_ORDERED_EXPR
to NULL.
(gfc_trans_omp_critical): Adjust for addition of clauses.
(gfc_trans_omp_ordered): Likewise.
* types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New.
(BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove.
gcc/lto/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
* lto-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
DEF_FUNCTION_TYPE_11): Define.
gcc/jit/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
* jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
DEF_FUNCTION_TYPE_11): Define.
* jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
DEF_FUNCTION_TYPE_11): Define.
gcc/ada/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/utils.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
DEF_FUNCTION_TYPE_11): Define.
gcc/testsuite/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
* c-c++-common/gomp/cancel-1.c (f2): Add map clause to target data.
* c-c++-common/gomp/clauses-1.c: New test.
* c-c++-common/gomp/clauses-2.c: New test.
* c-c++-common/gomp/clauses-3.c: New test.
* c-c++-common/gomp/clauses-4.c: New test.
* c-c++-common/gomp/declare-target-1.c: New test.
* c-c++-common/gomp/declare-target-2.c: New test.
* c-c++-common/gomp/depend-3.c: New test.
* c-c++-common/gomp/depend-4.c: New test.
* c-c++-common/gomp/doacross-1.c: New test.
* c-c++-common/gomp/if-1.c: New test.
* c-c++-common/gomp/if-2.c: New test.
* c-c++-common/gomp/linear-1.c: New test.
* c-c++-common/gomp/map-2.c: New test.
* c-c++-common/gomp/map-3.c: New test.
* c-c++-common/gomp/nesting-1.c (f_omp_parallel,
f_omp_target_data): Add map clause to target data.
* c-c++-common/gomp/nesting-warn-1.c (f_omp_target): Likewise.
* c-c++-common/gomp/ordered-1.c: New test.
* c-c++-common/gomp/ordered-2.c: New test.
* c-c++-common/gomp/ordered-3.c: New test.
* c-c++-common/gomp/pr61486-1.c (foo): Remove linear clause
on non-iterator.
* c-c++-common/gomp/pr61486-2.c (test, test2): Remove ordered
clause and ordered construct where no longer allowed.
* c-c++-common/gomp/priority-1.c: New test.
* c-c++-common/gomp/reduction-1.c: New test.
* c-c++-common/gomp/schedule-simd-1.c: New test.
* c-c++-common/gomp/sink-1.c: New test.
* c-c++-common/gomp/sink-2.c: New test.
* c-c++-common/gomp/sink-3.c: New test.
* c-c++-common/gomp/sink-4.c: New test.
* c-c++-common/gomp/udr-1.c: New test.
* c-c++-common/taskloop-1.c: New test.
* c-c++-common/cpp/openmp-define-3.c: Adjust for the new
value of _OPENMP macro.
* c-c++-common/cilk-plus/PS/body.c (foo): Adjust expected diagnostics.
* c-c++-common/goacc-gomp/nesting-fail-1.c (f_acc_parallel,
f_acc_kernels, f_acc_data, f_acc_loop): Add map clause to target data.
* gcc.dg/gomp/clause-1.c:
* gcc.dg/gomp/reduction-1.c: New test.
* gcc.dg/gomp/sink-fold-1.c: New test.
* gcc.dg/gomp/sink-fold-2.c: New test.
* gcc.dg/gomp/sink-fold-3.c: New test.
* gcc.dg/vect/vect-simd-clone-15.c: New test.
* g++.dg/gomp/clause-1.C (T::test): Remove dg-error on privatization
of non-static data members.
* g++.dg/gomp/clause-3.C (foo): Remove one dg-error directive.
Add some linear clause tests.
* g++.dg/gomp/declare-simd-3.C: New test.
* g++.dg/gomp/linear-1.C: New test.
* g++.dg/gomp/member-1.C: New test.
* g++.dg/gomp/member-2.C: New test.
* g++.dg/gomp/pr66571-2.C: New test.
* g++.dg/gomp/pr67504.C (foo): Add test for ordered clause with
dependent argument.
* g++.dg/gomp/pr67522.C (foo): Add test for invalid array section
in reduction clause.
* g++.dg/gomp/reference-1.C: New test.
* g++.dg/gomp/sink-1.C: New test.
* g++.dg/gomp/sink-2.C: New test.
* g++.dg/gomp/sink-3.C: New test.
* g++.dg/gomp/task-1.C: Remove both dg-error directives.
* g++.dg/gomp/this-1.C: New test.
* g++.dg/gomp/this-2.C: New test.
* g++.dg/vect/simd-clone-2.cc: New test.
* g++.dg/vect/simd-clone-2.h: New test.
* g++.dg/vect/simd-clone-3.cc: New test.
* g++.dg/vect/simd-clone-4.cc: New test.
* g++.dg/vect/simd-clone-4.h: New test.
* g++.dg/vect/simd-clone-5.cc: New test.
include/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Ilya Verbin <ilya.verbin@intel.com>
* gomp-constants.h (GOMP_MAP_FLAG_ALWAYS): Define.
(enum gomp_map_kind): Add GOMP_MAP_FIRSTPRIVATE,
GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_USE_DEVICE_PTR,
GOMP_MAP_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_ALWAYS_TO,
GOMP_MAP_ALWAYS_FROM, GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT,
GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_DELETE,
GOMP_MAP_RELEASE, GOMP_MAP_FIRSTPRIVATE_POINTER.
(GOMP_MAP_ALWAYS_TO_P, GOMP_MAP_ALWAYS_FROM_P): Define.
(GOMP_TASK_FLAG_UNTIED, GOMP_TASK_FLAG_FINAL, GOMP_TASK_FLAG_MERGEABLE,
GOMP_TASK_FLAG_DEPEND, GOMP_TASK_FLAG_PRIORITY, GOMP_TASK_FLAG_UP,
GOMP_TASK_FLAG_GRAINSIZE, GOMP_TASK_FLAG_IF, GOMP_TASK_FLAG_NOGROUP,
GOMP_TARGET_FLAG_NOWAIT, GOMP_TARGET_FLAG_EXIT_DATA,
GOMP_TARGET_FLAG_UPDATE): Define.
libgomp/
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
Ilya Verbin <ilya.verbin@intel.com>
* config/linux/affinity.c (omp_get_place_num_procs,
omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions.
* config/linux/doacross.h: New file.
* config/posix/affinity.c (omp_get_place_num_procs,
omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions.
* config/posix/doacross.h: New file.
* env.c: Include gomp-constants.h.
(struct gomp_task_icv): Rename run_sched_modifier to
run_sched_chunk_size.
(gomp_max_task_priority_var): New variable.
(parse_schedule): Rename run_sched_modifier to run_sched_chunk_size.
(handle_omp_display_env): Change _OPENMP value from 201307 to
201511. Print OMP_MAX_TASK_PRIORITY.
(initialize_env): Parse OMP_MAX_TASK_PRIORITY.
(omp_set_schedule, omp_get_schedule): Rename modifier argument to
chunk_size and run_sched_modifier to run_sched_chunk_size.
(omp_get_max_task_priority, omp_get_initial_device,
omp_get_num_places, omp_get_place_num, omp_get_partition_num_places,
omp_get_partition_place_nums): New functions.
* fortran.c (omp_set_schedule_, omp_set_schedule_8_,
omp_get_schedule_, omp_get_schedule_8_): Rename modifier argument
to chunk_size.
(omp_get_num_places_, omp_get_place_num_procs_,
omp_get_place_num_procs_8_, omp_get_place_proc_ids_,
omp_get_place_proc_ids_8_, omp_get_place_num_,
omp_get_partition_num_places_, omp_get_partition_place_nums_,
omp_get_partition_place_nums_8_, omp_get_initial_device_,
omp_get_max_task_priority_): New functions.
* libgomp_g.h (GOMP_loop_doacross_static_start,
GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start,
GOMP_loop_doacross_runtime_start, GOMP_loop_ull_doacross_static_start,
GOMP_loop_ull_doacross_dynamic_start,
GOMP_loop_ull_doacross_guided_start,
GOMP_loop_ull_doacross_runtime_start, GOMP_doacross_post,
GOMP_doacross_wait, GOMP_doacross_ull_post, GOMP_doacross_wait,
GOMP_taskloop, GOMP_taskloop_ull, GOMP_target_41,
GOMP_target_data_41, GOMP_target_update_41,
GOMP_target_enter_exit_data): New prototypes.
(GOMP_task): Add prototype argument.
* libgomp.h (_LIBGOMP_CHECKING_): Define to 0 if not yet defined.
(struct gomp_doacross_work_share): New type.
(struct gomp_work_share): Add doacross field.
(struct gomp_task_icv): Rename run_sched_modifier to
run_sched_chunk_size.
(enum gomp_task_kind): Rename GOMP_TASK_IFFALSE to
GOMP_TASK_UNDEFERRED. Add comments.
(struct gomp_task_depend_entry): Add comments.
(struct gomp_task): Likewise.
(struct gomp_taskgroup): Likewise.
(struct gomp_target_task): New type.
(struct gomp_team): Add comment.
(gomp_get_place_proc_ids_8, gomp_doacross_init,
gomp_doacross_ull_init, gomp_task_maybe_wait_for_dependencies,
gomp_create_target_task, gomp_target_task_fn): New prototypes.
(struct target_var_desc): New type.
(struct target_mem_desc): Adjust comment. Use struct
target_var_desc instead of splay_tree_key for list.
(REFCOUNT_INFINITY): Define.
(struct splay_tree_key_s): Remove copy_from field.
(struct gomp_device_descr): Add dev2dev_func field.
(enum gomp_map_vars_kind): New enum.
(gomp_map_vars): Add one argument.
* libgomp.map (OMP_4.5): Export omp_get_max_task_priority,
omp_get_max_task_priority_, omp_get_num_places, omp_get_num_places_,
omp_get_place_num_procs, omp_get_place_num_procs_,
omp_get_place_num_procs_8_, omp_get_place_proc_ids,
omp_get_place_proc_ids_, omp_get_place_proc_ids_8_, omp_get_place_num,
omp_get_place_num_, omp_get_partition_num_places,
omp_get_partition_num_places_, omp_get_partition_place_nums,
omp_get_partition_place_nums_, omp_get_partition_place_nums_8_,
omp_get_initial_device, omp_get_initial_device_, omp_target_alloc,
omp_target_free, omp_target_is_present, omp_target_memcpy,
omp_target_memcpy_rect, omp_target_associate_ptr and
omp_target_disassociate_ptr.
(GOMP_4.0.2): Renamed to ...
(GOMP_4.5): ... this. Export GOMP_target_41, GOMP_target_data_41,
GOMP_target_update_41, GOMP_target_enter_exit_data, GOMP_taskloop,
GOMP_taskloop_ull, GOMP_loop_doacross_dynamic_start,
GOMP_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start,
GOMP_loop_doacross_static_start, GOMP_doacross_post,
GOMP_doacross_wait, GOMP_loop_ull_doacross_dynamic_start,
GOMP_loop_ull_doacross_guided_start,
GOMP_loop_ull_doacross_runtime_start,
GOMP_loop_ull_doacross_static_start, GOMP_doacross_ull_post and
GOMP_doacross_ull_wait.
* libgomp.texi: Document omp_get_max_task_priority.
Rename modifier argument to chunk_size for omp_set_schedule and
omp_get_schedule. Document OMP_MAX_TASK_PRIORITY env var.
* loop.c (GOMP_loop_runtime_start): Adjust for run_sched_modifier
to run_sched_chunk_size renaming.
(GOMP_loop_ordered_runtime_start): Likewise.
(gomp_loop_doacross_static_start, gomp_loop_doacross_dynamic_start,
gomp_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start,
GOMP_parallel_loop_runtime_start): New functions.
(GOMP_parallel_loop_runtime): Adjust for run_sched_modifier
to run_sched_chunk_size renaming.
(GOMP_loop_doacross_static_start, GOMP_loop_doacross_dynamic_start,
GOMP_loop_doacross_guided_start): New functions or aliases.
* loop_ull.c (GOMP_loop_ull_runtime_start): Adjust for
run_sched_modifier to run_sched_chunk_size renaming.
(GOMP_loop_ull_ordered_runtime_start): Likewise.
(gomp_loop_ull_doacross_static_start,
gomp_loop_ull_doacross_dynamic_start,
gomp_loop_ull_doacross_guided_start,
GOMP_loop_ull_doacross_runtime_start): New functions.
(GOMP_loop_ull_doacross_static_start,
GOMP_loop_ull_doacross_dynamic_start,
GOMP_loop_ull_doacross_guided_start): New functions or aliases.
* oacc-mem.c (acc_map_data, present_create_copy,
gomp_acc_insert_pointer): Pass GOMP_MAP_VARS_OPENACC instead of false
to gomp_map_vars.
(gomp_acc_remove_pointer): Use copy_from from target_var_desc.
* oacc-parallel.c (GOACC_data_start): Pass GOMP_MAP_VARS_OPENACC
instead of false to gomp_map_vars.
(GOACC_parallel_keyed): Likewise. Use copy_from from target_var_desc.
* omp.h.in (omp_lock_hint_t): New type.
(omp_init_lock_with_hint, omp_init_nest_lock_with_hint,
omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids,
omp_get_place_num, omp_get_partition_num_places,
omp_get_partition_place_nums, omp_get_initial_device,
omp_get_max_task_priority, omp_target_alloc, omp_target_free,
omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect,
omp_target_associate_ptr, omp_target_disassociate_ptr): New
prototypes.
* omp_lib.f90.in (omp_lock_hint_kind): New parameter.
(omp_lock_hint_none, omp_lock_hint_uncontended,
omp_lock_hint_contended, omp_lock_hint_nonspeculative,
omp_lock_hint_speculative): New parameters.
(omp_init_lock_with_hint, omp_init_nest_lock_with_hint,
omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids,
omp_get_place_num, omp_get_partition_num_places,
omp_get_partition_place_nums, omp_get_initial_device,
omp_get_max_task_priority): New interfaces.
(omp_set_schedule, omp_get_schedule): Rename modifier argument
to chunk_size.
* omp_lib.h.in (omp_lock_hint_kind): New parameter.
(omp_lock_hint_none, omp_lock_hint_uncontended,
omp_lock_hint_contended, omp_lock_hint_nonspeculative,
omp_lock_hint_speculative): New parameters.
(omp_init_lock_with_hint, omp_init_nest_lock_with_hint,
omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids,
omp_get_place_num, omp_get_partition_num_places,
omp_get_partition_place_nums, omp_get_initial_device,
omp_get_max_task_priority): New functions and subroutines.
* ordered.c: Include stdarg.h and string.h.
(MAX_COLLAPSED_BITS): Define.
(gomp_doacross_init, GOMP_doacross_post, GOMP_doacross_wait,
gomp_doacross_ull_init, GOMP_doacross_ull_post,
GOMP_doacross_ull_wait): New functions.
* target.c: Include errno.h.
(resolve_device): If device is not initialized, call
gomp_init_device on it.
(gomp_map_lookup): New function.
(gomp_map_vars_existing): Add tgt_var argument, fill it in.
Don't bump refcount if REFCOUNT_INFINITY. Handle
GOMP_MAP_ALWAYS_TO_P.
(get_kind): Rename is_openacc argument to short_mapkind.
(gomp_map_pointer): Use gomp_map_lookup.
(gomp_map_fields_existing): New function.
(gomp_map_vars): Rename is_openacc argument to short_mapkind
and is_target to pragma_kind. Handle GOMP_MAP_VARS_ENTER_DATA,
handle GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_STRUCT,
GOMP_MAP_USE_DEVICE_PTR, GOMP_MAP_ZERO_LEN_ARRAY_SECTION.
Adjust for tgt->list changed type and copy_from living in there.
(gomp_copy_from_async): Adjust for tgt->list changed type and
copy_from living in there.
(gomp_unmap_vars): Likewise.
(gomp_update): Likewise. Rename is_openacc argument to
short_mapkind. Don't fail if object is not mapped.
(gomp_load_image_to_device): Initialize refcount to
REFCOUNT_INFINITY.
(gomp_target_fallback): New function.
(gomp_get_target_fn_addr): Likewise.
(GOMP_target): Adjust gomp_map_vars caller, use
gomp_get_target_fn_addr and gomp_target_fallback.
(GOMP_target_41): New function.
(gomp_target_data_fallback): New function.
(GOMP_target_data): Use it, adjust gomp_map_vars caller.
(GOMP_target_data_41): New function.
(GOMP_target_update): Adjust gomp_update caller.
(GOMP_target_update_41): New function.
(gomp_exit_data, GOMP_target_enter_exit_data,
gomp_target_task_fn, omp_target_alloc, omp_target_free,
omp_target_is_present, omp_target_memcpy,
omp_target_memcpy_rect_worker, omp_target_memcpy_rect,
omp_target_associate_ptr, omp_target_disassociate_ptr,
gomp_load_plugin_for_device): New functions.
* task.c: Include gomp-constants.h. Include taskloop.c
twice to get GOMP_taskloop and GOMP_taskloop_ull definitions.
(gomp_task_handle_depend): New function.
(GOMP_task): Use it. Add priority argument. Use
gomp-constant.h constants instead of hardcoded numbers.
Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED.
(gomp_create_target_task): New function.
(verify_children_queue, verify_taskgroup_queue,
verify_task_queue): New functions.
(gomp_task_run_pre): Call verify_*_queue functions.
If an upcoming tied task is about to leave the sibling or
taskgroup queues in an invalid state, adjust appropriately.
Remove taskgroup argument. Add comments.
(gomp_task_run_post_handle_dependers): Add comments.
(gomp_task_run_post_remove_parent): Likewise.
(gomp_barrier_handle_tasks): Adjust gomp_task_run_pre caller.
(GOMP_taskwait): Likewise. Add comments.
(gomp_task_maybe_wait_for_dependencies): Fix scheduling
problem such that the first non parent_depends_on task does not
end up at the end of the children queue.
(GOMP_taskgroup_start): Rename GOMP_TASK_IFFALSE to
GOMP_TASK_UNDEFERRED.
(GOMP_taskgroup_end): Adjust gomp_task_run_pre caller.
* taskloop.c: New file.
* testsuite/lib/libgomp.exp
(check_effective_target_offload_device_nonshared_as): New proc.
* testsuite/libgomp.c/affinity-2.c: New test.
* testsuite/libgomp.c/doacross-1.c: New test.
* testsuite/libgomp.c/doacross-2.c: New test.
* testsuite/libgomp.c/examples-4/declare_target-1.c (fib_wrapper):
Add map clause to target.
* testsuite/libgomp.c/examples-4/declare_target-4.c (accum): Likewise.
* testsuite/libgomp.c/examples-4/declare_target-5.c (accum): Likewise.
* testsuite/libgomp.c/examples-4/device-1.c (main): Likewise.
* testsuite/libgomp.c/examples-4/device-3.c (main): Likewise.
* testsuite/libgomp.c/examples-4/target_data-3.c (gramSchmidt):
Likewise.
* testsuite/libgomp.c/examples-4/teams-2.c (dotprod): Likewise.
* testsuite/libgomp.c/examples-4/teams-3.c (dotprod): Likewise.
* testsuite/libgomp.c/examples-4/teams-4.c (dotprod): Likewise.
* testsuite/libgomp.c/for-2.h (OMPTGT, OMPTO, OMPFROM): Define if
not defined. Use those where needed.
* testsuite/libgomp.c/for-4.c: New test.
* testsuite/libgomp.c/for-5.c: New test.
* testsuite/libgomp.c/for-6.c: New test.
* testsuite/libgomp.c/linear-1.c: New test.
* testsuite/libgomp.c/ordered-4.c: New test.
* testsuite/libgomp.c/pr66199-2.c (f2): Adjust for linear clause
only allowed on the loop iterator.
* testsuite/libgomp.c/pr66199-3.c: New test.
* testsuite/libgomp.c/pr66199-4.c: New test.
* testsuite/libgomp.c/reduction-7.c: New test.
* testsuite/libgomp.c/reduction-8.c: New test.
* testsuite/libgomp.c/reduction-9.c: New test.
* testsuite/libgomp.c/reduction-10.c: New test.
* testsuite/libgomp.c/target-1.c (fn2, fn3, fn4): Add
map(tofrom:s).
* testsuite/libgomp.c/target-2.c (fn2, fn3, fn4): Likewise.
* testsuite/libgomp.c/target-7.c (foo): Add map(h) where needed.
* testsuite/libgomp.c/target-11.c: New test.
* testsuite/libgomp.c/target-12.c: New test.
* testsuite/libgomp.c/target-13.c: New test.
* testsuite/libgomp.c/target-14.c: New test.
* testsuite/libgomp.c/target-15.c: New test.
* testsuite/libgomp.c/target-16.c: New test.
* testsuite/libgomp.c/target-17.c: New test.
* testsuite/libgomp.c/target-18.c: New test.
* testsuite/libgomp.c/target-19.c: New test.
* testsuite/libgomp.c/target-20.c: New test.
* testsuite/libgomp.c/target-21.c: New test.
* testsuite/libgomp.c/target-22.c: New test.
* testsuite/libgomp.c/target-23.c: New test.
* testsuite/libgomp.c/target-24.c: New test.
* testsuite/libgomp.c/target-25.c: New test.
* testsuite/libgomp.c/target-26.c: New test.
* testsuite/libgomp.c/target-27.c: New test.
* testsuite/libgomp.c/taskloop-1.c: New test.
* testsuite/libgomp.c/taskloop-2.c: New test.
* testsuite/libgomp.c/taskloop-3.c: New test.
* testsuite/libgomp.c/taskloop-4.c: New test.
* testsuite/libgomp.c++/ctor-13.C: New test.
* testsuite/libgomp.c++/doacross-1.C: New test.
* testsuite/libgomp.c++/examples-4/declare_target-2.C:
Replace offload_device with offload_device_nonshared_as.
* testsuite/libgomp.c++/for-12.C: New test.
* testsuite/libgomp.c++/for-13.C: New test.
* testsuite/libgomp.c++/for-14.C: New test.
* testsuite/libgomp.c++/linear-1.C: New test.
* testsuite/libgomp.c++/member-1.C: New test.
* testsuite/libgomp.c++/member-2.C: New test.
* testsuite/libgomp.c++/member-3.C: New test.
* testsuite/libgomp.c++/member-4.C: New test.
* testsuite/libgomp.c++/member-5.C: New test.
* testsuite/libgomp.c++/ordered-1.C: New test.
* testsuite/libgomp.c++/reduction-5.C: New test.
* testsuite/libgomp.c++/reduction-6.C: New test.
* testsuite/libgomp.c++/reduction-7.C: New test.
* testsuite/libgomp.c++/reduction-8.C: New test.
* testsuite/libgomp.c++/reduction-9.C: New test.
* testsuite/libgomp.c++/reduction-10.C: New test.
* testsuite/libgomp.c++/reference-1.C: New test.
* testsuite/libgomp.c++/simd14.C: New test.
* testsuite/libgomp.c++/target-2.C (fn2): Add map(tofrom: s) clause.
* testsuite/libgomp.c++/target-5.C: New test.
* testsuite/libgomp.c++/target-6.C: New test.
* testsuite/libgomp.c++/target-7.C: New test.
* testsuite/libgomp.c++/target-8.C: New test.
* testsuite/libgomp.c++/target-9.C: New test.
* testsuite/libgomp.c++/target-10.C: New test.
* testsuite/libgomp.c++/target-11.C: New test.
* testsuite/libgomp.c++/target-12.C: New test.
* testsuite/libgomp.c++/taskloop-1.C: New test.
* testsuite/libgomp.c++/taskloop-2.C: New test.
* testsuite/libgomp.c++/taskloop-3.C: New test.
* testsuite/libgomp.c++/taskloop-4.C: New test.
* testsuite/libgomp.c++/taskloop-5.C: New test.
* testsuite/libgomp.c++/taskloop-6.C: New test.
* testsuite/libgomp.c++/taskloop-7.C: New test.
* testsuite/libgomp.c++/taskloop-8.C: New test.
* testsuite/libgomp.c++/taskloop-9.C: New test.
* testsuite/libgomp.fortran/affinity1.f90: New test.
* testsuite/libgomp.fortran/affinity2.f90: New test.
liboffloadmic/
2015-10-13 Ilya Verbin <ilya.verbin@intel.com>
* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_dev2dev): New
function.
* plugin/offload_target_main.cpp (__offload_target_tgt2tgt): New
static function, register it in liboffloadmic.
From-SVN: r228777
Uros Bizjak [Tue, 13 Oct 2015 18:56:48 +0000 (20:56 +0200)]
i386.c (classify_argument): Use CEIL where applicable.
* config/i386/i386.c (classify_argument): Use CEIL where applicable.
(ix86_function_arg_advance): Ditto.
(ix86_function_arg): Ditto.
(ix86_gimplify_va_arg): Ditto.
(ix86_class_max_nregs): Ditto.
(inline_memory_move_cost): Ditto.
(ix86_set_reg_reg_cost): Ditto.
* config/i386/i386.h (HARD_REGNO_NREGS): Ditto.
From-SVN: r228776
Alexandre Oliva [Tue, 13 Oct 2015 16:34:29 +0000 (16:34 +0000)]
support BLKmode inputs for store_bit_field
Revision 228586 changed useless_type_conversion_p and added mode
changes for MEM:BLKmode inputs in store_expr_with_bounds, but it
missed store_bit_field. This caused ada/rts/s-regpat.ads to fail
compilation on x86_64-linux-gnu.
for gcc/ChangeLog
PR middle-end/67912
* expmed.c (store_bit_field_1): Adjust mode of BLKmode inputs.
From-SVN: r228774
Nikolai Bozhenov [Tue, 13 Oct 2015 15:32:32 +0000 (15:32 +0000)]
Fix prototype for print_insn in rtl.h
* gcc/rtl.h (print_insn): Fix prototype.
From-SVN: r228770
Uros Bizjak [Tue, 13 Oct 2015 15:31:29 +0000 (17:31 +0200)]
sparc.h (SPARC_STACK_ALIGN): Implement using ROUND_UP macro and UNITS_PER_WORD * 2.
* config/sparc/sparc.h (SPARC_STACK_ALIGN): Implement using
ROUND_UP macro and UNITS_PER_WORD * 2.
* config/sparc/sparc.c (sparc_compute_frame_size):
Use ROUND_UP and ROUND_DOWN macros where applicable.
(function_arg_record_value, function_arg_record_value_1)
(function_arg_record_value_1): Ditto.
(emit_save_or_restore_regs): Use ROUND_DOWN to preserve offset
alignment to double-word.
(sparc_gimplify_va_arg): Use ROUND_UP to calculate rsize.
(sparc_emit_probe_stack_range): Use ROUND_DOWN to calculate
rounded_size.
From-SVN: r228769
Uros Bizjak [Tue, 13 Oct 2015 15:31:06 +0000 (17:31 +0200)]
sparc.h (SPARC_STACK_ALIGN): Implement using ROUND_UP macro and UNITS_PER_WORD * 2.
* config/sparc/sparc.h (SPARC_STACK_ALIGN): Implement using
ROUND_UP macro and UNITS_PER_WORD * 2.
* config/sparc/sparc.c (sparc_compute_frame_size):
Use ROUND_UP and ROUND_DOWN macros where applicable.
(function_arg_record_value, function_arg_record_value_1)
(function_arg_record_value_1): Ditto.
(emit_save_or_restore_regs): Use ROUND_DOWN to preserve offset
alignment to double-word.
(sparc_gimplify_va_arg): Use ROUND_UP to calculate rsize.
(sparc_emit_probe_stack_range): Use ROUND_DOWN to calculate
rounded_size.
From-SVN: r228768
Tom de Vries [Tue, 13 Oct 2015 14:54:01 +0000 (14:54 +0000)]
Fix parloops gimple_uid usage
2015-10-13 Tom de Vries <tom@codesourcery.com>
* tree-parloops.c (reduction_phi): Handle cases that gimple_uid is 0 or
-1. Add assert that returned entry matches phi argument.
(parallelize_loops): Move calls to init_stmt_vec_info_vec and
free_stmt_vec_info_vec ...
(gather_scalar_reductions): ... here. Initialize gimple_uids of phis
with -1.
From-SVN: r228767
Christophe Lyon [Tue, 13 Oct 2015 13:15:12 +0000 (15:15 +0200)]
Followup to [AArch64_be] Fix vtbl[34] and vtbx4
2015-10-13 Christophe Lyon <christophe.lyon@linaro.org>
* gcc/testsuite/gcc.target/aarch64/table-intrinsics.c: Fix regexp
after r228716 (Fix vtbl[34] and vtbx4).
From-SVN: r228762
Yuri Rumyantsev [Tue, 13 Oct 2015 13:08:31 +0000 (13:08 +0000)]
PR tree-optimization/67909, 67947
gcc/
2014-10-13 Yuri Rumyantsev <ysrumyan@gmail.com>
PR tree-optimization/67909, 67947
* tree-ssa-loop-unswitch.c (find_loop_guard): Add check that GUARD_EDGE
really skip the inner loop.
gcc/testsuite/
2014-10-13 Yuri Rumyantsev <ysrumyan@gmail.com>
PR tree-optimization/67909, 67947
* gcc.dg/torture/pr67947.c: New test.
From-SVN: r228760
Jeff Law [Tue, 13 Oct 2015 12:20:06 +0000 (06:20 -0600)]
[PATCH] Allow FSM to thread single block cases too
* tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths):
Allow single block jump threading paths.
* gcc.dg/tree-ssa/ssa-thread-13.c: New test.
From-SVN: r228757
Tom de Vries [Tue, 13 Oct 2015 10:08:59 +0000 (10:08 +0000)]
Add param parloops-schedule
2015-10-13 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/67476
* doc/invoke.texi (@item parloops-schedule): New item.
* params.def (PARAM_PARLOOPS_SCHEDULE): New DEFPARAMENUM5.
* tree-parloops.c: Include params-enum.h.
(create_parallel_loop): Handle PARAM_PARLOOPS_SCHEDULE.
* testsuite/libgomp.c/autopar-3.c: New test.
* testsuite/libgomp.c/autopar-4.c: New test.
* testsuite/libgomp.c/autopar-5.c: New test.
* testsuite/libgomp.c/autopar-6.c: New test.
* testsuite/libgomp.c/autopar-7.c: New test.
* testsuite/libgomp.c/autopar-8.c: New test.
From-SVN: r228756
Tom de Vries [Tue, 13 Oct 2015 10:08:50 +0000 (10:08 +0000)]
Support DEFPARAMENUM in params.def
2015-10-13 Tom de Vries <tom@codesourcery.com>
* Makefile.in (PARAMS_H, PLUGIN_HEADERS): Add params-enum.h.
* params-enum.h: New file.
* opts.c (handle_param): Handle case that param arg is a string.
* params-list.h: Handle DEFPARAMENUM5 in params.def.
* params.c (find_param): New function, factored out of ...
(set_param_value): ... here.
(param_string_value_p): New function.
* params.h (struct param_info): Add value_names field.
(find_param, param_string_value_p): Declare.
From-SVN: r228755
Tom de Vries [Tue, 13 Oct 2015 10:08:40 +0000 (10:08 +0000)]
Handle original loop tree in expand_omp_for_generic
2015-10-13 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/67476
* omp-low.c (expand_omp_for_generic): Handle original loop tree.
From-SVN: r228754
Richard Biener [Tue, 13 Oct 2015 08:39:41 +0000 (08:39 +0000)]
tree-vect-data-refs.c (vect_analyze_data_ref_dependences): Allocate the data dependence vector.
2015-10-13 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_analyze_data_ref_dependences): Allocate
the data dependence vector.
(vect_peeling_hash_insert): Get the peeling hash table as argument.
(vect_peeling_hash_get_lowest_cost): Likewise.
(vect_enhance_data_refs_alignment): Adjust.
(struct _vect_peel_info, struct _vect_peel_extended_info,
struct peel_info_hasher): Move from ...
* tree-vectorizer.h: ... here.
(LOOP_VINFO_COST_MODEL_MIN_ITERS): Remove.
(LOOP_VINFO_PEELING_HTAB): Likewise.
(struct _loop_vec_info): Remove min_profitable_iters and
peeling_htab members.
* tree-vect-loop.c (new_loop_vec_info): Do not allocate vectors
here.
(destroy_loop_vec_info): Adjust.
(vect_analyze_loop_2): Do not set LOOP_VINFO_COST_MODEL_MIN_ITERS.
(vect_estimate_min_profitable_iters): Use LOOP_VINFO_COMP_ALIAS_DDRS
to estimate alias versioning cost.
* tree-vect-slp.c (vect_analyze_slp_cost): Dump header.
From-SVN: r228751
Richard Sandiford [Tue, 13 Oct 2015 07:34:41 +0000 (07:34 +0000)]
To...
To: gcc-patches@gcc.gnu.org
Subject: Add an extra pow rule to match.pd
From: Richard Sandiford <richard.sandiford@arm.com>
Gcc: private.sent
--text follows this line--
Simplify pow(|x|,y) and pow(-x,y) to pow(x,y) if y is an even integer.
At the moment this duplicates a case in fold_builtin_pow, but an
upcoming patch will move all the fold_builtin_pow rules to match.pd.
I'm doing this one early to fix a regression in builtin-10.c for
soft-float ARM.
gcc/
* real.h (real_isinteger): Declare.
* real.c (real_isinteger): New function.
* match.pd: Simplify pow(|x|,y) and pow(-x,y) to pow(x,y)
if y is an even integer.
From-SVN: r228750
GCC Administrator [Tue, 13 Oct 2015 00:16:15 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r228743
Jeff Law [Mon, 12 Oct 2015 21:39:35 +0000 (15:39 -0600)]
[PATCH] Allow FSM threader to thread more complex conditions
* tree-ssa-threadbackward.c (get_gimple_control_stmt): New function.
(fsm_find_control_stmt_paths): Change name of first argument to
more accurately relfect what it really is. Handle simplification
of GIMPLE_COND after finding a thread path for NAME.
* tree-ssa-threadedge.c (simplify_control_stmt_condition): Allow
nontrivial conditions to be handled by FSM threader.
(thread_through_normal_block): Extract the name to looup via
FSM threader from COND_EXPR.
* gcc.dg/tree-ssa/ssa-thread-12.c: New test.
* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Update expected output.
* gcc.dg/tree-ssa/ssa-thread-11.c: Renamed from
ssa-dom-thread-11.c.
From-SVN: r228739
James Norris [Mon, 12 Oct 2015 20:22:30 +0000 (20:22 +0000)]
vector-loop.c: Fix loop initializer.
* testsuite/libgomp.oacc-c-c++-common/vector-loop.c: Fix loop
initializer.
From-SVN: r228737
Jan Hubicka [Mon, 12 Oct 2015 18:54:01 +0000 (20:54 +0200)]
revert: cgraphbuild.c (compute_call_stmt_bb_frequency): Use counts when these are more informative.
revert:
2015-10-11 Jan Hubicka <hubicka@ucw.cz>
* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
counts when these are more informative.
From-SVN: r228736
Jeff Law [Mon, 12 Oct 2015 16:26:09 +0000 (10:26 -0600)]
[PATCH] Improve FSM threader to handle compiler temporaries too
* tree-ssa-threadbackward.c (fsm_find_thread_path): Remove
restriction that traced SSA_NAME is a user variable.
* gcc.dg/tree-ssa/ssa-dom-thread-11.c: New test.
From-SVN: r228727
Tom de Vries [Mon, 12 Oct 2015 14:14:22 +0000 (14:14 +0000)]
Add missing phis in expand_omp_for_generic
2015-10-12 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/67476
* omp-low.c (expand_omp_for_generic): Add missing phis.
From-SVN: r228718
Tom de Vries [Mon, 12 Oct 2015 14:14:11 +0000 (14:14 +0000)]
Handle simple latch in expand_omp_for_generic
2015-10-12 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/67476
* omp-low.c (expand_omp_for_generic): Handle simple latch.
From-SVN: r228717
Christophe Lyon [Mon, 12 Oct 2015 14:06:54 +0000 (14:06 +0000)]
[AArch64_be] Fix vtbl[34] and vtbx4
2015-10-12 Christophe Lyon <christophe.lyon@linaro.org>
* config/aarch64/aarch64-simd-builtins.def: Update builtins
tables: add tbl3 and tbx4.
* config/aarch64/aarch64-simd.md (aarch64_tbl3v8qi): New.
(aarch64_tbx4v8qi): New.
* config/aarch64/arm_neon.h (vtbl3_s8, vtbl3_u8, vtbl3_p8)
(vtbl4_s8, vtbl4_u8, vtbl4_p8, vtbx4_s8, vtbx4_u8, vtbx4_p8):
Rewrite using builtin functions.
* config/aarch64/iterators.md (UNSPEC_TBX): New.
From-SVN: r228716
Uros Bizjak [Mon, 12 Oct 2015 13:59:10 +0000 (15:59 +0200)]
rs6000.h (RS6000_ALIGN): Implement using ROUND_UP macro.
* config/rs6000/rs6000.h (RS6000_ALIGN): Implement using
ROUND_UP macro.
* config/rs6000/rs6000.c (rs6000_darwin64_record_arg_advance_flush):
Use ROUND_UP and ROUND_DOWN macros where applicable.
(rs6000_darwin64_record_arg_flush): Ditto.
(rs6000_function_arg): Use ROUND_UP to calculate align_words.
(rs6000_emit_probe_stack_range): Use ROUND_DOWN to calculate
rounded_size.
* config/aarch/aarch64.h (AARCH64_ROUND_UP): Remove.
(AARCH64_ROUND_DOWN): Ditto.
* config/aarch64/aarch64.c: Use ROUND_UP instead of AARCH64_ROUND_UP.
From-SVN: r228715
Richard Biener [Mon, 12 Oct 2015 12:26:02 +0000 (12:26 +0000)]
re PR ipa/67783 (quadratic time consumption in IPA inlining with -O1 and higher)
2015-10-12 Richard Biener <rguenther@suse.de>
PR ipa/67783
* ipa-inline-analysis.c (estimate_function_body_sizes): Re-add
code that analyzes IVs on each stmt but in a cheaper way avoiding
quadratic behavior.
From-SVN: r228710
Nick Clifton [Mon, 12 Oct 2015 10:20:56 +0000 (10:20 +0000)]
msp430.c (msp430_mcu_names): Rename to msp430_mcu_data, add fields for ISA and hardware multiply support.
* config/msp430/msp430.c (msp430_mcu_names): Rename to
msp430_mcu_data, add fields for ISA and hardware multiply
support. Import latest data from the devices.csv file.
(msp430_override_option): Use the data from the new array.
(msp430_use_f5_series_hwmult): Likewise.
(use_32bit_hwmult): Likewise.
(msp430_no_hwmult): Likewise.
* config/msp430/t-msp430 (MULTILIB_MATCHES): Add matches for new
MCU names.
* doc/invoke.texi (MSP430 Options): Note that if the MCU name is
not recognised then no hardware multiply support is assumed and
that only the MSP430 ISA is allowed.
From-SVN: r228707
Ville Voutilainen [Mon, 12 Oct 2015 08:55:19 +0000 (11:55 +0300)]
re PR c++/58566 ([c++11] ICE with invalid expression in lambda body)
PR c++/58566
/cp
2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/58566
* lambda.c (lambda_return_type): Return error_mark_node
instead of void_type_node for the error cases.
/testsuite
2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/58566
* g++.dg/cpp0x/lambda/lambda-58566.C: New.
From-SVN: r228706
Richard Biener [Mon, 12 Oct 2015 08:33:34 +0000 (08:33 +0000)]
tree-vect-loop.c (vect_analyze_loop_operations): Move cost related code ...
2015-10-12 Richard Biener <rguenther@suse.de>
* tree-vect-loop.c (vect_analyze_loop_operations): Move cost
related code ...
(vect_analyze_loop_2): ... here.
From-SVN: r228705
Jason Merrill [Mon, 12 Oct 2015 07:58:43 +0000 (03:58 -0400)]
re PR c++/67557 (Calling copy constructor of base class in constructor of derived class produces crashing code)
PR c++/67557
* expr.c (store_field): Call store_constructor directly when
storing a CONSTRUCTOR into a target smaller than its type.
Guard against unsafe bitwise copy.
From-SVN: r228704
Jan Hubicka [Mon, 12 Oct 2015 06:08:06 +0000 (08:08 +0200)]
cgraphbuild.c (compute_call_stmt_bb_frequency): Use counts when these are more informative.
* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
counts when these are more informative.
From-SVN: r228703
Jan Hubicka [Mon, 12 Oct 2015 06:01:37 +0000 (08:01 +0200)]
tree-profile.c (tree_profiling): Do not clear pure/const when not instrumenting.
* tree-profile.c (tree_profiling): Do not clear
pure/const when not instrumenting.
(pass tree_profile): Add dump of symtab.
From-SVN: r228702
Jan Hubicka [Mon, 12 Oct 2015 05:26:47 +0000 (07:26 +0200)]
fold-const.c (fold_comparsion): Pass OEP_ADDRESS_OF when comparing addresses.
* fold-const.c (fold_comparsion): Pass OEP_ADDRESS_OF when comparing
addresses.
(fold_addr_of_array_ref_difference): Likewise.
From-SVN: r228701
Jeff Law [Mon, 12 Oct 2015 01:17:51 +0000 (19:17 -0600)]
[PATCH] Refactoring FSM bits into their own file
[PATCH] Refactoring FSM bits into their own file
* tree-ssa-threadedge.c (fsm_find_thread_path): Moved from here into
tree-ssa-threadbackward.c.
(fsm_find_control_statement_thread_paths): Likewise.
(thread_through_normal_block): Break out FSM bits and move them
into a new function in tree-ssa-threadbackward.c. Call new function
instead.
Minimize header file usage.
* tree-ssa-threadbackward.h: New file.
* tree-ssa-threadbackward.c: Likewise.
* Makefile.in (OBJS): Add tree-ssa-threadbackward.o
From-SVN: r228700
GCC Administrator [Mon, 12 Oct 2015 00:16:13 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r228699
Joseph Myers [Sun, 11 Oct 2015 22:34:28 +0000 (23:34 +0100)]
Test for __cxa_thread_atexit_impl when cross-compiling libstdc++ for GNU targets.
I noticed that when testing glibc with a cross compiler I got
UNSUPPORTED: nptl/tst-thread_local1
because the libstdc++-v3 configuration for cross compiling defaulted
to __cxa_thread_atexit_impl not being available. This patch fixes
GLIBCXX_CROSSCONFIG to run the same test (for the case covering
targets with glibc) for __cxa_thread_atexit_impl as for native
compilation, just as it runs most of the other tests done for native
compilation (for these targets, it's not possible to build libstdc++
without already having built libc, so link tests are OK).
Tested with no regressions for cross to arm-none-linux-gnueabi.
* crossconfig.m4 (GLIBCXX_CROSSCONFIG) <*-linux* | *-uclinux* |
*-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-cygwin*>: Check for
__cxa_thread_atexit_impl.
* configure: Regenerate.
From-SVN: r228695
Uros Bizjak [Sun, 11 Oct 2015 15:41:17 +0000 (17:41 +0200)]
alpha.h (ALPHA_ROUND): Implement using ROUND_UP macro.
* config/alpha/alpha.h (ALPHA_ROUND): Implement using ROUND_UP macro.
From-SVN: r228693
Segher Boessenkool [Sun, 11 Oct 2015 09:03:09 +0000 (11:03 +0200)]
bb-reorder: Improve the simple algorithm for -Os (PR67864)
As the PR points out, the "simple" reorder algorithm makes bigger code
than the STC algorithm did, for -Os, for x86. I now tested it for many
different targets and it turns out to be worse everywhere.
This simple patch tunes "simple" a bit; this makes it better than STC
almost everywhere. The only exceptions (for the targets where I have
results) are x86 and mn10300. For those targets it may be best to switch
the default algorithm for -Os to STC.
2015-10-11 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/67864
* gcc/bb-reorder (reorder_basic_blocks_simple): Prefer existing
fallthrough edges for conditional jumps. Don't sort candidate
edges if not optimizing for speed.
From-SVN: r228692
Venkataramanan Kumar [Sun, 11 Oct 2015 08:06:14 +0000 (08:06 +0000)]
Add bdver4 for multiversioning and fix AMD model detection.
2015-10-09 Venkataramanan kumar <venkataramanan.kumar@amd.com>
* config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.
(__cpu_indicator_init): Fix model selection for AMD CPUs.
From-SVN: r228691
Trevor Saunders [Sun, 11 Oct 2015 00:48:28 +0000 (00:48 +0000)]
always define REVERSE_CONDITION
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (REVERSE_CONDITION): New default definition.
* jump.c (reversed_comparison_code_parts): Adjust.
From-SVN: r228690
Trevor Saunders [Sun, 11 Oct 2015 00:48:22 +0000 (00:48 +0000)]
remove unneeded #if for HARD_FRAME_POINTER_IS_ARG_POINTER
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* builtins.c (expand_builtin_setjmp_receiver): Don't use #if to
check HARD_FRAME_POINTER_IS_ARG_POINTER.
From-SVN: r228689
Trevor Saunders [Sun, 11 Oct 2015 00:48:17 +0000 (00:48 +0000)]
always define FRAME_ADDR_RTX
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (FRAME_ADDR_RTX): New default definition.
* builtins.c (expand_builtin_return_addr): Adjust.
From-SVN: r228688
Trevor Saunders [Sun, 11 Oct 2015 00:48:11 +0000 (00:48 +0000)]
always define DYNAMIC_CHAIN_ADDRESS
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (DYNAMIC_CHAIN_ADDRESS): New default definition.
* builtins.c (expand_builtin_return_addr): Adjust.
From-SVN: r228687
Trevor Saunders [Sun, 11 Oct 2015 00:48:02 +0000 (00:48 +0000)]
always define SETUP_FRAME_ADDRESSES
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (SETUP_FRAME_ADDRESSES): New default definition.
* builtins.c (expand_builtin_return_addr): Adjust.
* doc/tm.texi: Likewise.
* doc/tm.texi.in: Likewise.
* except.c (expand_builtin_unwind_init): Likewise.
From-SVN: r228686
Trevor Saunders [Sun, 11 Oct 2015 00:47:52 +0000 (00:47 +0000)]
always define INITIAL_FRAME_ADDRESS_RTX
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* builtins.c (expand_builtin_return_addr): Adjust.
* defaults.h (INITIAL_FRAME_ADDRESS_RTX): New default definition.
From-SVN: r228685
GCC Administrator [Sun, 11 Oct 2015 00:16:12 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r228684
Jan Hubicka [Sat, 10 Oct 2015 19:44:07 +0000 (19:44 +0000)]
tree.c (type_with_interoperable_signedness): New.
* tree.c (type_with_interoperable_signedness): New.
(gimple_canonical_types_compatible_p): Use it.
* tree.h (type_with_interoperable_signedness): Declare
From-SVN: r228681
Jan Hubicka [Sat, 10 Oct 2015 19:43:49 +0000 (21:43 +0200)]
tree.c (type_with_interoperable_signedness): New.
* tree.c (type_with_interoperable_signedness): New.
(gimple_canonical_types_compatible_p): Use it.
* tree.h (type_with_interoperable_signedness): Declare
* lto.c (hash_canonical_type): Honor
type_with_interoperable_signedness.
* gfortran.dg/lto/bind_c-2_0.f90: New testcase.
* gfortran.dg/lto/bind_c-2_1.c: New testcase.
* gfortran.dg/lto/bind_c-3_0.f90: New testcase.
* gfortran.dg/lto/bind_c-3_1.c: New testcase.
* gfortran.dg/lto/bind_c-4_0.f90: New testcase.
* gfortran.dg/lto/bind_c-4_1.c: New testcase.
* gfortran.dg/lto/bind_c-5_0.f90: New testcase.
* gfortran.dg/lto/bind_c-5_1.c: New testcase.
From-SVN: r228680
Jan Hubicka [Sat, 10 Oct 2015 19:37:47 +0000 (21:37 +0200)]
fold-const.c (operand_equal_p): Document OEP_ADDRESS_OF and OEP_CONSTANT_ADDRESS_OF...
* fold-const.c (operand_equal_p): Document OEP_ADDRESS_OF
and OEP_CONSTANT_ADDRESS_OF; skip type compatibility checks
when OEP_ADDRESS_OF is se.
From-SVN: r228679
Aditya Kumar [Sat, 10 Oct 2015 14:53:16 +0000 (14:53 +0000)]
add dump of data dependences
2015-10-07 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
* graphite-dependences.c (scop_get_dependences): Add dump of the
data dependence graph.
* graphite-poly.c (print_isl_union_map): New.
(debug_isl_union_map): New.
* graphite-poly.h (print_isl_union_map): Declare.
(debug_isl_union_map): Declare.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r228677
Aditya Kumar [Sat, 10 Oct 2015 14:53:10 +0000 (14:53 +0000)]
clean up debug functions
2015-10-07 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
* graphite-poly.c (print_iteration_domain): Remove verbosity.
Remove OpenScop formatting.
(print_iteration_domains): Same.
(debug_iteration_domain): Same.
(debug_iteration_domains): Same.
(print_pdr): Same.
(debug_pdr): Same.
(dump_gbb_cases): Same.
(dump_gbb_conditions): Same.
(print_pdrs): Same.
(debug_pdrs): Same.
(print_pbb_body): Same.
(print_pbb): Same.
(print_scop_params): Same.
(print_scop_context): Same.
(print_scop): Same.
(debug_pbb_domain): Same.
(debug_pbb): Same.
(debug_scop_context): Same.
(debug_scop): Same.
(debug_scop_params): Same.
* graphite-poly.h: Same.
* graphite.c (graphite_transform_loops): Same.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r228676
Trevor Saunders [Sat, 10 Oct 2015 14:32:56 +0000 (14:32 +0000)]
remove an unneeded as_a<rtx_insn *> ()
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* function.c (stack_protect_epilogue): Remove as_a<rtx_insn *> ()
call that isn't needed.
From-SVN: r228675
GCC Administrator [Sat, 10 Oct 2015 00:16:12 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r228672
Jeff Law [Fri, 9 Oct 2015 21:16:16 +0000 (15:16 -0600)]
Re: [PATCH] Update SSA_NAME manager to use two lists
* tree-ssanames.c (flush_ssaname_freelist): Use splice and truncate
rather than moving each name to the freelist individually.
From-SVN: r228668
Steve Ellcey [Fri, 9 Oct 2015 17:12:26 +0000 (17:12 +0000)]
mips.exp (mips_option_groups): Add -mframe-header-opt and -mno-frame-header-opt options.
2015-10-09 Steve Ellcey <sellcey@imgtec.com>
* gcc.target/mips/mips.exp (mips_option_groups): Add -mframe-header-opt
and -mno-frame-header-opt options.
* gcc.target/mips/frame-header-1.c: New file.
* gcc.target/mips/frame-header-2.c: New file.
* gcc.target/mips/frame-header-3.c: New file.
From-SVN: r228667
Steve Ellcey [Fri, 9 Oct 2015 17:10:42 +0000 (17:10 +0000)]
config.gcc (mips*-*-*): Add frame-header-opt.o to extra_objs.
2015-10-05 Steve Ellcey <sellcey@imgtec.com>
* config.gcc (mips*-*-*): Add frame-header-opt.o to extra_objs.
* frame-header-opt.c: New file.
* config/mips/mips-proto.h (mips_register_frame_header_opt):
Add prototype.
* config/mips/mips.c (mips_compute_frame_info): Check
optimize_call_stack flag.
(mips_option_override): Register new frame_header_opt pass.
(mips_frame_info, mips_int_mask, mips_shadow_set,
machine_function): Move these types to...
* config/mips/mips.h: here.
(machine_function): Add does_not_use_frame_header and
optimize_call_stack fields.
* config/mips/t-mips (frame-header-opt.o): Add new make rule.
* doc/invoke.texi (-mframe-header-opt, -mno-frame-header-opt):
Document new flags.
* config/mips/mips.opt (mframe-header-opt): Add new option.
From-SVN: r228666
Uros Bizjak [Fri, 9 Oct 2015 16:53:37 +0000 (18:53 +0200)]
* config/i386/i386.c
(expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Use
ROUND_DOWN where applicable.
From-SVN: r228665
Jeff Law [Fri, 9 Oct 2015 16:34:00 +0000 (10:34 -0600)]
[PATCH] [6/n] Fix minor SSA_NAME leaks
* tree-vect-stmts.c (free_stmt_vec_info): Free the LHS of the
correct statement.
From-SVN: r228663
Renlin Li [Fri, 9 Oct 2015 16:22:33 +0000 (16:22 +0000)]
[PATCH][ARM]Add earlyclobber modifier for neon_(vtrn, vuzp, vzip)<mode>_insn rtx
pattern.
gcc/
2015-10-09 Renlin Li <renlin.li@arm.com>
* config/arm/neon.md (neon_vuzp<mode>_insn): Add & modifier for
operands[0] and operands[2].
(neon_vtrn<mode>_insn): Likewise.
(neon_vzip<mode>_insn): Likewise.
From-SVN: r228662
Andre Vieira [Fri, 9 Oct 2015 16:08:35 +0000 (16:08 +0000)]
[PATCH V3][GCC] Algorithmic optimization in match and simplify
gcc/ChangeLog
* match.pd: ((X inner_op C0) outer_op C1) New pattern.
((X & C2) << C1): Expand to...
(X {&,^,|} C2 << C1): ...This.
((X & C2) >> C1): Expand to...
(X {&,^,|} C2 >> C1): ...This.
gcc/testsuite/ChangeLog
* gcc.dg/tree-ssa/forwprop-33.c: New.
Co-Authored-By: Hale Wang <hale.wang@arm.com>
From-SVN: r228661
Alexander Fomin [Fri, 9 Oct 2015 15:57:06 +0000 (15:57 +0000)]
AVX512: Fix embedded rounding/SAE specifier position.
gcc/
PR target/67895
* config/i386/sse.md (define_insn "sse_cvtsi2ss<round_name>"):
Adjust embedded rounding/SAE specifier position.
(define_insn "sse_cvtsi2ssq<round_name>"): Likewise.
(define_insn "cvtusi2<ssescalarmodesuffix>32<round_name>"): Likewise.
(define_insn "cvtusi2<ssescalarmodesuffix>64<round_name>"): Likewise.
(define_insn "sse2_cvtsi2sdq<round_name>"): Likewise.
(define_insn "avx512dq_rangep<mode><mask_name><round_saeonly_name>"):
Likewise.
(define_insn "avx512dq_ranges<mode><round_saeonly_name>"): Likewise.
gcc/testsuite
PR target/67895
* gcc.target/i386/avx512dq-vrangepd-1.c: Adjust assembly regexp.
* gcc.target/i386/avx512dq-vrangeps-1.c: Likewise.
* gcc.target/i386/avx512dq-vrangesd-1.c: Likewise.
* gcc.target/i386/avx512dq-vrangess-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsi2sd64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsi2ss-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsi2ss64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtusi2sd64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtusi2ss-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtusi2ss64-1.c: Likewise.
From-SVN: r228660
David Malcolm [Fri, 9 Oct 2015 13:55:23 +0000 (13:55 +0000)]
Testsuite: add dg-{begin|end}-multiline-output commands
This patch adds an easy way to write tests for expected multiline
output. For example we can test carets and underlines for
a particular diagnostic with:
/* { dg-begin-multiline-output "" }
typedef struct _GMutex GMutex;
^~~~~~~
{ dg-end-multiline-output "" } */
multiline.exp is used by prune.exp; hence we need to load it before
prune.exp via *load_gcc_lib* for the testsuites of the various
non-"gcc" support libraries (e.g. boehm-gc).
gcc/testsuite/ChangeLog:
* lib/multiline.exp: New file.
* lib/prune.exp: Load multiline.exp.
(prune_gcc_output): Call into multiline.exp to handle any
multiline output directives.
* lib/libgo.exp: Load multiline.exp before prune.exp, using
load_gcc_lib.
boehm-gc/ChangeLog:
* testsuite/lib/boehm-gc.exp: Load multiline.exp before
prune.exp, using load_gcc_lib.
libatomic/ChangeLog:
* testsuite/lib/libatomic.exp: Load multiline.exp before
prune.exp, using load_gcc_lib.
libgomp/ChangeLog:
* testsuite/lib/libgomp.exp: Load multiline.exp before prune.exp,
using load_gcc_lib.
libitm/ChangeLog:
* testsuite/lib/libitm.exp: Load multiline.exp before prune.exp,
using load_gcc_lib.
libvtv/ChangeLog:
* testsuite/lib/libvtv.exp: Load multiline.exp before prune.exp,
using load_gcc_lib.
From-SVN: r228655
Martin Jambor [Fri, 9 Oct 2015 13:13:38 +0000 (15:13 +0200)]
[PR 67794] Also remap SSA_NAMEs defined in ASMs in IPA-SRA
2015-10-09 Martin Jambor <mjambor@suse.cz>
tree-optimization/67794
* tree-sra.c (replace_removed_params_ssa_names): Do not distinguish
between types of state,ents but accept original definitions as a
parameter.
(ipa_sra_modify_function_body): Use FOR_EACH_SSA_DEF_OPERAND to
iterate over definitions.
testsuite/
* gcc.dg/ipa/ipa-sra-10.c: Nw test.
* gcc.dg/torture/pr67794.c: Likewise.
From-SVN: r228654
James Norris [Fri, 9 Oct 2015 12:35:58 +0000 (12:35 +0000)]
rs6000.c (rs6000_offload_options): New.
* config/rs6000/rs6000.c (rs6000_offload_options): New.
(TARGET_OFFLOAD_OPTIONS): New.
From-SVN: r228653
Alexandre Oliva [Fri, 9 Oct 2015 12:18:58 +0000 (12:18 +0000)]
[PR67891] don't test is_gimple_reg after parm expansion
for gcc/ChangeLog
PR middle-end/67891
* cfgexpand.c (set_parm_rtl): Drop is_gimple_reg test.
From-SVN: r228652
Alexandre Oliva [Fri, 9 Oct 2015 12:18:40 +0000 (12:18 +0000)]
[PR67766] reorder handling of parallels, concats and promoted values in return
for gcc/ChangeLog
PR middle-end/67766
* function.c (expand_function_end): Move return value
promotion past the handling of PARALLELs and CONCATs.
From-SVN: r228651
Alexandre Oliva [Fri, 9 Oct 2015 12:18:24 +0000 (12:18 +0000)]
[PR67828] don't unswitch on default defs of non-parms
for gcc/ChangeLog
PR rtl-optimizatoin/67828
* tree-ssa-loop-unswitch.c: Include tree-ssa.h.
(tree_may_unswitch_on): Don't unswitch on expressions
involving undefined values.
for gcc/testsuite/ChangeLog
PR rtl-optimization/67828
* gcc.dg/torture/pr67828.c: New.
From-SVN: r228650
Martin Liska [Fri, 9 Oct 2015 11:49:49 +0000 (13:49 +0200)]
* MAINTAINERS (Write After Approval): Add myself.
From-SVN: r228649
Richard Biener [Fri, 9 Oct 2015 11:47:31 +0000 (11:47 +0000)]
genmatch.c (print_operand): Fix formatting.
2015-10-09 Richard Biener <rguenther@suse.de>
* genmatch.c (print_operand): Fix formatting.
(dt_node::append_simplify): Warn for multiple simplifiers
that match the same pattern.
* match.pd (log (exp @0)): Remove duplicates.
From-SVN: r228648
Christian Bruel [Fri, 9 Oct 2015 11:20:23 +0000 (13:20 +0200)]
fix Changelog entry removed at revision 228479
From-SVN: r228647
Jonathan Wakely [Fri, 9 Oct 2015 11:19:04 +0000 (12:19 +0100)]
Missed ChangeLog for previous libstdc++-v3 commit
Add include/experimental/bits dir
* include/experimental/erase_if.h: Move to ...
* include/experimental/bits/erase_if.h: New.
* include/experimental/fs_dir.h: Move to ...
* include/experimental/bits/fs_dir.h: New.
* include/experimental/fs_fwd.h: Move to ...
* include/experimental/bits/fs_fwd.h: New.
* include/experimental/fs_ops.h: Move to ...
* include/experimental/bits/fs_ops.h: New.
* include/experimental/fs_path.h: Move to ...
* include/experimental/bits/fs_path.h: New.
* include/experimental/string_view.tcc: Move to ...
* include/experimental/bits/string_view.tcc: New.
* include/Makefile.am: Add include/experimental/bits sub-directory.
* include/Makefile.in: Regenerate.
* include/experimental/filesystem: Adjust includes.
* include/experimental/map: Likewise.
* include/experimental/set: Likewise.
* include/experimental/string_view: Likewise.
* include/experimental/unordered_map: Likewise.
* include/experimental/unordered_set: Likewise.
From-SVN: r228646
Jonathan Wakely [Fri, 9 Oct 2015 11:11:54 +0000 (12:11 +0100)]
Add include/experimental/bits dir
From-SVN: r228645
Ramana Radhakrishnan [Fri, 9 Oct 2015 10:58:06 +0000 (10:58 +0000)]
[PATCH PR target/67366 2/2] [gimple-fold.c] Support movmisalign optabs in gimple-fold.c
This patch by Richard allows for movmisalign optabs to be supported
in gimple-fold.c. This caused a bit of pain in the testsuite with strlenopt-8.c
in conjunction with the ARM support for movmisalign_optabs as the test
was coded up to do different things depending on whether the target
supported misaligned access or not. However now with unaligned access
being allowed for different levels of the architecture in the arm backend,
the concept of the helper function non_strict_align mapping identically
to the definition of STRICT_ALIGNMENT disappears.
Adjusted thusly for ARM. The testsuite/lib changes were tested with an
arm-none-eabi multilib that included architecture variants that did not
support unaligned access and architecture variants that did.
The testing matrix for this patch was:
1. x86_64 bootstrap and regression test - no regressions.
2. armhf bootstrap and regression test - no regressions.
3. arm-none-eabi cross build and regression test for
{-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp}
{-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard}
{-marm/-mcpu=arm7tdmi/-mfloat-abi=soft}
{-mthumb/-mcpu=arm7tdmi/-mfloat-abi=soft}
with no regressions.
Ok to apply ?
2015-10-09 Richard Biener <rguenth@suse.de>
PR target/67366
* gimple-fold.c (optabs-query.h): Include
(gimple_fold_builtin_memory_op): Allow unaligned stores
when movmisalign_optabs are available.
2015-10-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/67366
* lib/target-supports.exp (check_effective_target_non_strict_align):
Adjust for arm*-*-*.
* gcc.target/arm/pr67366.c: New test.
From-SVN: r228644
Ramana Radhakrishnan [Fri, 9 Oct 2015 10:53:31 +0000 (10:53 +0000)]
[Patch PR target/67366 1/2] [ARM] - Add movmisalignhi / si patterns
This adds movmisalignhi and movmisalignsi expanders when unaligned
access is allowed by the architecture. This allows the mid-end
to expand to misaligned loads and stored.
Compared code generated for the Linux kernel and
it changes code generation for a handful of files all for the better
basically by reducing the stack usage.
Tested by :
1. armhf bootstrap and regression test - no regressions.
2.. arm-none-eabi cross build and regression test for
{-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp}
{-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard}
{-marm/-mcpu=arm7tdmi/-mfloat-abi=soft}
{-mthumb/-mcpu=arm7tdmi/-mfloat-abi=soft}
Will apply to trunk once 2/2 is approved.
regards
Ramana
2015-10-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/67366
* config/arm/arm.md (movmisalign<mode>): New.
* config/arm/iterators.md (HSI): New.
From-SVN: r228643
Alexander Fomin [Fri, 9 Oct 2015 10:50:51 +0000 (10:50 +0000)]
* MAINTAINERS (Write After Approval): Add myself.
From-SVN: r228642
Eric Botcazou [Fri, 9 Oct 2015 08:13:33 +0000 (08:13 +0000)]
Make-lang.in: Make sure that GNAT1_OBJS and not just GNAT1_ADA_OBJS are compiled only after...
* gcc-interface/Make-lang.in: Make sure that GNAT1_OBJS and not just
GNAT1_ADA_OBJS are compiled only after generated files are created.
From-SVN: r228636
Richard Biener [Fri, 9 Oct 2015 08:12:18 +0000 (08:12 +0000)]
re PR middle-end/67891 (FAIL: gcc.dg/pr43300.c (internal compiler error) on alpha-linux-gnu)
2015-10-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/67891
* gimple-match.h (gimple_simplified_result_is_gimple_val):
New helper.
(gimple_resimplify1): Declare.
(gimple_resimplify2): Likewise.
(gimple_resimplify3): Likewise.
* gimple-match-head.c (gimple_resimplify1): Export.
(gimple_resimplify2): Likewise.
(gimple_resimplify3): Likewise.
(maybe_push_res_to_seq): Use gimple_simplified_result_is_gimple_val.
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise.
* tree-ssa-sccvn.c (visit_reference_op_load): Use gimple_resimplify1
to avoid creating stmts without VN info.
* gcc.dg/tree-ssa/pr67891.c: New testcase.
From-SVN: r228635
Jeff Law [Fri, 9 Oct 2015 05:09:56 +0000 (23:09 -0600)]
[PATCH] [5/n] Fix minor SSA_NAME leaks
* value-prof.c (gimple_ic): Add missing calls to unlink_stmt_vdef
and release_ssa_name in two places.
(gimple_stringop_fixed_value): Similarly.
From-SVN: r228632
GCC Administrator [Fri, 9 Oct 2015 00:16:19 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r228631
Jan Hubicka [Thu, 8 Oct 2015 23:20:06 +0000 (01:20 +0200)]
ipa-icf.c (sem_item::compare_symbol_references): Fix use of availability.
* ipa-icf.c (sem_item::compare_symbol_references): Fix use
of availability.
From-SVN: r228628
Jeff Law [Thu, 8 Oct 2015 23:19:35 +0000 (17:19 -0600)]
[PATCH] [4/n] Fix minor SSA_NAME leaks
* tree-ssa-loop-im.c (rewrite_bittest): Add missing call to
release_defs.
From-SVN: r228627
Jeff Law [Thu, 8 Oct 2015 23:18:03 +0000 (17:18 -0600)]
[PATCH] [4/n] Fix minor SSA_NAME leaks
* tree-ssa-loop-im.c (rewrite_bittest): Add missing call to
release_defs.
From-SVN: r228626
Jeff Law [Thu, 8 Oct 2015 20:47:46 +0000 (14:47 -0600)]
[PATCH] [3/n] Fix minor SSA_NAME leaks
* tree-stdarg.c (expand_ifn_va_arg_1): Add missing call to
unlink_stmt_vdef and release_ssa_name_fn.
From-SVN: r228625
Jeff Law [Thu, 8 Oct 2015 20:27:38 +0000 (14:27 -0600)]
[PATCH] [2/n] Fix minor SSA_NAME leaks
* tree-ssa-dse.c (dse_optimize_stmt): Add missing call to
release_defs.
From-SVN: r228624
Ilya Verbin [Thu, 8 Oct 2015 19:04:43 +0000 (19:04 +0000)]
liboffloadmic: Add missed checks for malloc and strdup return values
liboffloadmic/
* runtime/offload_engine.cpp (Engine::init_process): Use strdup instead
of sizeof+malloc+sprintf, check for return value.
* runtime/offload_env.cpp (MicEnvVar::get_env_var_kind): Check for
strdup return value.
* runtime/offload_host.cpp (__offload_init_library_once): Check for
strdup return value. Fix size calculation of COI_HOST_THREAD_AFFINITY.
* runtime/emulator/coi_device.cpp (COIProcessWaitForShutdown): Check for
malloc return value.
From-SVN: r228622
H.J. Lu [Thu, 8 Oct 2015 18:57:11 +0000 (18:57 +0000)]
Round up the SSE register save area only if needed
There is is no point to round up the SSE register save area to 16 bytes if
the incoming stack boundary is less than 16 bytes.
* config/i386/i386.c (ix86_compute_frame_layout): Round up the
SSE register save area to 16 bytes only if the incoming stack
boundary is no less than 16 bytes.
From-SVN: r228621
Jeff Law [Thu, 8 Oct 2015 17:50:44 +0000 (11:50 -0600)]
[PATCH] [1/n] Fix minor SSA_NAME leaks
* tree-ssa-phiopt.c (factor_out_conversion): Add missing calls to
release_ssa_name. Fix typo in comment.
From-SVN: r228619
Nathan Sidwell [Thu, 8 Oct 2015 17:31:36 +0000 (17:31 +0000)]
nvptx.h (struct machine_function): Add comment.
* config/nvptx/nvptx.h (struct machine_function): Add comment.
* config/nvptx/nvptx.c (nvptx_declare_function_name): Functions
may return pointer as well as in memory.
(nvptx_output_return): Likewise.
From-SVN: r228618
Richard Sandiford [Thu, 8 Oct 2015 16:54:37 +0000 (16:54 +0000)]
Move sqrt and cbrt simplifications to match.pd
This patch moves the sqrt and cbrt simplification rules to match.pd.
builtins.c now only does the constant folding.
Bootstrapped & regression-tested on x86_64-linux-gnu.
gcc/
* builtins.c (fold_builtin_sqrt, fold_builtin_cbrt): Delete.
(fold_builtin_1): Update accordingly. Handle constant arguments here.
* match.pd: Add rules previously handled by fold_builtin_sqrt
and fold_builtin_cbrt.
gcc/testsuite/
* gcc.dg/builtins-47.c: Test the optimized dump instead.
From-SVN: r228616
Richard Sandiford [Thu, 8 Oct 2015 16:49:24 +0000 (16:49 +0000)]
Make tree_expr_nonnegative_warnv_p recurse into SSA names
The upcoming patch to move sqrt and cbrt simplifications to match.pd
caused a regression because the (abs @0)->@0 simplification didn't
trigger for:
(abs (convert (abs X)))
The simplification is based on tree_expr_nonnegative_p, which at
the moment just gives up if it sees an SSA_NAME.
This patch makes tree_expr_nonnegative_p recurse into SSA name
definitions, but limits the depth of recursion to a small number
for the reason mentioned in the comment (adapted from an existing
comment in gimple_val_nonnegative_real_p). The patch reuses code
in tree-vrp.c, moving it to gimple-fold.c. It also replaces calls
to gimple_val_nonnegative_real_p with calls to tree_expr_nonnegative_p.
A knock-on effect is that we can now prove _i_589 < 0 is false in
sequences like:
i_1917 = ASSERT_EXPR <i_1075, i_1075 == 0>;
_i_589 = (const int) i_1917;
_i_1507 = ASSERT_EXPR <_i_589, _i_589 < 0>;
This defeats an assert in tree-vrp.c that ASSERT_EXPR conditions
are never known to be false. Previously the assert only ever used
local knowledge and so would be limited to cases like x != x for
integer x. Now that we use global knowledge it's possible to prove
the assertion condition is false in blocks that are in practice
unreachable. The patch therefore removes the assert.
Bootstrapped & regression-tested on x86_64-linux-gnu. I didn't write
a specific test because this is already covered by the testsuite if
the follow-on patch is also applied.
gcc/
* params.def (PARAM_MAX_SSA_NAME_QUERY_DEPTH): New param.
* doc/invoke.texi (--param max-ssa-name-query-depth): Document.
* fold-const.h (tree_unary_nonnegative_warnv_p)
(tree_single_nonnegative_warnv_p, tree_call_nonnegative_warnv_p)
(tree_expr_nonnegative_warnv_p): Add depth parameters.
* fold-const.c: Include gimple-fold.h and params.h.
(tree_ssa_name_nonnegative_warnv_p): New function.
(tree_unary_nonnegative_warnv_p, tree_binary_nonnegative_warnv_p)
(tree_single_nonnegative_warnv_p, tree_call_nonnegative_warnv_p)
(tree_invalid_nonnegative_warnv_p, tree_expr_nonnegative_warnv_p):
Add a depth parameter and increment it for recursive calls to
tree_expr_nonnegative_warnv_p. Use tree_ssa_name_nonnegative_warnv_p
to handle SSA names.
* gimple-fold.h (gimple_val_nonnegative_real_p): Delete.
(gimple_stmt_nonnegative_warnv_p): Declare.
* tree-vrp.c (remove_range_assertions): Remove assert that condition
cannot be proven false.
(gimple_assign_nonnegative_warnv_p, gimple_call_nonnegative_warnv_p)
(gimple_stmt_nonnegative_warnv_p): Move to...
* gimple-fold.c: ...here. Add depth parameters and pass them
down to the tree routines. Accept statements that aren't
assignments or calls but just return false for them.
(gimple_val_nonnegative_real_p): Delete.
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Use
tree_expr_nonnegative_p instead of gimple_val_nonnegative_real_p.
Check HONOR_NANs first.
From-SVN: r228614
Martin Jambor [Thu, 8 Oct 2015 16:30:06 +0000 (18:30 +0200)]
Fix Solaris bootstrap
2015-10-08 Martin Jambor <mjambor@suse.cz>
* ipa-cp.c (meet_with_1): Make the argument of abs signed. Remove
unnecessary MIN.
From-SVN: r228607
Jason Merrill [Thu, 8 Oct 2015 16:14:03 +0000 (12:14 -0400)]
cp-tree.h (SIMPLE_TARGET_EXPR_P): New.
* cp-tree.h (SIMPLE_TARGET_EXPR_P): New.
* init.c (get_nsdmi): Use it.
* typeck2.c (massage_init_elt): Use it.
From-SVN: r228606
Jason Merrill [Thu, 8 Oct 2015 16:13:57 +0000 (12:13 -0400)]
format
From-SVN: r228605
Joseph Myers [Thu, 8 Oct 2015 15:55:25 +0000 (16:55 +0100)]
* zh_TW.po: Update.
From-SVN: r228603
Jason Merrill [Thu, 8 Oct 2015 14:42:02 +0000 (10:42 -0400)]
re PR c++/67557 (Calling copy constructor of base class in constructor of derived class produces crashing code)
PR c++/67557
* call.c (is_base_field_ref): New.
(unsafe_copy_elision_p): New.
(build_over_call): Use it.
From-SVN: r228602
Yuri Rumyantsev [Thu, 8 Oct 2015 14:28:53 +0000 (14:28 +0000)]
tree-vect-loop.c (vect_analyze_loop_operations): Skip virtual phi in the tail of outer-loop.
gcc/
* tree-vect-loop.c (vect_analyze_loop_operations): Skip virtual phi
in the tail of outer-loop.
gcc/testsuite/
* gcc.dg/vect/vect-outer-simd-3.c: New test.
From-SVN: r228601
David Edelsohn [Thu, 8 Oct 2015 14:19:57 +0000 (14:19 +0000)]
rs6000.c (rs6000_xcoff_debug_unwind_info): Always return UI_NONE.
* config/rs6000/rs6000.c (rs6000_xcoff_debug_unwind_info): Always
return UI_NONE.
From-SVN: r228600
Yuri Rumyantsev [Thu, 8 Oct 2015 13:14:09 +0000 (13:14 +0000)]
tree-ssa-loop-unswitch.c: Include "gimple-iterator.h" and "cfghooks.h"...
gcc/
* tree-ssa-loop-unswitch.c: Include "gimple-iterator.h" and
"cfghooks.h", add prototypes for introduced new functions.
(tree_ssa_unswitch_loops): Use from innermost loop iterator, move all
checks on ability of loop unswitching to tree_unswitch_single_loop;
invoke tree_unswitch_single_loop or tree_unswitch_outer_loop depending
on innermost loop check.
(tree_unswitch_single_loop): Add all required checks on ability of
loop unswitching under zero recursive level guard.
(tree_unswitch_outer_loop): New function.
(find_loop_guard): Likewise.
(empty_bb_without_guard_p): Likewise.
(used_outside_loop_p): Likewise.
(get_vop_from_header): Likewise.
(hoist_guard): Likewise.
(check_exit_phi): Likewise.
gcc/testsuite/
* gcc.dg/loop-unswitch-2.c: New test.
* gcc.dg/loop-unswitch-3.c: Likewise.
* gcc.dg/loop-unswitch-4.c: Likewise.
From-SVN: r228599