2015-12-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/68870
* tree-cfgcleanup.c (cleanup_control_expr_graph): Add first_p
parameter, if set only perform trivial constant folding.
Queue other blocks with conditions for later processing.
(cleanup_control_flow_bb): Add first_p parameter and pass it through.
(cleanup_tree_cfg_1): Pass true for the first iteration
cleanup_control_expr_graph.
* gcc.dg/torture/pr68870.c: New testcase.
From-SVN: r231695
testsuite/
* lib/target-supports.exp (add_options_for_arm_v8_1a_neon): Update
comment. Use check_effective_target_arm_v8_1a_neon_ok to select
the command line options.
(check_effective_target_arm_v8_1a_neon_ok_nocache): Update initial
test to allow ARM targets. Select and record a working set of
command line options.
(check_effective_target_arm_v8_1a_neon_hw): Add tests for ARM
targets.
gcc/
* doc/sourcebuild.texi (ARM-specific attributes): Add
"arm_v8_1a_neon_ok" and "arm_v8_1a_neon_hw".
From-SVN: r231683
PR target/68648
* config/arm/arm.md (*andsi_iorsi3_notsi): Try to simplify
the complement of operands[3] during splitting.
* gcc.c-torture/execute/pr68648.c: New test.
From-SVN: r231675
PR rtl-optimization/65980
* jump.c (rtx_renumbered_equal_p) <case LABEL_REF>: Use
next_nonnote_nondebug_insn instead of next_real_insn and
skip over CODE_LABELs too.
* gcc.dg/pr65980.c: New test.
From-SVN: r231672
gcc/testsuite/ChangeLog:
2015-12-15 Martin Sebor <msebor@redhat.com>
c++/42121
c++/68478
c++/68613
c++/68689
c++/68710
* g++.dg/compat/struct-layout-1_generate.c: Avoid generating
further fields after the first flexible array member.
* g++.dg/ext/flexary2.C: Expect a sole flexible array member
to be rejected. Add a test case exercising zero-length array.
* g++.dg/ext/flexary3.C: Expect a sole flexible array member
to be rejected.
* g++.dg/ext/flexary.h: New file.
* g++.dg/ext/flexary4.C: New file.
* g++.dg/ext/flexary5.C: New file.
* g++.dg/ext/flexary6.C: New file.
* g++.dg/ext/flexary7.C: New file.
* g++.dg/ext/flexary8.C: New file.
* g++.dg/other/dump-ada-spec-2.C: Adjust to reflect flexible
array members.
* g++.dg/parse/pr43765.C: Add a member to make a struct with
a flexible array member valid. Adjust expected error message.
* g++.dg/torture/pr64280.C: Expect a sole flexible array member
to be rejected.
* g++.dg/torture/pr64312.C: Add a member to make a struct with
a flexible array member valid.
* g++.dg/ubsan/object-size-1.C: Adjust expected diagnostic.
gcc/cp/ChangeLog:
2015-12-15 Martin Sebor <msebor@redhat.com>
c++/42121
c++/68478
c++/68613
c++/68689
c++/68710
* class.c (walk_subobject_offsets): Avoid assuming type domain
is non-null or has an upper bound.
(layout_class_type): Include type size in error message.
(flexmems_t): New type.
(field_nonempty_p, find_flexarrays, diagnose_flexarrays)
(check_flexarrays): New functions.
(finish_struct_1): Call check_flexarrays.
* decl.c (compute_array_index_type): Distinguish flexible array
members from zero-length arrays.
(grokdeclarator): Reject flexible array members in unions. Avoid
rejecting members of incomplete types that are flexible array members.
* error.c (dump_type_suffix): Handle flexible array members with null
upper bound.
* init.c (perform_member_init): Same.
* pt.c (instantiate_class_template_1): Allow flexible array members.
(tsubst): Handle flexible array members with null upper bound.
* typeck2.c (digest_init_r): Warn for initialization of flexible
array members.
(process_init_constructor_record): Handle flexible array members.
gcc/ChangeLog:
2015-12-15 Martin Sebor <msebor@redhat.com>
c++/42121
* tree-chkp.c (chkp_find_bound_slots_1): Handle flexible array
members.
* tree.c (type_contains_placeholder_1): Avoid assuming type has
a non-null domain or an upper bound to handle flexible array
members.
* varasm.c (output_constructor_regular_field): Same.
(output_constructor): Set min_index to integer_zero_node rather
than null when a type has no domain to avoid crashing later.
From-SVN: r231665
* config/nvptx/nvptx.c (write_one_arg): Rename to ...
(write_arg_mode): ... here. Update callers.
(write_arg): Rename to ...
(write__arg_type): ... here. Update callers.
(write_return_mode): New fn, broken out of ...
(write_return): ... here. Rename to ...
(write_return_type): ... here. Call it. Update callers.
(write_fn_proto_from_insn): Use write_arg_mode and
write_return_mode.
(init_frame): New fn.
(nvptx_declare_function_name): Call it for frame and varargs. Only
emit outgoing static chain, if it's live.
(nvptx_output_return): Use reg_names for return reg name.
(nvptx_output_call_insn): Likewise.
(nvptx_reorg): Mark unused hard regs too.
From-SVN: r231663
* config/nvptx/nvptx.md (nvptx_register_operand): Don't accept and
then reject subregs.
(nvptx_reg_or_mem_operand): Likewise.
(nvptx_nonmemory_operand): Likewise.
(call_insn_operand): A regular predicate, check SYMBOL_REF_FUNCTION_P.
(call_insn, call_value_insn): Address is not SImode.
* config/nvptx/nvptx.h (FIXED_REGISTERS): Make return reg fixed.
(enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Remove
RETURN_REG class.
(REGNO_REG_CLASS): Alwaus ALL_REGS.
(PROMOTE_MODE): QI and HI are the only smaller than SI int modes.
(HARD_FRAME_POINTER_REGNUM): Delete.
(REGISTER_NAMES): Move earlier.
(struct nvptx_args): Remove 'off'.
(INIT_CUMULATIVE_ARGS): Don't initialize 'off'.
(ELIMINABLE_REGS): Remove HARD_FRAME_POINTER_REGNUM.
* config/nvptx/nvptx.c (arg_promotion): Delete.
(nvptx_expand_call): Remove check for funtype being an fntype.
From-SVN: r231659
gcc/c-family/
* c-common.c (c_common_attribute_table): Handle "omp declare target
link" attribute.
gcc/
* cgraphunit.c (output_in_order): Do not assemble "omp declare target
link" variables in ACCEL_COMPILER.
* gimplify.c (gimplify_adjust_omp_clauses): Do not remove mapping of
"omp declare target link" variables.
* omp-low.c (scan_sharing_clauses): Do not remove mapping of "omp
declare target link" variables.
(add_decls_addresses_to_decl_constructor): For "omp declare target link"
variables output address of the artificial pointer instead of address of
the variable. Set most significant bit of the size to mark them.
(pass_data_omp_target_link): New pass_data.
(pass_omp_target_link): New class.
(find_link_var_op): New static function.
(make_pass_omp_target_link): New function.
* passes.def: Add pass_omp_target_link.
* tree-pass.h (make_pass_omp_target_link): Declare.
* varpool.c (symbol_table::output_variables): Do not assemble "omp
declare target link" variables in ACCEL_COMPILER.
gcc/lto/
* lto.c: Include stringpool.h and fold-const.h.
(offload_handle_link_vars): New static function.
(lto_main): Call offload_handle_link_vars.
libgomp/
* libgomp.h (REFCOUNT_LINK): Define.
(struct splay_tree_key_s): Add link_key.
* target.c (gomp_map_vars): Treat REFCOUNT_LINK objects as not mapped.
Replace target address of the pointer with target address of newly
mapped object in the splay tree. Set link pointer on target to the
device address of the mapped object.
(gomp_unmap_vars): Restore target address of the pointer in the splay
tree for REFCOUNT_LINK objects after unmapping.
(gomp_load_image_to_device): Set refcount to REFCOUNT_LINK for "omp
declare target link" objects.
(gomp_unload_image_from_device): Replace j with i. Force unmap of all
"omp declare target link" objects, which were mapped for the image.
(gomp_exit_data): Restore target address of the pointer in the splay
tree for REFCOUNT_LINK objects after unmapping.
* testsuite/libgomp.c/target-link-1.c: New file.
From-SVN: r231655
PR tree-optimization/66688
* tree-cfgcleanup.c (cleanup_control_flow_bb): Handle
noreturn call followed only by debug stmts by removing
the debug stmts and handling it the same as if the noreturn
call is the last stmt.
* gcc.dg/pr66688.c: New test.
From-SVN: r231644
PR libstdc++/68863
* include/bits/regex_executor.tcc (_Executor::_M_lookahead):
Copy the captured content for lookahead, so that the backreferences
inside can refer to them.
* testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc:
New testcase.
From-SVN: r231641
gcc/cp/ChangeLog:
PR c++/21802
PR c++/53223
* cp-tree.h (cp_tree_code_length): Declare.
(build_min_non_dep_op_overload): Declare.
* tree.c (cp_tree_code_length): Define.
(build_min_non_dep_op_overload): Define.
(build_win_non_dep_call_vec): Copy the KOENIG_LOOKUP_P flag.
* typeck.c (build_x_indirect_ref): Use
build_min_non_dep_op_overload when the given expression
has been resolved to an operator overload.
(build_x_binary_op): Likewise.
(build_x_array_ref): Likewise.
(build_x_unary_op): Likewise.
(build_x_compound_expr): Likewise.
(build_x_modify_expr): Likewise.
* decl2.c (grok_array_decl): Likewise.
* call.c (build_new_op_1): If during template processing we
chose an operator overload that is a hidden friend function, set
the call's KOENIG_LOOKUP_P flag to 1.
gcc/testsuite/ChangeLog:
PR c++/21802
PR c++/53223
* g++.dg/cpp0x/pr53223.C: New test.
* g++.dg/lookup/pr21802.C: New test.
* g++.dg/lookup/two-stage4.C: Remove XFAIL.
From-SVN: r231640
2015-12-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/pr68867
* io/write.c (set_fnode_default): For kind=16, set the decimal precision
depending on the platform binary precision, 106 or 113.
From-SVN: r231639