platform/upstream/gcc.git
7 years ago[3/4] ARMv8.2-A testsuite for new vector intrinsics
Jiong Wang [Mon, 10 Oct 2016 13:47:14 +0000 (13:47 +0000)]
[3/4] ARMv8.2-A testsuite for new vector intrinsics

gcc/testsuite/

* gcc.target/aarch64/advsimd-intrinsics/vdiv_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vfmas_lane_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vfmas_n_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vmaxnmv_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vmaxv_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vminnmv_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vminv_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vmul_lane_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vmulx_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vmulx_lane_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vmulx_n_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vpminmaxnm_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vrndi_f16_1.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vsqrt_f16_1.c: New.

From-SVN: r240923

7 years ago[2/4] ARMv8.2-A testsuite for new data movement intrinsics
Jiong Wang [Mon, 10 Oct 2016 13:45:17 +0000 (13:45 +0000)]
[2/4] ARMv8.2-A testsuite for new data movement intrinsics

gcc/testsuite/

* gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h (FP16_SUPPORTED):
Enable AArch64.
* gcc.target/aarch64/advsimd-intrinsics/vdup_lane.c: Add support for
vdup*_laneq.
* gcc.target/aarch64/advsimd-intrinsics/vduph_lane.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vtrn_half.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vuzp_half.c: New.
* gcc.target/aarch64/advsimd-intrinsics/vzip_half.c: New.

From-SVN: r240922

7 years ago[1/4] ARMv8.2-A FP16 testsuite selector
Jiong Wang [Mon, 10 Oct 2016 13:43:01 +0000 (13:43 +0000)]
[1/4] ARMv8.2-A FP16 testsuite selector

gcc/testsuite/

* target-supports.exp (add_options_for_arm_v8_2a_fp16_scalar): Mention
AArch64 support.
(add_options_for_arm_v8_2a_fp16_neon): Likewise.
(check_effective_target_arm_v8_2a_fp16_scalar_ok_nocache): Support
AArch64 targets.
(check_effective_target_arm_v8_2a_fp16_neon_ok_nocache): Support
AArch64 targets.
(check_effective_target_arm_v8_2a_fp16_scalar_hw): Support AArch64
targets.
(check_effective_target_arm_v8_2a_fp16_neon_hw): Likewise.

From-SVN: r240921

7 years agoDefine std::allocator<T>::is_always_equal
Jonathan Wakely [Mon, 10 Oct 2016 12:17:45 +0000 (13:17 +0100)]
Define std::allocator<T>::is_always_equal

* include/bits/allocator.h (allocator<T>::is_always_equal): Define.
* testsuite/20_util/allocator/requirements/typedefs.cc: Test for
is_always_equal.
* testsuite/util/testsuite_allocator.h
(uneq_allocator::is_always_equal): Define as false_type.

From-SVN: r240920

7 years agoLWG 2733, LWG 2759 reject bool in gcd and lcm
Jonathan Wakely [Mon, 10 Oct 2016 12:17:34 +0000 (13:17 +0100)]
LWG 2733, LWG 2759 reject bool in gcd and lcm

* include/experimental/numeric (gcd, lcm): Make bool arguments
ill-formed.
* include/std/numeric (gcd, lcm): Likewise.
* testsuite/26_numerics/gcd/gcd_neg.cc: New test.
* testsuite/26_numerics/lcm/lcm_neg.cc: New test.

From-SVN: r240919

7 years agore PR target/77738 (Invalid initialisation of ar.lc register)
Andreas Schwab [Mon, 10 Oct 2016 12:16:00 +0000 (12:16 +0000)]
re PR target/77738 (Invalid initialisation of ar.lc register)

PR target/77738
* config/ia64/ia64.md ("doloop_end"): Reject if mode of loop
pseudo is not DImode.

From-SVN: r240918

7 years agoAdd noexcept to enable_shared_from_this::weak_from_this
Jonathan Wakely [Mon, 10 Oct 2016 11:44:05 +0000 (12:44 +0100)]
Add noexcept to enable_shared_from_this::weak_from_this

* include/bits/shared_ptr.h (enable_shared_from_this::weak_from_this):
Add noexcept.
* include/bits/shared_ptr_base.h
(__enable_shared_from_this::weak_from_this): Likewise.
* testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc:
Test exception-specification of weak_from_this.

From-SVN: r240917

7 years ago[ARC] Disable compact casesi patterns for arcv2
Claudiu Zissulescu [Mon, 10 Oct 2016 11:39:22 +0000 (13:39 +0200)]
[ARC] Disable compact casesi patterns for arcv2

gcc/
2016-05-09  Claudiu Zissulescu  <claziss@synopsys.com>

* common/config/arc/arc-common.c (arc_option_optimization_table):
Remove compact casesi option.
* config/arc/arc.c (arc_override_options): Use compact casesi
option only for pre-ARCv2 cores.
* doc/invoke.texi (mcompact-casesi): Update text.

From-SVN: r240916

7 years agodecl.c (gnat_to_gnu_entity): Put volatile qualifier on types at the very end of the...
Eric Botcazou [Mon, 10 Oct 2016 10:09:13 +0000 (10:09 +0000)]
decl.c (gnat_to_gnu_entity): Put volatile qualifier on types at the very end of the processing.

* gcc-interface/decl.c (gnat_to_gnu_entity): Put volatile qualifier
on types at the very end of the processing.
(gnat_to_gnu_param): Remove redundant test.
(change_qualified_type): Do nothing for unconstrained array types.

From-SVN: r240915

7 years agoutils2.c (find_common_type): Do not return the LHS type if it's an array with non...
Eric Botcazou [Mon, 10 Oct 2016 09:46:10 +0000 (09:46 +0000)]
utils2.c (find_common_type): Do not return the LHS type if it's an array with non-constant lower bound and...

* gcc-interface/utils2.c (find_common_type): Do not return the LHS type
if it's an array with non-constant lower bound and the RHS type is an
array with a constant one.

From-SVN: r240913

7 years agoutils.c (convert): For a biased input type, convert the bias itself to the base type...
Eric Botcazou [Mon, 10 Oct 2016 08:47:52 +0000 (08:47 +0000)]
utils.c (convert): For a biased input type, convert the bias itself to the base type before adding it.

* gcc-interface/utils.c (convert): For a biased input type, convert
the bias itself to the base type before adding it.

From-SVN: r240910

7 years ago* config-lang.in (lang_requires_boot_languages): Delete.
Eric Botcazou [Mon, 10 Oct 2016 07:18:07 +0000 (07:18 +0000)]
* config-lang.in (lang_requires_boot_languages): Delete.

From-SVN: r240909

7 years agors6000.h (TARGET_EFFICIENT_OVERLAPPING_UNALIGNED): Add macro to say we can efficientl...
Aaron Sawdey [Mon, 10 Oct 2016 04:42:08 +0000 (04:42 +0000)]
rs6000.h (TARGET_EFFICIENT_OVERLAPPING_UNALIGNED): Add macro to say we can efficiently handle overlapping unaligned loads.

2016-10-09  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

* config/rs6000/rs6000.h (TARGET_EFFICIENT_OVERLAPPING_UNALIGNED):
Add macro to say we can efficiently handle overlapping unaligned
loads.
* config/rs6000/rs6000.c (expand_block_compare): Avoid generating
poor code for processors older than p8.

From-SVN: r240908

7 years agoDaily bump.
GCC Administrator [Mon, 10 Oct 2016 00:16:16 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r240907

7 years ago* gen-pass-instances.awk: Remove GNUism.
Eric Botcazou [Sun, 9 Oct 2016 20:50:52 +0000 (20:50 +0000)]
* gen-pass-instances.awk: Remove GNUism.

From-SVN: r240904

7 years agoipa-prop.c (ipcp_transform_function): Set fields m_vr and bits to NULL of (*ipcp_tran...
Prathamesh Kulkarni [Sun, 9 Oct 2016 18:40:09 +0000 (18:40 +0000)]
ipa-prop.c (ipcp_transform_function): Set fields m_vr and bits to NULL of (*ipcp_transformations)][node->uid].

2016-10-09  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* ipa-prop.c (ipcp_transform_function): Set fields m_vr and bits to NULL of
(*ipcp_transformations)][node->uid].

From-SVN: r240903

7 years agoPR 67585 Handle EINTR
Janne Blomqvist [Sun, 9 Oct 2016 18:05:56 +0000 (21:05 +0300)]
PR 67585 Handle EINTR

Many POSIX systems have the bad habit of not restarting interrupted
syscalls. On these systems it's up to the user to check for an error
with errno == EINTR and restart manually. This patch does this for
libgfortran, so that GFortran users don't have to do it.

2016-10-09  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/67585
        * io/io.h: TEMP_FAILURE_RETRY: Define macro if not found.
        * io/unix.c (raw_read): Handle EINTR.
        (raw_write): Check for return value -1.
        (raw_seek): Handle EINTR.
        (raw_tell): Likewise.
        (raw_size): Likewise.
        (raw_truncate): Likewise.
        (raw_close): Likewise.
        (buf_flush): Call raw_seek instead of lseek.
        (buf_read): Likewise.
        (buf_write): Likewise.
        (fd_to_stream): Handle EINTR.
        (tempfile_open): Likewise.
        (regular_file2): Likewise.
        (compare_file_filename): Likewise.
        (find_file): Likewise.
        (inquire_sequential): Likewise.
        (inquire_direct): Likewise.
        (inquire_formatted): Likewise.

From-SVN: r240902

7 years agopa.h (BIGGEST_ALIGNMENT): Adjust comment.
John David Anglin [Sun, 9 Oct 2016 17:02:21 +0000 (17:02 +0000)]
pa.h (BIGGEST_ALIGNMENT): Adjust comment.

* config/pa/pa.h (BIGGEST_ALIGNMENT): Adjust comment.
(MALLOC_ABI_ALIGNMENT): Define.

From-SVN: r240901

7 years agotree-ssa.c (target_for_debug_bind, [...]): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P...
Jakub Jelinek [Sun, 9 Oct 2016 11:19:48 +0000 (13:19 +0200)]
tree-ssa.c (target_for_debug_bind, [...]): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P macros.

* tree-ssa.c (target_for_debug_bind, verify_phi_args,
ssa_undefined_value_p, maybe_optimize_var): Use VAR_P and/or
VAR_OR_FUNCTION_DECL_P macros.
* tree-chkp.c (chkp_register_var_initializer, chkp_make_static_bounds,
chkp_get_bounds_for_decl_addr, chkp_parse_array_and_component_ref,
chkp_find_bounds_1): Likewise.
* ipa-polymorphic-call.c (decl_maybe_in_construction_p): Likewise.
* hsa-gen.c (get_symbol_for_decl): Likewise.
* cgraphunit.c (check_global_declaration, analyze_functions,
handle_alias_pairs, thunk_adjust, cgraph_node::expand_thunk):
Likewise.
* gimple-fold.c (can_refer_decl_in_current_unit_p,
canonicalize_constructor_val, gimple_get_virt_method_for_vtable):
Likewise.
* tree.c (set_decl_section_name, copy_node_stat,
need_assembler_name_p, free_lang_data_in_decl, find_decls_types_r,
merge_dllimport_decl_attributes, handle_dll_attribute,
decl_init_priority_insert, auto_var_in_fn_p, array_at_struct_end_p,
verify_type): Likewise.
* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior,
find_explicit_erroneous_behavior): Likewise.
* sdbout.c (sdbout_toplevel_data, sdbout_late_global_decl): Likewise.
* ipa.c (process_references): Likewise.
* tree-chkp-opt.c (chkp_get_check_result): Likewise.
* varasm.c (get_block_for_decl, use_blocks_for_decl_p, make_decl_rtl,
notice_global_symbol, assemble_variable, mark_decl_referenced,
build_constant_desc, output_constant_def_contents, do_assemble_alias,
make_decl_one_only, default_section_type_flags,
categorize_decl_for_section, default_encode_section_info): Likewise.
* trans-mem.c (requires_barrier): Likewise.
* gimple-expr.c (mark_addressable): Likewise.
* cfgexpand.c (add_scope_conflicts_1, expand_one_var,
expand_used_vars_for_block, clear_tree_used, stack_protect_decl_p,
expand_debug_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* ubsan.c (instrument_bool_enum_load): Likewise.
* tree-pretty-print.c (print_declaration): Likewise.
* simplify-rtx.c (delegitimize_mem_from_attrs): Likewise.
* tree-ssa-uninit.c (warn_uninitialized_vars): Likewise.
* asan.c (asan_protect_global, instrument_derefs): Likewise.
* tree-into-ssa.c (rewrite_stmt, maybe_register_def,
pass_build_ssa::execute): Likewise.
* var-tracking.c (var_debug_decl, track_expr_p): Likewise.
* tree-ssa-loop-ivopts.c (force_expr_to_var_cost, split_address_cost):
Likewise.
* ipa-split.c (test_nonssa_use, consider_split, mark_nonssa_use):
Likewise.
* tree-inline.c (insert_debug_decl_map, remap_ssa_name,
can_be_nonlocal, remap_decls, copy_debug_stmt,
initialize_inlined_parameters, add_local_variables,
reset_debug_binding, replace_locals_op): Likewise.
* dse.c (can_escape): Likewise.
* ipa-devirt.c (compare_virtual_tables, referenced_from_vtable_p):
Likewise.
* tree-diagnostic.c (default_tree_printer): Likewise.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields,
unpack_ts_decl_with_vis_value_fields,
lto_input_ts_decl_common_tree_pointers): Likewise.
* builtins.c (builtin_save_expr, fold_builtin_expect,
readonly_data_expr): Likewise.
* tree-ssa-structalias.c (new_var_info, get_constraint_for_ssa_var,
create_variable_info_for, set_uids_in_ptset, visit_loadstore):
Likewise.
* gimple-streamer-out.c (output_gimple_stmt): Likewise.
* gimplify.c (force_constant_size, gimplify_bind_expr,
gimplify_decl_expr, gimplify_var_or_parm_decl,
gimplify_compound_lval, gimplify_init_constructor,
gimplify_modify_expr, gimplify_asm_expr, gimplify_oacc_declare,
gimplify_type_sizes): Likewise.
* cgraphbuild.c (record_reference, record_type_list, mark_address,
mark_load, mark_store, pass_build_cgraph_edges::execute): Likewise.
* tree-ssa-live.c (mark_all_vars_used_1, remove_unused_scope_block_p,
remove_unused_locals): Likewise.
* tree-ssa-alias.c (ptr_deref_may_alias_decl_p, ptrs_compare_unequal,
ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Likewise.
* function.c (instantiate_expr, instantiate_decls_1,
setjmp_vars_warning, add_local_decl): Likewise.
* alias.c (ao_ref_from_mem, get_alias_set, compare_base_symbol_refs):
Likewise.
* tree-stdarg.c (find_va_list_reference, va_list_counter_struct_op,
va_list_ptr_read, va_list_ptr_write, check_all_va_list_escapes,
optimize_va_list_gpr_fpr_size): Likewise.
* tree-nrv.c (pass_nrv::execute): Likewise.
* tsan.c (instrument_expr): Likewise.
* tree-ssa-dce.c (remove_dead_stmt): Likewise.
* vtable-verify.c (verify_bb_vtables): Likewise.
* tree-dfa.c (ssa_default_def, set_ssa_default_def,
get_ref_base_and_extent): Likewise.
* toplev.c (wrapup_global_declaration_1, wrapup_global_declaration_2):
Likewise.
* tree-sra.c (static bool constant_decl_p, find_var_candidates,
analyze_all_variable_accesses): Likewise.
* tree-nested.c (get_nonlocal_debug_decl,
convert_nonlocal_omp_clauses, note_nonlocal_vla_type,
note_nonlocal_block_vlas, convert_nonlocal_reference_stmt,
get_local_debug_decl, convert_local_omp_clauses,
convert_local_reference_stmt, nesting_copy_decl, remap_vla_decls):
Likewise.
* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Likewise.
* stmt.c (decl_overlaps_hard_reg_set_p): Likewise.
* dbxout.c (dbxout_late_global_decl, dbxout_type_fields,
dbxout_symbol, dbxout_common_check): Likewise.
* expr.c (expand_assignment, expand_expr_real_2, expand_expr_real_1,
string_constant): Likewise.
* hsa.c (hsa_get_declaration_name): Likewise.
* passes.c (rest_of_decl_compilation): Likewise.
* tree-ssanames.c (make_ssa_name_fn): Likewise.
* tree-streamer-out.c (pack_ts_decl_common_value_fields,
pack_ts_decl_with_vis_value_fields,
write_ts_decl_common_tree_pointers): Likewise.
* stor-layout.c (place_field): Likewise.
* symtab.c (symtab_node::maybe_create_reference,
symtab_node::verify_base, symtab_node::make_decl_local,
symtab_node::copy_visibility_from,
symtab_node::can_increase_alignment_p): Likewise.
* dwarf2out.c (add_var_loc_to_decl, tls_mem_loc_descriptor,
decl_by_reference_p, reference_to_unused, rtl_for_decl_location,
fortran_common, add_location_or_const_value_attribute,
add_scalar_info, add_linkage_name, set_block_abstract_flags,
local_function_static, gen_variable_die, dwarf2out_late_global_decl,
optimize_one_addr_into_implicit_ptr,
optimize_location_into_implicit_ptr): Likewise.
* gimple-low.c (record_vars_into): Likewise.
* ipa-visibility.c (update_vtable_references): Likewise.
* tree-ssa-address.c (fixed_address_object_p, copy_ref_info):
Likewise.
* lto-streamer-out.c (tree_is_indexable, get_symbol_initial_value,
DFS::DFS_write_tree_body, write_symbol): Likewise.
* langhooks.c (lhd_warn_unused_global_decl,
lhd_set_decl_assembler_name): Likewise.
* attribs.c (decl_attributes): Likewise.
* except.c (output_ttype): Likewise.
* varpool.c (varpool_node::get_create, ctor_for_folding,
varpool_node::assemble_decl, varpool_node::create_alias): Likewise.
* fold-const.c (fold_unary_loc): Likewise.
* ipa-prop.c (ipa_compute_jump_functions_for_edge,
ipa_find_agg_cst_from_init): Likewise.
* omp-low.c (expand_omp_regimplify_p, expand_omp_taskreg,
expand_omp_target, lower_omp_regimplify_p,
grid_reg_assignment_to_local_var_p, grid_remap_prebody_decls,
find_link_var_op): Likewise.
* tree-chrec.c (chrec_contains_symbols): Likewise.
* tree-cfg.c (verify_address, verify_expr, verify_expr_location_1,
gimple_duplicate_bb, move_stmt_op, replace_block_vars_by_duplicates,
execute_fixup_cfg): Likewise.

From-SVN: r240900

7 years agore PR tree-optimization/77901 (ICE in tree-sse-reassoc,c:2881)
Jakub Jelinek [Sun, 9 Oct 2016 11:18:53 +0000 (13:18 +0200)]
re PR tree-optimization/77901 (ICE in tree-sse-reassoc,c:2881)

PR tree-optimization/77901
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize
if ranges[i].exp is SSA_NAME when looking for >= and only when
ranges[i].exp is NULL or SSA_NAME when looking for the other
comparison.

* gcc.c-torture/compile/pr77901.c: New test.

From-SVN: r240899

7 years agoipa-cp.c (ipcp_alignment_lattice): Remove.
Prathamesh Kulkarni [Sun, 9 Oct 2016 04:48:50 +0000 (04:48 +0000)]
ipa-cp.c (ipcp_alignment_lattice): Remove.

2016-10-09  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* ipa-cp.c (ipcp_alignment_lattice): Remove.
(ipcp_param_lattices): Remove field alignment.
(print_all_lattices): Remove call to ipcp_alignment_lattice::print.
(set_all_contains_variable): Remove call to
ipcp_alignment_lattice::set_to_bottom.
(initialize_node_lattices): Likewise.
(propagate_alignment_accross_jump_function): Remove.
(propagate_constants_accross_call): Remove call to
propagate_alignment_accross_jump_function.
(ipcp_store_alignment_results): Remove.
(ipcp_driver): Remove call to ipcp_store_alignment_results.
(propagate_bits_accross_jump_function): Handle ancestor jump function.
* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove
pretty-printing of alignment jump function.
(ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known.
(ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for
alignments and remove computing ipa_alignment jump function.
(ipa_node_params_t::duplicate): Remove copying of src_trans->alignments.
(ipa_write_jump_functions): Remove streaming for ipa_alignment.
(ipa_read_jump_function): Remove reading of ipa_alignment.
(write_ipcp_transformation_info): Remove streaming for alignment
propagation summary.
(read_ipcp_transformation_info): Remove reading of alignment
propagation summary.
(ipcp_update_alignments): Remove.
(ipcp_update_bits): Adjust to set alignment for parameters of pointer
type.
(ipcp_transform_function): Remove call to ipcp_update_alignments()
and remove assignment to (*ipcp_transformations)[node->uid].alignments.
* ipa-prop.h (ipa_alignment): Remove.
(ipa_jump_func): Remove field alignment.
(ipcp_transformation_summary): Remove field alignments.
* doc/invoke.texi: Mark fipa-cp-alignment as obsolete.
* opts.c (default_options_table): Remove entry for fipa-cp-alignment.
(enable_fdo_optimizations): Remove checking for fipa-cp-alignment.

testsuite/
* gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump.
* gcc.dg/ipa/propalign-2.c: Likewise
* gcc.dg/ipa/propalign-3.c: Likewise.
* gcc.dg/ipa/propalign-4.c: Likewise.
* gcc.dg/ipa/propalign-5.c: Likewise.

From-SVN: r240898

7 years ago* cp-gimplify.c (cp_fold): Add variable name.
Jason Merrill [Sun, 9 Oct 2016 02:41:47 +0000 (22:41 -0400)]
* cp-gimplify.c (cp_fold): Add variable name.

From-SVN: r240897

7 years agoDaily bump.
GCC Administrator [Sun, 9 Oct 2016 00:16:17 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r240896

7 years agoDelay folding of bool conversion into COND_EXPR.
Jason Merrill [Sat, 8 Oct 2016 17:40:22 +0000 (13:40 -0400)]
Delay folding of bool conversion into COND_EXPR.

gcc/c-family/
* c-common.c (c_common_truthvalue_conversion): Don't distribute
into COND_EXPR in C++.
gcc/cp/
* cp-gimplify.c (cp_fold): Distribute cp_truthvalue_conversion
into COND_EXPR.

From-SVN: r240893

7 years agosparc.h (FIXED_REGISTERS): Add %icc.
Eric Botcazou [Sat, 8 Oct 2016 17:32:46 +0000 (17:32 +0000)]
sparc.h (FIXED_REGISTERS): Add %icc.

* config/sparc/sparc.h (FIXED_REGISTERS): Add %icc.

* config/visium/visium.c (visium_expand_int_cstore): Revert latest
change.
(visium_expand_fp_cstore): Likewise.

From-SVN: r240892

7 years agodiagnostic-core.h (warning_at_rich_loc_n): Declare.
Prathamesh Kulkarni [Sat, 8 Oct 2016 17:04:35 +0000 (17:04 +0000)]
diagnostic-core.h (warning_at_rich_loc_n): Declare.

2016-10-08  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* diagnostic-core.h (warning_at_rich_loc_n): Declare.
* diagnostic.c (warning_at_rich_loc_n): New function.
(diagnostic_n_impl_richloc): Likewise.
(diagnostic_n_impl): Move most of the function to
diagnostic_n_impl_richloc and call it.

From-SVN: r240891

7 years agoutils.c (convert): Add missing break.
Eric Botcazou [Sat, 8 Oct 2016 17:04:28 +0000 (17:04 +0000)]
utils.c (convert): Add missing break.

* gcc-interface/utils.c (convert) <VECTOR_CST>: Add missing break.

Revert
2016-09-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

* gcc-interface/decl.c: Fix fall through comment formatting.
* gcc-interface/misc.c: Likewise.
* gcc-interface/trans.c: Likewise.
* gcc-interface/utils.c: Likewise.
* gcc-interface/utils2.c: Likewise.

From-SVN: r240890

7 years agoFurther P0135 refinement.
Jason Merrill [Sat, 8 Oct 2016 16:23:26 +0000 (12:23 -0400)]
Further P0135 refinement.

* call.c (build_user_type_conversion_1): Consider conversions from
a single element in an initializer-list.
(build_temp): Undo early_elide_copy change.
(build_over_call): Check that we don't try to copy a TARGET_EXPR
in C++17 mode.  Set user_conv_p here.
(convert_like_real): Not here.
(check_self_delegation): Split out from...
(build_special_member_call): ...here.  Handle C++17 copy elision.
* cvt.c (early_elide_copy): Remove.
(ocp_convert): Undo early_elide_copy change.
* except.c (build_throw): Likewise.
* init.c (expand_default_init): Likewise.
* typeck.c (cp_build_modify_expr): Likewise.

From-SVN: r240889

7 years agogen-pass-instances.awk: Rewritten.
Jakub Jelinek [Sat, 8 Oct 2016 13:50:50 +0000 (15:50 +0200)]
gen-pass-instances.awk: Rewritten.

* gen-pass-instances.awk: Rewritten.
* Makefile.in (pass-instances.def): Depend on $(PASSES_EXTRA), pass
$(PASSES_EXTRA) after passes.def to the script.
* config/i386/t-i386 (PASSES_EXTRA): Add i386-passes.def.
* config/i386/i386-passes.def: New file.
* config/i386/i386-protos.h (make_pass_insert_vzeroupper,
make_pass_stv): Declare.
* config/i386/i386.c (pass_stv::pass_stv): Initialize timode_p to
false.
(pass_stv::gate): Depending on timode_p member require TARGET_64BIT
or !TARGET_64BIT.
(pass_stv::clone, pass_stv::set_pass_param): New methods.
(pass_stv::timode_p): New non-static data member.
(ix86_option_override): Don't register passes here.

From-SVN: r240888

7 years agogen-pass-instances.awk: Rewritten.
Jakub Jelinek [Sat, 8 Oct 2016 12:04:37 +0000 (14:04 +0200)]
gen-pass-instances.awk: Rewritten.

* gen-pass-instances.awk: Rewritten.
* Makefile.in (pass-instances.def): Depend on $(PASSES_EXTRA), pass
$(PASSES_EXTRA) after passes.def to the script.
* config/i386/t-i386 (PASSES_EXTRA): Add i386-passes.def.
* config/i386/i386-passes.def: New file.
* config/i386/i386-protos.h (make_pass_insert_vzeroupper,
make_pass_stv): Declare.
* config/i386/i386.c (pass_stv::pass_stv): Initialize timode_p to
false.
(pass_stv::gate): Depending on timode_p member require TARGET_64BIT
or !TARGET_64BIT.
(pass_stv::clone, pass_stv::set_pass_param): New methods.
(pass_stv::timode_p): New non-static data member.
(ix86_option_override): Don't register passes here.

From-SVN: r240887

7 years agoinvoke.texi: Document accepting Else, fallthrough.
Jakub Jelinek [Sat, 8 Oct 2016 10:54:27 +0000 (12:54 +0200)]
invoke.texi: Document accepting Else, fallthrough.

* doc/invoke.texi: Document accepting Else, fallthrough.

* lex.c (fallthrough_comment_p): Accept Else, fallthrough.

* c-c++-common/Wimplicit-fallthrough-23.c (foo): Add further tests.

From-SVN: r240886

7 years agoinvoke.texi (-Wimplicit-fallthrough): Document FALLTHRU comment style changes.
Jakub Jelinek [Sat, 8 Oct 2016 10:53:05 +0000 (12:53 +0200)]
invoke.texi (-Wimplicit-fallthrough): Document FALLTHRU comment style changes.

* doc/invoke.texi (-Wimplicit-fallthrough): Document FALLTHRU comment
style changes.

* lex.c (fallthrough_comment_p): Extend to handle more common FALLTHRU
comment styles.

* c-c++-common/Wimplicit-fallthrough-23.c (foo): Add further tests.

From-SVN: r240885

7 years agoc-lex.c (c_lex_with_flags): For CPP_COMMENT token with PREV_FALLTHROUGH...
Jakub Jelinek [Sat, 8 Oct 2016 10:48:54 +0000 (12:48 +0200)]
c-lex.c (c_lex_with_flags): For CPP_COMMENT token with PREV_FALLTHROUGH...

* c-lex.c (c_lex_with_flags) <case CPP_COMMENT>: For CPP_COMMENT
token with PREV_FALLTHROUGH, skip all following CPP_PADDING and
CPP_COMMENT tokens and set add_flags to PREV_FALLTHROUGH afterwards.

* doc/invoke.texi (-Wimplicit-fallthrough): Document the accepted
FALLTHRU comment styles.

* lex.c (fallthrough_comment_p): Fix off-by-one size comparison
errors, cleanup.
(_cpp_lex_direct): Allow arbitrary comments in between
fallthrough_comment_p comment and following token.

* c-c++-common/Wimplicit-fallthrough-23.c: New test.
* c-c++-common/Wimplicit-fallthrough-24.c: New test.

From-SVN: r240884

7 years agoDaily bump.
GCC Administrator [Sat, 8 Oct 2016 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r240882

7 years agoaarch64-arches.def (AARCH64_ARCH): #undef at the end.
Andrew Pinski [Fri, 7 Oct 2016 21:36:41 +0000 (21:36 +0000)]
aarch64-arches.def (AARCH64_ARCH): #undef at the end.

2016-10-07  Andrew Pinski  <apinski@cavium.com>

        * config/aarch64/aarch64-arches.def (AARCH64_ARCH): #undef at the end.
        * config/aarch64/aarch64-cores.def (AARCH64_CORE): Likewise.
        * config/aarch64/aarch64-fusion-pairs.def (AARCH64_FUSION_PAIR): Likewise.
        * config/aarch64/aarch64-option-extensions.def (AARCH64_OPT_EXTENSION): Likewise.
        * config/aarch64/aarch64-tuning-flags.def (AARCH64_EXTRA_TUNING_OPTION): Likewise.
        * config/aarch64/aarch64-opts.h (AARCH64_CORE): Don't #undef here.
        (AARCH64_ARCH): Likewise.
        * common/config/aarch64/aarch64-common.c (AARCH64_OPT_EXTENSION): Likewise.
        (AARCH64_CORE): Likewise.
        (AARCH64_ARCH): Likewise.
        * config/aarch64/aarch64-protos.h (AARCH64_FUSION_PAIR): Likewise.
        (AARCH64_EXTRA_TUNING_OPTION): Likewise.
        * config/aarch64/aarch64.c (AARCH64_FUION_PAIR): Likewise.
        (AARCH64_EXTRA_TUNING_OPTION): Likewise.
        (AARCH64_ARCH): Likewise.
        (AARCH64_CORE): Likewise.
        * config/aarch64/aarch64.h (AARCH64_CORE): Likewise.
        * config/aarch64/driver-aarch64.c (AARCH64_OPT_EXTENSION): Likewise.
        (AARCH64_CORE): Likewise.
        (AARCH64_ARCH): Likewise.

From-SVN: r240876

7 years agoFix ICE due to map typespecs with different sized charlens being copied.
Fritz Reese [Fri, 7 Oct 2016 21:25:16 +0000 (21:25 +0000)]
Fix ICE due to map typespecs with different sized charlens being copied.

2016-10-07  Fritz Reese  <fritzoreese@gmail.com>

Fix ICE due to map typespecs with different sized charlens being copied.

gcc/fortran/
* interface.c (compare_components): Check charlen for BT_CHAR.

gcc/testsuite/gfortran.dg/
* dec_union_11.f90: New testcase.

From-SVN: r240875

7 years agore PR c++/64433 (Segmentation fault while compiling)
Nathan Sidwell [Fri, 7 Oct 2016 20:01:17 +0000 (20:01 +0000)]
re PR c++/64433 (Segmentation fault while compiling)

cp/
PR c++/64433
DR1658, DR1611
* init.c (emit_mem_initializers): Don't construct vbases of
abstract classes.
(push_base_cleanups): Don't push vbase cleanups for abstract class
when in C++14 mode.
* method.c (synthethesized_method_walk): Don't walk vbases of
abstract classes when in C++14 mode.

testsuite/
PR c++/66443
* g++.dg/cpp0x/pr66443-cxx11.C: New.
* g++.dg/cpp0x/pr66443-cxx11-2.C: New.
* g++.dg/cpp1y/pr66443-cxx14.C: New
* g++.dg/cpp1y/pr66443-cxx14-2.C: New.
* g++.dg/cpp1y/pr66443-cxx14-3.C: New.

From-SVN: r240874

7 years agoImplement LWG2296 helper intrinsic c-family/
Jakub Jelinek [Fri, 7 Oct 2016 19:37:46 +0000 (21:37 +0200)]
Implement LWG2296 helper intrinsic c-family/

Implement LWG2296 helper intrinsic
c-family/
* c-common.h (enum rid): Add RID_ADDRESSOF.
* c-common.c (c_common_reswords): Add __builtin_addressof.
cp/
* parser.c (cp_parser_postfix_expression): Handle RID_ADDRESSOF.
* cp-objcp-common.c (cp_common_init_ts): Handle ADDRESSOF_EXPR.
* constexpr.c (potential_constant_expression_1): Likewise.
* error.c (dump_expr): Likewise.
* typeck.c (cp_build_addressof): New function.
* cp-tree.h (cp_build_addressof): Declare.
* cxx-pretty-print.h (pp_cxx_addressof_expression): Declare.
* cp-tree.def (ADDRESSOF_EXPR): New tree code.
* cxx-pretty-print.c (cxx_pretty_printer::primary_expression): Handle
ADDRESSOF_EXPR.  Add __builtin_addressof and
__has_unique_object_representations into syntax in function comment.
(pp_cxx_addressof_expression): New function.
* pt.c (tsubst_copy_and_build): Handle ADDRESSOF_EXPR.
testsuite/
* g++.dg/cpp0x/addressof1.C: New test.
* g++.dg/cpp0x/addressof2.C: New test.

From-SVN: r240873

7 years agors6000-c.c (rs6000_cpu_cpp_builtins): Split -mfloat128 into -mfloat128-type that...
Michael Meissner [Fri, 7 Oct 2016 18:58:10 +0000 (18:58 +0000)]
rs6000-c.c (rs6000_cpu_cpp_builtins): Split -mfloat128 into -mfloat128-type that enables the IEEE 128-bit floating...

[gcc]
2016-10-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Split
-mfloat128 into -mfloat128-type that enables the IEEE 128-bit
floating point type infrastructre, and -mfloat128 that enables the
keyword.  Define __FLOAT128__ if -mfloat128, and __FLOAT128_TYPE__
if -mfloat128-type.  Define __ibm128 to be long double by default.
* config/rs6000/rs6000.c (rs6000_debug_reg_global): Print whether
the IEEE 128-bit floating point type infrastructure should
automatically be enabled.
(rs6000_init_hard_regno_mode_ok): Switch to use -mfloat128-type
instead of -mfloat128 to enable KFmode.
(rs6000_option_override_internal): Split the option -mfloat128
into -mfloat128-type and -mfloat128.  On Linux PowerPC 64-bit
systems, automatically set -mfloat128-type, but don't enable it on
other operating systems.  Move setting the long double size and
IEEE quad support before the IEEE 128-bit floating point changes.
(rs6000_init_builtins): Do not create a unique type for __ibm128
if long double is IBM extended double, instead rely on __ibm128
being defined as 'long double'.  If -mfloat128-type and not
-mfloat128, create the KFmode type with an undocumented __ieee128
keyword.
(rs6000_init_libfuncs): Use -mfloat128-type instead of
-mfloat128 for tests about the types, but keep tests for
-mfloat128 to enable the keyword support.
(rs6000_complex_function_value): Likewise.
(rs6000_scalar_mode_supported_p): Likewise.
(rs6000_floatn_mode): Likewise.
(rs6000_c_mode_for_suffix): Likewise.
(rs6000_opt_masks): Add -mfloat128-type.
* config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Add support for
-mfloat128-type being split from -mfloat128.  Add
-mfloat128-hardware, which was missing.
* config/rs6000/rs6000.opt (-mfloat128): Split -mfloat128 into
-mfloat128 and -mfloat128-type:
(-mfloat128-type): Likewise.
* config/rs6000/linux64.h (TARGET_FLOAT128_ENABLE_TYPE): Define so
that 64-bit Linux systems with enable -mfloat128-type by default
on VSX systems.
* config/rs6000/rs6000.h (TARGET_FLOAT128_ENABLE_TYPE): Likewise.
(FLOAT128_VECTOR_P): Switch IEEE 128-bit floating points to use
-mfloat128-type instead of -mfloat128.
(FLOAT128_2REG_P): Likewise.
(MASK_FLOAT128_TYPE): Likewise.
(ALTIVEC_ARG_MAX_RETURN): Likewise.
(RS6000_BTM_FLOAT128): Likewise.
(TARGET_FLOAT128): Poison old identifiers.
(OPTION_MASK_FLOAT128): Likewise.
(MASK_FLOAT128): Likewise.
* config/rs6000/rs6000.md (FP): Likewise.
(FLOAT128): Likewise.
(fix_trunc<mode>di2): Likewise.
(fixuns_trunc<IEEE128:mode><SDI:mode>2): Likewise.
(floatdi<mode>2): Likewise.
(floatuns<SDI:mode><IEEE128:mode>2): Likewise.
(neg<mode>2, FLOAT128 iterator): Likewise.
(abs<mode>2, FLOAT128 iterator): Likewise.
(ieee_128bit_negative_zero): Likewise.
(ieee_128bit_vsx_neg<mode>2): Likewise.
(ieee_128bit_vsx_neg<mode>2_internal): Likewise.
(ieee_128bit_vsx_abs<mode>2): Likewise.
(ieee_128bit_vsx_abs<mode>2_internal): Likewise.
(ieee_128bit_vsx_nabs<mode>2): Likewise.
(ieee_128bit_vsx_nabs<mode>2_internal): Likewise.
(extendiftf2): Likewise.
(extendifkf2): Likewise.
(extendtfkf2): Likewise.
(trunciftf2): Likewise.
(truncifkf2): Likewise.
(trunckftf2): Likewise.
(trunctfif2): Likewise.
(extendkftf2): Likewise.
(trunctfkf2): Likewise.

[gcc/testsuite]
2016-10-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

* gcc.target/powerpc/float128-type-1.c: New test to check that
PowerPC 64-bit Linux enables -mfloat128-type by default.
* gcc.target/powerpc/float128-type-2.c: Likewise.
* gcc.target/powerpc/float128-mix.c: Change error message to
reflect that __ibm128 is now #define'ed to be long double.

From-SVN: r240872

7 years agore PR fortran/77406 (ICE in generic_correspondence, at fortran/interface.c:1123)
Steven G. Kargl [Fri, 7 Oct 2016 18:18:03 +0000 (18:18 +0000)]
re PR fortran/77406 (ICE in generic_correspondence, at fortran/interface.c:1123)

2016-10-07  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/77406
* interface.c (gfc_compare_interfaces): Fix detection of ambiguous
interface involving alternate return.
(check_interface1): Improve error message and loci.

2016-10-07  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/77406
* gfortran.dg/pr77406.f90: New test.
* gfortran.dg/assumed_type_3.f90: Update error messages.
* gfortran.dg/defined_operators_1.f90: Ditto.
* gfortran.dg/generic_26.f90: Ditto.
* gfortran.dg/generic_7.f90: Ditto.
* gfortran.dg/gomp/udr5.f90: Ditto.
* gfortran.dg/gomp/udr7.f90: Ditto.
* gfortran.dg/interface_1.f90: Ditto.
* gfortran.dg/interface_37.f90: Ditto.
* gfortran.dg/interface_5.f90: Ditto.
* gfortran.dg/interface_6.f90: Ditto.
* gfortran.dg/interface_7.f90
* gfortran.dg/no_arg_check_3.f90
* gfortran.dg/operator_5.f90
* gfortran.dg/proc_ptr_comp_20.f90: Ditto.

From-SVN: r240870

7 years agoImprove implementation-defined docs for libstdc++
Jonathan Wakely [Fri, 7 Oct 2016 18:02:53 +0000 (19:02 +0100)]
Improve implementation-defined docs for libstdc++

* doc/xml/manual/status_cxx1998.xml: Improve documentation of
implementation-defined properties.
* doc/xml/manual/status_cxx2011.xml: Likewise.
* doc/xml/manual/status_cxx2017.xml: Likewise.

From-SVN: r240869

7 years agoImplement std::has_unique_object_representations
Jonathan Wakely [Fri, 7 Oct 2016 18:02:43 +0000 (19:02 +0100)]
Implement std::has_unique_object_representations

* doc/xml/manual/status_cxx2017.xml: Update status.
* include/std/type_traits (has_unique_object_representations): Define.
* testsuite/20_util/has_unique_object_representations/value.cc: New.
* testsuite/20_util/has_unique_object_representations/requirements/
explicit_instantiation.cc: New.
* testsuite/20_util/has_unique_object_representations/requirements/
typedefs.cc: New.

From-SVN: r240868

7 years agore PR c++/77700 (suspicios code in cp/parser.c)
Bernd Edlinger [Fri, 7 Oct 2016 17:10:38 +0000 (17:10 +0000)]
re PR c++/77700 (suspicios code in cp/parser.c)

2016-10-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77700
        * c-common.c (c_common_truthvalue_conversion): Warn also for
        suspicious enum values in boolean context.

cp:
2016-10-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77700
        * parser.c (cp_parser_base_specifier): Fix a warning.

testsuite:
2016-10-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77700
        * c-c++-common/Wint-in-bool-context.c: Update test.

From-SVN: r240867

7 years ago[simplify-rtx] Zero-initialise local array in simplify_immed_subreg
Kyrylo Tkachov [Fri, 7 Oct 2016 14:47:55 +0000 (14:47 +0000)]
[simplify-rtx] Zero-initialise local array in simplify_immed_subreg

* simplify-rtx.c (simplify_immed_subreg): Zero-initialize tmp array
before merging in bytes to pass down to real_from_target.

From-SVN: r240866

7 years agotree-ssa-propagate.c (replace_phi_args_in): Remove no longer required hack.
Richard Biener [Fri, 7 Oct 2016 13:47:40 +0000 (13:47 +0000)]
tree-ssa-propagate.c (replace_phi_args_in): Remove no longer required hack.

2016-10-07  Richard Biener  <rguenther@suse.de>

* tree-ssa-propagate.c (replace_phi_args_in): Remove no longer
required hack.
(substitute_and_fold_dom_walker::before_dom_children):
Substitute and fold before pass specific folding to avoid
feeding that with SSA names that will be later released.
* tree-ssa-ccp.c (get_value_for_expr): Guard for new SSA names
introduced by folding and visited by evaluate_stmt called during
ccp_fold_stmt.
(likely_value): Likewise.
(evaluate_stmt): Likewise.
* tree-vrp.c (simplify_truth_ops_using_ranges): Fold modified stmt.
(simplify_div_or_mod_using_ranges): Likewise.
(simplify_min_or_max_using_ranges): Likewise.
(simplify_abs_using_ranges): Likewise.
(simplify_conversion_using_ranges): Likewise.
(simplify_float_conversion_using_ranges): Likewise.
(simplify_stmt_using_ranges): Likewise.

* gcc.dg/tree-ssa/vrp01.c: Adjust.
* gcc.dg/tree-ssa/vrp34.c: Likewise.

From-SVN: r240865

7 years agogimplify.c (should_warn_for_implicit_fallthrough): Check for FALLTHROUGH_LABEL_P...
Marek Polacek [Fri, 7 Oct 2016 12:44:54 +0000 (12:44 +0000)]
gimplify.c (should_warn_for_implicit_fallthrough): Check for FALLTHROUGH_LABEL_P here...

* gimplify.c (should_warn_for_implicit_fallthrough): Check for
FALLTHROUGH_LABEL_P here...
(warn_implicit_fallthrough_r): ...not here.

* c-c++-common/Wimplicit-fallthrough-22.c: New test.

From-SVN: r240864

7 years agore PR c++/69733 (-Wignored-qualifiers points to wrong const)
Bernd Schmidt [Fri, 7 Oct 2016 12:21:55 +0000 (12:21 +0000)]
re PR c++/69733 (-Wignored-qualifiers points to wrong const)

c/
PR c++/69733
* c-decl.c (smallest_type_quals_location): New static function.
(grokdeclarator): Try to find the correct location for an ignored
qualifier.
cp/
PR c++/69733
* decl.c (grokdeclarator): Try to find the correct location for an
ignored qualifier.
testsuite/
PR c++/69733
* c-c++-common/pr69733.c: New test.
* gcc.dg/pr69733.c: New test.
* gcc.target/i386/pr69733.c: New test.

From-SVN: r240863

7 years agore PR tree-optimization/77880 (out of memory building recent LLVM on ppc64le with...
Bernd Schmidt [Fri, 7 Oct 2016 12:16:55 +0000 (12:16 +0000)]
re PR tree-optimization/77880 (out of memory building recent LLVM on ppc64le with -O3)

PR tree-optimization/77880
* expr.c (by_pieces_ninsns): Use unsigned HOST_WIDE_INT where
necessary.

From-SVN: r240862

7 years agore PR c++/77803 (Bogus implicit-fallthrough warning)
Marek Polacek [Fri, 7 Oct 2016 11:45:50 +0000 (11:45 +0000)]
re PR c++/77803 (Bogus implicit-fallthrough warning)

PR c++/77803
* gimplify.c (last_stmt_in_scope): Add check for FALLTHROUGH ().

* g++.dg/warn/Wimplicit-fallthrough-1.C: New test.

From-SVN: r240861

7 years agobitmap.h: Document constraints on bitmap modification while iterating over it.
Richard Biener [Fri, 7 Oct 2016 11:26:15 +0000 (11:26 +0000)]
bitmap.h: Document constraints on bitmap modification while iterating over it.

2016-10-07  Richard Biener  <rguenther@suse.de>

* bitmap.h: Document constraints on bitmap modification while
iterating over it.

From-SVN: r240860

7 years agobitmap.c (bitmap_elem_to_freelist): Set indx to -1.
Richard Biener [Fri, 7 Oct 2016 10:06:24 +0000 (10:06 +0000)]
bitmap.c (bitmap_elem_to_freelist): Set indx to -1.

2016-10-07  Richard Biener  <rguenther@suse.de>

* bitmap.c (bitmap_elem_to_freelist): Set indx to -1.
* bitmap.h (bmp_iter_set): When advancing to the next element
check that we didn't remove the current one.
(bmp_iter_and): Likewise.
(bmp_iter_and_compl): Likewise.
* tree-ssa.c (release_defs_bitset): Do not remove worklist bit
we currently iterate on but keep a one-level queue.
* sched-deps.c (remove_from_deps): Do not clear current bit
but keep a one-level queue.

From-SVN: r240859

7 years agore PR tree-optimization/77664 (Missed optimization: signed int >= 0 && < unsigned...
Jakub Jelinek [Fri, 7 Oct 2016 09:33:47 +0000 (11:33 +0200)]
re PR tree-optimization/77664 (Missed optimization: signed int >= 0 && < unsigned short)

PR tree-optimization/77664
* tree-ssa-reassoc.c (update_range_test): Also clear low and high
for the other ranges.
(optimize_range_tests_diff): Fix up formatting.
(optimize_range_tests_var_bound): New function.
(optimize_range_tests): Use it.

* gcc.dg/tree-ssa/pr77664.c: New test.
* gcc.dg/pr77664.c: New test.

From-SVN: r240858

7 years agoReally set priority to 99 for __gcov_exit
Martin Liska [Fri, 7 Oct 2016 09:24:20 +0000 (11:24 +0200)]
Really set priority to 99 for __gcov_exit

* coverage.c (build_gcov_exit_decl): Fix priority what
should be really 99.

From-SVN: r240857

7 years agoFix profiled bootstrap (part 2)
Martin Liska [Fri, 7 Oct 2016 08:34:49 +0000 (10:34 +0200)]
Fix profiled bootstrap (part 2)

* lambda.c (maybe_add_lambda_conv_op): Set default value.

From-SVN: r240856

7 years agogimple-low.c (lower_gimple_bind): Clear DECL_CHAIN of vars in gimple_bind_vars but...
Richard Biener [Fri, 7 Oct 2016 07:47:38 +0000 (07:47 +0000)]
gimple-low.c (lower_gimple_bind): Clear DECL_CHAIN of vars in gimple_bind_vars but not in BLOCK_VARS.

2016-10-07  Richard Biener  <rguenther@suse.de>

* gimple-low.c (lower_gimple_bind): Clear DECL_CHAIN of
vars in gimple_bind_vars but not in BLOCK_VARS.

From-SVN: r240855

7 years agore PR tree-optimization/77879 (mpd gets miscompiled since r235622)
Richard Biener [Fri, 7 Oct 2016 07:44:47 +0000 (07:44 +0000)]
re PR tree-optimization/77879 (mpd gets miscompiled since r235622)

2016-10-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/77879
* tree-ssa-structalias.c (handle_const_call): Properly handle
NRV return slots.
(handle_pure_call): Likewise.

From-SVN: r240854

7 years agocompiler: stack allocate storage for temp slices.
Ian Lance Taylor [Fri, 7 Oct 2016 04:14:35 +0000 (04:14 +0000)]
compiler: stack allocate storage for temp slices.

    During the lowering phase, the variable arguments to a varargs call are
    packaged up into a temporary slice object; the storage for this slice
    was being unconditionally allocated on the heap.  Heap allocation is not
    necessary, however, if the varargs call correspond to an "append", since
    the append runtime routine only reads the slice storage (as opposed to
    stashing away the storage pointer). Enhance the lowering code to keep
    the slice storage on the stack for append() calls, to improve
    performance.

    Addresses issue golang/go#17304.

    Reviewed-on: https://go-review.googlesource.com/30136

From-SVN: r240853

7 years ago2016-10-06 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
Aaron Sawdey [Fri, 7 Oct 2016 04:12:00 +0000 (04:12 +0000)]
2016-10-06  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

* config/rs6000/rs6000.c (rs6000_elf_asm_out_constructor)
(rs6000_elf_asm_out_destructor): increase size of buf to avoid
possible overflow.

From-SVN: r240852

7 years ago[multiple changes]
Louis Krupp [Fri, 7 Oct 2016 02:24:40 +0000 (02:24 +0000)]
[multiple changes]

2016-10-06  Louis Krupp <louis.krupp@zoho.com>

* gfortran.dg/pr69955.f90: New test.

2016-10-06  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/69955
* trans-array.c (gfc_conv_expr_descriptor): Don't allocate
components if it's not necessary.

From-SVN: r240851

7 years ago2016_10-06 Louis Krupp <louis.krupp@zoho.com>
Louis Krupp [Fri, 7 Oct 2016 02:02:13 +0000 (02:02 +0000)]
2016_10-06  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/57910
* gfortran.dg/pr57910.f90: New test.

2016-10-05  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/57910
* trans-expr.c (gfc_add_interface_mapping): Don't try to
dereference call-by-value scalar argument

From-SVN: r240850

7 years agoDaily bump.
GCC Administrator [Fri, 7 Oct 2016 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r240849

7 years agoaarch64-cores.def: Add a comment before each set of cores.
Andrew Pinski [Thu, 6 Oct 2016 22:49:58 +0000 (22:49 +0000)]
aarch64-cores.def: Add a comment before each set of cores.

2016-10-06  Andrew Pinski  <apinski@cavium.com>

        * config/aarch64/aarch64-cores.def: Add a comment before each
        set of cores.

From-SVN: r240846

7 years agoC++17 copy elision improvements.
Jason Merrill [Thu, 6 Oct 2016 21:24:40 +0000 (17:24 -0400)]
C++17 copy elision improvements.

* call.c (build_temp, convert_like_real): Don't re-copy
TARGET_EXPR.  Handle packed fields.
(build_x_va_arg): Wrap it in a TARGET_EXPR.
(build_over_call): Add sanity check.
* cvt.c (early_elide_copy): New.
(ocp_convert): Use it.
* except.c (build_throw): Use it.
* init.c (get_nsdmi): Put back the TARGET_EXPR.
(expand_default_init): Call early_elide_copy.
* typeck.c (cp_build_modify_expr): Call early_elide_copy.

From-SVN: r240845

7 years agoMake std::scoped_allocator_adaptor's OUTERMOST recursive
Jonathan Wakely [Thu, 6 Oct 2016 21:22:35 +0000 (22:22 +0100)]
Make std::scoped_allocator_adaptor's OUTERMOST recursive

* doc/xml/manual/status_cxx2011.xml: Update status.
* include/std/scoped_allocator (__outer_allocator_t, __outermost_type):
New helpers for recursive OUTERMOST.
(__outermost): Use __outermost_type::_S_outermost.
(__do_outermost, scoped_allocator_adaptor::__outermost_type): Remove.
(scoped_allocator_adaptor::__outermost_alloc_traits): Use new
__outermost_type helper.
* testsuite/20_util/scoped_allocator/outermost.cc: New test.

From-SVN: r240844

7 years agoImplement P0258R2 - helper for C++17 std::has_unique_object_representations trait...
Jakub Jelinek [Thu, 6 Oct 2016 21:17:44 +0000 (23:17 +0200)]
Implement P0258R2 - helper for C++17 std::has_unique_object_representations trait c-family/

Implement P0258R2 - helper for C++17
std::has_unique_object_representations trait
c-family/
* c-common.h (enum rid): Add RID_HAS_UNIQUE_OBJ_REPRESENTATIONS.
* c-common.c (c_common_reswords): Add
__has_unique_object_representations.
cp/
* cp-tree.h (enum cp_trait_kind): Add
CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS.
(struct lang_type_class): Add unique_obj_representations
and unique_obj_representations_set bitfields.
(CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS,
CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS_SET): Define.
(type_has_unique_obj_representations): Declare.
* parser.c (cp_parser_primary_expression): Handle
RID_HAS_UNIQUE_OBJ_REPRESENTATIONS.
(cp_parser_trait_expr): Likewise.  Formatting fix.
* semantics.c (trait_expr_value, finish_trait_expr): Handle
CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS.
* tree.c (type_has_unique_obj_representations): New function.
(record_has_unique_obj_representations): New function.
* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS.
testsuite/
* g++.dg/cpp1z/has-unique-obj-representations1.C: New test.
* g++.dg/cpp1z/has-unique-obj-representations2.C: New test.

From-SVN: r240843

7 years agore PR tree-optimization/77862 (ice in add_equivalence)
Kugan Vivekanandarajah [Thu, 6 Oct 2016 19:58:46 +0000 (19:58 +0000)]
re PR tree-optimization/77862 (ice in add_equivalence)

Fix PR77862
gcc/testsuite/ChangeLog:

2016-10-06  Kugan Vivekanandarajah  <kuganv@linaro.org>

PR tree-optimization/77862
* gcc.dg/pr77862.c: New test.

gcc/ChangeLog:

2016-10-06  Kugan Vivekanandarajah  <kuganv@linaro.org>

PR tree-optimization/77862
* tree-vrp.c (add_equivalence): Use get_value_range so that
num_vr_values is checked before accessing vr_values.

From-SVN: r240842

7 years agoHandle POINTER_TYPE_P in EVRP
Kugan Vivekanandarajah [Thu, 6 Oct 2016 19:55:14 +0000 (19:55 +0000)]
Handle POINTER_TYPE_P in EVRP

Handle POINTER_TYPE_P in EVRP
gcc/ChangeLog:

2016-10-06  Kugan Vivekanandarajah  <kuganv@linaro.org>

* tree-vrp.c (evrp_dom_walker::before_dom_children): Handle
  POINTER_TYPE_P.

gcc/testsuite/ChangeLog:

2016-10-06  Kugan Vivekanandarajah  <kuganv@linaro.org>

* gcc.dg/tree-ssa/evrp4.c: New test.

From-SVN: r240841

7 years agogo-gcc.cc (Gcc_backend::stack_allocation_expression): Clear the returned memory.
Chris Manghane [Thu, 6 Oct 2016 19:24:04 +0000 (19:24 +0000)]
go-gcc.cc (Gcc_backend::stack_allocation_expression): Clear the returned memory.

* go-gcc.cc (Gcc_backend::stack_allocation_expression): Clear the
returned memory.

From-SVN: r240840

7 years agore PR tree-optimization/71661 (wrong code at -O3)
Jeff Law [Thu, 6 Oct 2016 16:23:22 +0000 (10:23 -0600)]
re PR tree-optimization/71661 (wrong code at -O3)

PR tree-optimization/71661
* tree-cfgcleanup.c (remove_forwarder_block_with_phi): Handle case when
removal of a forwarder exposes a new natural loop.

PR tree-optimization/71661
* gcc.dg/tree-ssa/pr71661.c: New test.

From-SVN: r240836

7 years ago* config/i386/i386.c (ix86_add_stmt_cost): Simplify condition.
Uros Bizjak [Thu, 6 Oct 2016 14:57:41 +0000 (16:57 +0200)]
* config/i386/i386.c (ix86_add_stmt_cost): Simplify condition.

From-SVN: r240835

7 years agosse.md (andnot<mode>3): Add FALLTHRU comments.
Uros Bizjak [Thu, 6 Oct 2016 14:56:34 +0000 (16:56 +0200)]
sse.md (andnot<mode>3): Add FALLTHRU comments.

* config/i386/sse.md (andnot<mode>3): Add FALLTHRU comments.
Introduce ssesuffix variable.
(<mask_codefor><code><mode>3<mask_name>): Ditto.
(*<code><mode>3): Ditto.

From-SVN: r240834

7 years agopostreload.c (reload_cse_simplify): Skip also USE when detecting noop move.
Jan Hubicka [Thu, 6 Oct 2016 13:45:45 +0000 (15:45 +0200)]
postreload.c (reload_cse_simplify): Skip also USE when detecting noop move.

* postreload.c (reload_cse_simplify): Skip also USE when detecting
noop move.

From-SVN: r240833

7 years agore PR tree-optimization/77855 (wrong code at -O3 on x86_64-linux-gnu (in both 32...
Richard Biener [Thu, 6 Oct 2016 12:17:53 +0000 (12:17 +0000)]
re PR tree-optimization/77855 (wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes))

2016-10-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

From-SVN: r240832

7 years agore PR target/77759 (ICE in function_arg_record_value on nested empty class)
James Clarke [Thu, 6 Oct 2016 10:28:23 +0000 (10:28 +0000)]
re PR target/77759 (ICE in function_arg_record_value on nested empty class)

PR target/77759
* config/sparc/sparc.c (classify_data_t): Remove int_regs field.
(classify_registers): Don't set it
(function_arg_slotno): Don't initialize and test it.  Tidy up.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
From-SVN: r240830

7 years agore PR tree-optimization/77839 (Memory- and compile time hog at -O1 and above)
Richard Biener [Thu, 6 Oct 2016 08:54:37 +0000 (08:54 +0000)]
re PR tree-optimization/77839 (Memory- and compile time hog at -O1 and above)

2016-10-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/77839
* tree-ssa-sccvn.c (set_ssa_val_to): Forbid value -> constant value
lattice transition.

* gcc.dg/torture/pr77839.c: New testcase.

From-SVN: r240829

7 years agoAdd -fprofile-update option juggling
Martin Liska [Thu, 6 Oct 2016 07:34:23 +0000 (09:34 +0200)]
Add -fprofile-update option juggling

* gcc.c: Set -fprofile-update=atomic when profiling is
enabled and -pthread is set.  Warn when one combines
-pthread and -fprofile-update=single for an app using
profiling code.

From-SVN: r240828

7 years agoFix warnings for make profiledbootstrap (PR bootstrap/77788)
Martin Liska [Thu, 6 Oct 2016 07:33:49 +0000 (09:33 +0200)]
Fix warnings for make profiledbootstrap (PR bootstrap/77788)

PR bootstrap/77788
* expmed.h (mul_highpart_cost_ptr): Add an gcc_assert.
* gimple-ssa-strength-reduction.c (slsr_process_cast):
Initialize a pointer to NULL.
(slsr_process_copy): Likewise.
* input.c (location_get_source_line): Likewise.
* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.

From-SVN: r240827

7 years agoescape: Avoid allocation of varargs parameter.
Ian Lance Taylor [Thu, 6 Oct 2016 03:51:03 +0000 (03:51 +0000)]
escape: Avoid allocation of varargs parameter.

    There was a bug in the escape analysis that would cause
    the slice implicitly created to hold varargs parameters to always
    escape, as well as the appended to slice argument.  The intended
    behavior was that the elements of the appendee and appended to
    slice would escape to the heap.  Alongside of these issues,
    the varargs slice would also have a chance to be initialized to an
    invalid memory location if it were stack-allocated.  This has been
    fixed as well.

    Reviewed-on: https://go-review.googlesource.com/30450

From-SVN: r240826

7 years ago* g++.dg/cpp1z/init-statement9.C: New test.
Marek Polacek [Thu, 6 Oct 2016 00:25:29 +0000 (00:25 +0000)]
* g++.dg/cpp1z/init-statement9.C: New test.

From-SVN: r240824

7 years agoDaily bump.
GCC Administrator [Thu, 6 Oct 2016 00:16:17 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r240823

7 years agoImplement P0135R1, Guaranteed copy elision.
Jason Merrill [Wed, 5 Oct 2016 22:59:02 +0000 (18:59 -0400)]
Implement P0135R1, Guaranteed copy elision.

* cvt.c (ocp_convert): Don't re-copy a TARGET_EXPR in C++17.

From-SVN: r240820

7 years agoPR c++/54293 - binding reference to member of temporary
Jason Merrill [Wed, 5 Oct 2016 22:58:55 +0000 (18:58 -0400)]
PR c++/54293 - binding reference to member of temporary

* call.c (reference_binding): Fix binding to member of temporary.

From-SVN: r240819

7 years ago* call.c (extend_ref_init_temps): Fix TARGET_EXPR handling.
Jason Merrill [Wed, 5 Oct 2016 22:57:58 +0000 (18:57 -0400)]
* call.c (extend_ref_init_temps): Fix TARGET_EXPR handling.

From-SVN: r240818

7 years agoDelete x86 deprecated pcommit instruction support
Andrew Senkevich [Wed, 5 Oct 2016 22:08:48 +0000 (22:08 +0000)]
Delete x86 deprecated pcommit instruction support

Delete x86 pcommit instruction support, which has been deprecated:

https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction

gcc/

* common/config/i386/i386-common.c (OPTION_MASK_ISA_PCOMMIT_UNSET,
OPTION_MASK_ISA_PCOMMIT_SET): Deleted definitions.
(ix86_handle_option): Deleted handle of OPT_mpcommit.
* config.gcc: Deleted pcommitintrin.h
* config/i386/pcommitintrin.h: Deleted file.
* config/i386/cpuid.h (bit_PCOMMIT): Deleted.
* config/i386/driver-i386.c (host_detect_local_cpu): Deleted pcommit
detection.
* config/i386/i386-c.c (ix86_target_macros_internal): Deleted define
__PCOMMIT__.
* config/i386/i386.c (ix86_target_string): Deleted -mpcommit.
(PTA_PCOMMIT): Deleted define.
(ix86_option_override_internal): Deleted handle of option.
(ix86_valid_target_attribute_inner_p): Deleted pcommit.
* config/i386/i386-builtin.def (IX86_BUILTIN_PCOMMIT,
__builtin_ia32_pcommit): Deleted.
* config/i386/i386.h (TARGET_PCOMMIT, TARGET_PCOMMIT_P): Deleted.
* config/i386/i386.md (unspecv): Deleted UNSPECV_PCOMMIT.
(pcommit): Deleted instruction.
* config/i386/i386.opt: Mention -mpcommit deprecation.
* config/i386/x86intrin.h: Deleted inclusion of pcommitintrin.h.

gcc/testsuite/

* gcc.target/i386/pcommit-1.c: Deleted.
* gcc.target/i386/sse-12.c: Deleted -pcommit option.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-14.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* g++.dg/other/i386-2.C: Ditto.

From-SVN: r240816

7 years agopr77833.c: Require int128 effective target.
Uros Bizjak [Wed, 5 Oct 2016 22:06:37 +0000 (00:06 +0200)]
pr77833.c: Require int128 effective target.

* gcc.target/i386/pr77833.c: Require int128 effective target.

From-SVN: r240815

7 years agore PR target/77874 (two problems with gcc.target/i386/avx-1.c)
Uros Bizjak [Wed, 5 Oct 2016 22:02:05 +0000 (00:02 +0200)]
re PR target/77874 (two problems with gcc.target/i386/avx-1.c)

PR target/77874
* config/i386/sse.md (<mask_codefor><code><mode>3<mask_name>):
Remove wrong assert.
(<floatsuffix>float<sseintvecmodelower><mode>2<mask_name><round_name>:
Use <round_constraint> as operand 1 constraint.

From-SVN: r240814

7 years agore PR fortran/58991 (ICE with associate and character string constant)
Steven G. Kargl [Wed, 5 Oct 2016 21:14:14 +0000 (21:14 +0000)]
re PR fortran/58991 (ICE with associate and character string constant)

2016-10-05  Steven G. Kargl  <kargls@gcc.gnu.org>

PR fortran/58991
PR fortran/58992
* resolve.c (resolve_assoc_var):  Fix CHARACTER type-spec for a
selector in ASSOCIATE.
(resolve_fl_variable): Skip checks for an ASSOCIATE variable.

2016-10-05  Steven G. Kargl  <kargls@gcc.gnu.org>

PR fortran/58991
PR fortran/58992
* gfortran.dg/associate_22.f90: New test.

From-SVN: r240812

7 years agoFix ICE due to comparison between UNION components.
Fritz Reese [Wed, 5 Oct 2016 20:24:48 +0000 (20:24 +0000)]
Fix ICE due to comparison between UNION components.

2016-10-05  Fritz Reese  <fritzoreese@gmail.com>

Fix ICE due to comparison between UNION components.

gcc/fortran/
* interface.c (gfc_compare_types): Don't compare BT_UNION components
until we know they're both UNIONs.
* interface.c (gfc_compare_union_types): Guard against empty
components.

gcc/testsuite/gfortran.dg/
* dec_union_9.f90: New testcase.
* dec_union_10.f90: New testcase.

From-SVN: r240810

7 years ago* parser.c (cp_parser_skip_to_end_of_statement): Add missing break.
Jason Merrill [Wed, 5 Oct 2016 19:59:28 +0000 (15:59 -0400)]
* parser.c (cp_parser_skip_to_end_of_statement): Add missing break.

From-SVN: r240809

7 years agoFix last commit.
Marek Polacek [Wed, 5 Oct 2016 19:25:15 +0000 (19:25 +0000)]
Fix last commit.

From-SVN: r240806

7 years agore PR sanitizer/66343 ("Error: .Lubsan_type3 already defined" with UBSan and precompi...
Jakub Jelinek [Wed, 5 Oct 2016 19:04:39 +0000 (21:04 +0200)]
re PR sanitizer/66343 ("Error: .Lubsan_type3 already defined" with UBSan and precompiled headers)

PR sanitizer/66343
* ubsan.c (ubsan_create_data): Call initialize_sanitizer_builtins here.
(ubsan_instrument_float_cast): And not here.

* c-ubsan.c (ubsan_instrument_return): Don't call
initialize_sanitizer_builtins here.

* gcc.dg/pch/pr66343-3.c: New test.
* gcc.dg/pch/pr66343-3.hs: New file.

From-SVN: r240804

7 years agore PR sanitizer/66343 ("Error: .Lubsan_type3 already defined" with UBSan and precompi...
Jakub Jelinek [Wed, 5 Oct 2016 19:03:28 +0000 (21:03 +0200)]
re PR sanitizer/66343 ("Error: .Lubsan_type3 already defined" with UBSan and precompiled headers)

PR sanitizer/66343
* ubsan.c (ubsan_ids): New GTY(()) array.
(ubsan_type_descriptor, ubsan_create_data): Use ubsan_ids
instead of static local counters.

* gcc.dg/pch/pr66343-1.c: New test.
* gcc.dg/pch/pr66343-1.hs: New file.
* gcc.dg/pch/pr66343-2.c: New test.
* gcc.dg/pch/pr66343-2.hs: New file.

From-SVN: r240803

7 years ago* semantics.c (finish_compound_literal): Handle class placeholder.
Jason Merrill [Wed, 5 Oct 2016 18:57:45 +0000 (14:57 -0400)]
* semantics.c (finish_compound_literal): Handle class placeholder.

From-SVN: r240802

7 years agoMAINTAINERS: Update email address after it got reverted.
Steve Ellcey [Wed, 5 Oct 2016 18:42:10 +0000 (18:42 +0000)]
MAINTAINERS: Update email address after it got reverted.

2016-10-05  Steve Ellcey  <sellcey@caviumnetworks.com>

* MAINTAINERS: Update email address after it got reverted.

From-SVN: r240801

7 years agoc-common.c (c_common_truthvalue_conversion): Warn also for suspicious conditional...
Bernd Edlinger [Wed, 5 Oct 2016 18:34:17 +0000 (18:34 +0000)]
c-common.c (c_common_truthvalue_conversion): Warn also for suspicious conditional expression in boolean context when...

2016-10-05  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-common.c (c_common_truthvalue_conversion): Warn also for suspicious
        conditional expression in boolean context when only one arm is
        non-boolean.

testsuite:
2016-10-05  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-c++-common/Wint-in-bool-context.c: Update test.

From-SVN: r240799

7 years agoImplement P0305R1, Selection statements with initializer.
Marek Polacek [Wed, 5 Oct 2016 18:02:06 +0000 (18:02 +0000)]
Implement P0305R1, Selection statements with initializer.

* cp-array-notation.c (create_an_loop): Call finish_init_stmt
instead of finish_for_init_stmt.
* cp-tree.h (finish_for_init_stmt): Rename to finish_init_stmt.
* decl.c (poplevel): Adjust a comment.
* init.c (build_vec_init): Call finish_init_stmt instead of
finish_for_init_stmt.
* name-lookup.c (pushdecl_maybe_friend_1): Adjust a comment.
* name-lookup.h (enum scope_kind): Likewise.
* parser.c (cp_parser_statement): Update commentary.
(cp_parser_init_statement_p): New function.
(cp_parser_selection_statement): Parse the optional init-statement.
(cp_parser_for): Call finish_init_stmt instead of finish_for_init_stmt.
(cp_parser_c_for): Likewise.
(cp_convert_range_for): Call finish_init_stmt instead of finish_for_init_stmt.
(cp_parser_range_for_member_function): Update commentary.
(cp_parser_iteration_statement):
(cp_parser_for_init_statement): Rename to cp_parser_init_statement.
* pt.c (tsubst_omp_for_iterator): Update commentary.
(tsubst_expr): Call finish_init_stmt instead of finish_for_init_stmt.
* semantics.c (finish_for_init_stmt): Rename to finish_init_stmt.
Update commentary.

* g++.dg/cpp1z/init-statement1.C: New test.
* g++.dg/cpp1z/init-statement2.C: New test.
* g++.dg/cpp1z/init-statement3.C: New test.
* g++.dg/cpp1z/init-statement4.C: New test.
* g++.dg/cpp1z/init-statement5.C: New test.
* g++.dg/cpp1z/init-statement6.C: New test.
* g++.dg/cpp1z/init-statement7.C: New test.
* g++.dg/cpp1z/init-statement8.C: New test.

From-SVN: r240798

7 years agore PR fortran/67524 (ICE on using implicit character instead of implicit none etc.)
Louis Krupp [Wed, 5 Oct 2016 18:00:30 +0000 (18:00 +0000)]
re PR fortran/67524 (ICE on using implicit character instead of implicit none etc.)

2016-10-05  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/67524
* gfortran.dg/pr67524.f90: New test.

2016-10-05  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/67524
* resolve.c (resolve_symbol): Don't apply default type rules to
mixed-entry master created for function entry points.

From-SVN: r240797

7 years agore PR sanitizer/77823 (ICE: in ubsan_encode_value, at ubsan.c:137 with -fsanitize...
Jakub Jelinek [Wed, 5 Oct 2016 17:47:34 +0000 (19:47 +0200)]
re PR sanitizer/77823 (ICE: in ubsan_encode_value, at ubsan.c:137 with -fsanitize=undefined and vector types)

PR sanitizer/77823
* c-ubsan.c (ubsan_instrument_shift): Return NULL_TREE if type0
is not integral.

* c-c++-common/ubsan/shift-9.c: New test.

From-SVN: r240796

7 years agoFix pr69941.c test failure for avr
Senthil Kumar Selvaraj [Wed, 5 Oct 2016 17:11:22 +0000 (17:11 +0000)]
Fix pr69941.c test failure for avr

The test assumes ints are atleast 32 bits wide. For the avr
target, ints are 16 bits wide. This leads VRP to conclude
that a right shift by 9 followed by an equality comparison
to 0x74 can never be true. VRP eliminates the conditional, and
the code ends up unconditionally calling __builtin_abort.

Fixed the testcase to use __INT32_TYPE__ for targets with less
than 32 bit wide integers, wherever the size happens to be
significant.

gcc/testsuite/ChangeLog

2016-10-05  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

        * gcc.dg/torture/pr69941.c: Use __INT32_TYPE__ instead
        of int if __SIZEOF_INT__ is less than 4 bytes.

From-SVN: r240795

7 years agore PR libfortran/77868 (Fail to NULL guard check for internal unit in inquire_via_unit)
Jerry DeLisle [Wed, 5 Oct 2016 16:32:24 +0000 (16:32 +0000)]
re PR libfortran/77868 (Fail to NULL guard check for internal unit in inquire_via_unit)

2016-10-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/77868
* io/inquire.c (inquire_via_unit): NULL guard the check for
internal unit passed into child IO procedure.

* gfortran.dg/dtio_15.f90: Fix spaces in dg-do.
* gfortran.dg/class_array_20.f03: Likewise.
* gfortran.dg/class_array_21.f03: Likewise.
* gfortran.dg/finalize_29.f08: Likewise.
* gfortran.dg/unlimited_polymorphic_23.f90: Likewise.

From-SVN: r240794