1. 06 Jun, 2016 1 commit
    • Selftest framework · d9b950dd
      gcc/ChangeLog:
      	* Makefile.in (OBJS): Add function-tests.o,
      	hash-map-tests.o, hash-set-tests.o, rtl-tests.o,
      	selftest-run-tests.o.
      	(OBJS-libcommon): Add selftest.o.
      	(OBJS-libcommon-target): Add selftest.o.
      	(all.internal): Add "selftest".
      	(all.cross): Likewise.
      	(selftest): New phony target.
      	(s-selftest): New target.
      	(selftest-gdb): New phony target.
      	(COLLECT2_OBJS): Add selftest.o.
      	* bitmap.c: Include "selftest.h".
      	(selftest::test_gc_alloc): New function.
      	(selftest::test_set_range): New function.
      	(selftest::test_clear_bit_in_middle): New function.
      	(selftest::test_copying): New function.
      	(selftest::test_bitmap_single_bit_set_p): New function.
      	(selftest::bitmap_c_tests): New function.
      	* common.opt (fself-test): New.
      	* diagnostic-show-locus.c: Include "selftest.h".
      	(make_range): New function.
      	(test_range_contains_point_for_single_point): New function.
      	(test_range_contains_point_for_single_line): New function.
      	(test_range_contains_point_for_multiple_lines): New function.
      	(assert_eq): New function.
      	(test_get_line_width_without_trailing_whitespace): New function.
      	(selftest::diagnostic_show_locus_c_tests): New function.
      	* et-forest.c: Include "selftest.h".
      	(selftest::test_single_node): New function.
      	(selftest::test_simple_tree): New function.
      	(selftest::test_disconnected_nodes): New function.
      	(selftest::et_forest_c_tests): New function.
      	* fold-const.c: Include "selftest.h".
      	(selftest::assert_binop_folds_to_const): New function.
      	(selftest::assert_binop_folds_to_nonlvalue): New function.
      	(selftest::test_arithmetic_folding): New function.
      	(selftest::fold_const_c_tests): New function.
      	* function-tests.c: New file.
      	* gimple.c: Include "selftest.h".
      	Include "gimple-pretty-print.h".
      	(selftest::verify_gimple_pp): New function.
      	(selftest::test_assign_single): New function.
      	(selftest::test_assign_binop): New function.
      	(selftest::test_nop_stmt): New function.
      	(selftest::test_return_stmt): New function.
      	(selftest::test_return_without_value): New function.
      	(selftest::gimple_c_tests): New function.
      	* hash-map-tests.c: New file.
      	* hash-set-tests.c: New file.
      	* input.c: Include "selftest.h".
      	(selftest::assert_loceq): New function.
      	(selftest::test_accessing_ordinary_linemaps): New function.
      	(selftest::test_unknown_location): New function.
      	(selftest::test_builtins): New function.
      	(selftest::test_reading_source_line): New function.
      	(selftest::input_c_tests): New function.
      	* rtl-tests.c: New file.
      	* selftest-run-tests.c: New file.
      	* selftest.c: New file.
      	* selftest.h: New file.
      	* spellcheck.c: Include "selftest.h".
      	(selftest::levenshtein_distance_unit_test_oneway): New function,
      	adapted from testsuite/gcc.dg/plugin/levenshtein_plugin.c.
      	(selftest::levenshtein_distance_unit_test): Likewise.
      	(selftest::spellcheck_c_tests): Likewise.
      	* toplev.c: Include selftest.h.
      	(toplev::run_self_tests): New.
      	(toplev::main): Handle -fself-test.
      	* toplev.h (toplev::run_self_tests): New.
      	* tree.c: Include "selftest.h".
      	(selftest::test_integer_constants): New function.
      	(selftest::test_identifiers): New function.
      	(selftest::test_labels): New function.
      	(selftest::tree_c_tests): New function.
      	* tree-cfg.c: Include "selftest.h".
      	(selftest::push_fndecl): New function.
      	(selftest::test_linear_chain): New function.
      	(selftest::test_diamond): New function.
      	(selftest::test_fully_connected): New function.
      	(selftest::tree_cfg_c_tests): New function.
      	* vec.c: Include "selftest.h".
      	(selftest::safe_push_range): New function.
      	(selftest::test_quick_push): New function.
      	(selftest::test_safe_push): New function.
      	(selftest::test_truncate): New function.
      	(selftest::test_safe_grow_cleared): New function.
      	(selftest::test_pop): New function.
      	(selftest::test_safe_insert): New function.
      	(selftest::test_ordered_remove): New function.
      	(selftest::test_unordered_remove): New function.
      	(selftest::test_block_remove): New function.
      	(selftest::reverse_cmp): New function.
      	(selftest::test_qsort): New function.
      	(selftest::vec_c_tests): New function.c.
      	* wide-int.cc: Include selftest.h and wide-int-print.h.
      	(selftest::from_int <wide_int>): New function.
      	(selftest::from_int <offset_int>): New function.
      	(selftest::from_int <widest_int>): New function.
      	(selftest::assert_deceq): New function.
      	(selftest::assert_hexeq): New function.
      	(selftest::test_printing <VALUE_TYPE>): New function template.
      	(selftest::test_ops <VALUE_TYPE>): New function template.
      	(selftest::test_comparisons <VALUE_TYPE>): New function template.
      	(selftest::run_all_wide_int_tests <VALUE_TYPE>): New function
      	template.
      	(selftest::wide_int_cc_tests): New function.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/plugin/levenshtein-test-1.c: Delete.
      	* gcc.dg/plugin/levenshtein_plugin.c: Delete.
      	* gcc.dg/plugin/plugin.exp (plugin_test_list): Remove the
      	above.
      
      From-SVN: r237144
      David Malcolm committed
  2. 03 Jun, 2016 1 commit
    • re PR tree-optimization/52171 (memcmp/strcmp/strncmp can be optimized when the… · 36b85e43
      re PR tree-optimization/52171 (memcmp/strcmp/strncmp can be optimized when the result is tested for [in]equality with 0)
      
              PR tree-optimization/52171
              * builtins.c (expand_cmpstrn_or_cmpmem): Delete, moved elsewhere.
              (expand_builtin_memcmp): New arg RESULT_EQ.  All callers changed.
              Look for constant strings.  Move some code to emit_block_cmp_hints
              and use it.
              * builtins.def (BUILT_IN_MEMCMP_EQ): New.
              * defaults.h (COMPARE_MAX_PIECES): New macro.
              * expr.c (move_by_pieces_d, store_by_pieces_d): Remove old structs.
              (move_by_pieces_1, store_by_pieces_1, store_by_pieces_2): Remvoe.
              (clear_by_pieces_1): Don't declare.  Move definition before use.
              (can_do_by_pieces): New static function.
              (can_move_by_pieces): Use it.  Return bool.
              (by_pieces_ninsns): Renamed from move_by_pieces_ninsns.  New arg
              OP.  All callers changed.  Handle COMPARE_BY_PIECES.
              (class pieces_addr); New.
              (pieces_addr::pieces_addr, pieces_addr::decide_autoinc,
              pieces_addr::adjust, pieces_addr::increment_address,
              pieces_addr::maybe_predec, pieces_addr::maybe_postinc): New member
              functions for it.
              (class op_by_pieces_d): New.
              (op_by_pieces_d::op_by_pieces_d, op_by_pieces_d::run): New member
              functions for it.
              (class move_by_pieces_d, class compare_by_pieces_d,
              class store_by_pieces_d): New subclasses of op_by_pieces_d.
              (move_by_pieces_d::prepare_mode, move_by_pieces_d::generate,
              move_by_pieces_d::finish_endp, store_by_pieces_d::prepare_mode,
              store_by_pieces_d::generate, store_by_pieces_d::finish_endp,
              compare_by_pieces_d::generate, compare_by_pieces_d::prepare_mode,
              compare_by_pieces_d::finish_mode): New member functions.
              (compare_by_pieces, emit_block_cmp_via_cmpmem): New static
              functions.
              (expand_cmpstrn_or_cmpmem): Moved here from builtins.c.
              (emit_block_cmp_hints): New function.
              (move_by_pieces, store_by_pieces, clear_by_pieces): Rewrite to just
              use the newly defined classes.
              * expr.h (by_pieces_constfn): New typedef.
              (can_store_by_pieces, store_by_pieces): Use it in arg declarations.
              (emit_block_cmp_hints, expand_cmpstrn_or_cmpmem): Declare.
              (move_by_pieces_ninsns): Don't declare.
              (can_move_by_pieces): Change return value to bool.
              * target.def (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): Update docs.
              (compare_by_pieces_branch_ratio): New hook.
              * target.h (enum by_pieces_operation): Add COMPARE_BY_PIECES.
              (by_pieces_ninsns): Declare.
              * targethooks.c (default_use_by_pieces_infrastructure_p): Handle
              COMPARE_BY_PIECES.
              (default_compare_by_pieces_branch_ratio): New function.
              * targhooks.h (default_compare_by_pieces_branch_ratio): Declare.
              * doc/tm.texi.in (STORE_MAX_PIECES, COMPARE_MAX_PIECES): Document.
              * doc/tm.texi: Regenerate.
              * tree-ssa-strlen.c: Include "builtins.h".
              (handle_builtin_memcmp): New static function.
              (strlen_optimize_stmt): Call it for BUILT_IN_MEMCMP.
              * tree.c (build_common_builtin_nodes): Create __builtin_memcmp_eq.
      
      testsuite/
              PR tree-optimization/52171
              * gcc.dg/pr52171.c: New test.
              * gcc.target/i386/pr52171.c: New test.
      
      From-SVN: r237069
      Bernd Schmidt committed
  3. 01 Jun, 2016 1 commit
  4. 25 May, 2016 1 commit
  5. 21 May, 2016 1 commit
  6. 16 May, 2016 1 commit
  7. 13 May, 2016 1 commit
    • builtins.c (expand_builtin_memcmp): Do not emit the call here. · ee516de9
      	* builtins.c (expand_builtin_memcmp): Do not emit the call here.
      	(expand_builtin_trap): Emit a regular call.
      	(set_builtin_user_assembler_name): Remove obsolete cases.
      	* dse.c (scan_insn): Adjust.
      	* except.c: Include calls.h.
      	(sjlj_emit_function_enter): If DONT_USE_BUILTIN_SETJMP is defined,
      	emit a regular call to setjmp.
      	* expr.c (emit_block_move_hints): Call emit_block_copy_via_libcall.
      	(block_move_libcall_safe_for_call_parm): Use memcpy builtin.
      	(emit_block_move_via_libcall): Delete.
      	(block_move_fn): Delete.
      	(init_block_move_fn): Likewise.
      	(emit_block_move_libcall_fn): Likewise.
      	(emit_block_op_via_libcall): New function.
      	(set_storage_via_libcall): Tidy up and use memset builtin.
      	(block_clear_fn): Delete.
      	(init_block_clear_fn): Likewise.
      	(clear_storage_libcall_fn): Likewise.
      	(expand_assignment): Call emit_block_move_via_libcall.
      	Do not include gt-expr.h.
      	* expr.h (emit_block_op_via_libcall): Declare.
      	(emit_block_copy_via_libcall): New inline function.
      	(emit_block_move_via_libcall): Likewise.
      	(emit_block_comp_via_libcall): Likewise.
      	(block_clear_fn): Delete.
      	(init_block_move_fn): Likewise.
      	(init_block_clear_fn): Likewise.
      	(emit_block_move_via_libcall): Likewise.
      	(set_storage_via_libcall): Add default parameter value.
      	* libfuncs.h (enum libfunc_index): Remove obsolete values.
      	(abort_libfunc): Delete.
      	(memcpy_libfunc): Likewise.
      	(memmove_libfunc): Likewise.
      	(memcmp_libfunc): Likewise.
      	(memset_libfunc): Likewise.
      	(setbits_libfunc): Likewise.
      	(setjmp_libfunc): Likewise.
      	(longjmp_libfunc): Likewise.
      	(profile_function_entry_libfunc): Likewise.
      	(profile_function_exit_libfunc): Likewise.
      	(gcov_flush_libfunc): Likewise.
      	* optabs-libfuncs.c (build_libfunc_function): Set DECL_ARTIFICIAL
      	and DECL_VISIBILITY on the declaration.
      	(init_optabs): Do not initialize obsolete libfuncs.
      	* optabs.c (prepare_cmp_insn): Call emit_block_comp_via_libcall.
      	* tree-core.h (ECF_RET1): Define.
      	(ECF_TM_PURE): Adjust.
      	(ECF_TM_BUILTIN): Likewise.
      	* tree.c (set_call_expr_flags): Deal with ECF_RET1.
      	(build_common_builtin_nodes): Initialize abort builtin.
      	Add ECF_RET1 on memcpy, memmove and memset builtins.
      	Pass final flags for alloca and alloca_with_align builtins.
      	* config/alpha/alpha.c (alpha_init_libfuncs): Do not initialize
      	obsolete builtins.
      	* config/ia64/ia64.c (ia64_vms_init_libfuncs): Likewise.
      	* config/i386/i386.c (ix86_expand_set_or_movmem): Adjust call to
      	set_storage_via_libcall and call emit_block_copy_via_libcall.
      
      From-SVN: r236195
      Eric Botcazou committed
  8. 12 May, 2016 1 commit
    • re PR c/70756 (Wrong column number shown for "error: invalid use of flexible array member") · 4f2e1536
      	PR c/70756
      	* c-common.c (pointer_int_sum): Call size_in_bytes_loc instead of
      	size_in_bytes and pass LOC to it.
      
      	* c-decl.c (build_compound_literal): Pass LOC down to
      	c_incomplete_type_error.
      	* c-tree.h (require_complete_type): Adjust declaration.
      	(c_incomplete_type_error): Likewise.
      	* c-typeck.c (require_complete_type): Add location parameter, pass it
      	down to c_incomplete_type_error.
      	(c_incomplete_type_error): Add location parameter, pass it down to
      	error_at.
      	(build_component_ref): Pass location down to c_incomplete_type_error.
      	(default_conversion): Pass location down to require_complete_type.
      	(build_array_ref): Likewise.
      	(build_function_call_vec): Likewise.
      	(convert_arguments): Likewise.
      	(build_unary_op): Likewise.
      	(build_c_cast): Likewise.
      	(build_modify_expr): Likewise.
      	(convert_for_assignment): Likewise.
      	(c_finish_omp_clauses): Likewise.
      
      	* call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
      	* cp-tree.h (cp_build_modify_expr): Update declaration.
      	(cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
      	overloads.
      	* cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
      	cp_build_modify_expr.
      	* decl2.c (set_guard): Likewise.
      	(handle_tls_init): Likewise.
      	* init.c (perform_member_init): Likewise.
      	(expand_virtual_init): Likewise.
      	(build_new_1): Likewise.
      	(build_vec_delete_1): Likewise.
      	(get_temp_regvar): Likewise.
      	(build_vec_init): Likewise.
      	* method.c (do_build_copy_assign): Likewise.
      	(assignable_expr): Likewise.
      	* semantics.c (finish_omp_for): Likewise.
      	* typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
      	cp_pointer_int_sum.
      	(cp_pointer_int_sum): Add location parameter.  Pass it down to
      	pointer_int_sum.
      	(pointer_diff): Add location parameter.  Use it.
      	(build_modify_expr): Pass location down to cp_build_modify_expr.
      	(cp_build_modify_expr): Add location parameter.  Use it.
      	(build_x_modify_expr): Pass location down to cp_build_modify_expr.
      	* typeck2.c (cxx_incomplete_type_diagnostic,
      	cxx_incomplete_type_error): Add location parameter.
      
      	* langhooks-def.h (lhd_incomplete_type_error): Adjust declaration.
      	* langhooks.c (lhd_incomplete_type_error): Add location parameter.
      	* langhooks.h (incomplete_type_error): Likewise.
      	* tree.c (size_in_bytes_loc): Renamed from size_in_bytes.  Add location
      	parameter, pass it down to incomplete_type_error.
      	* tree.h (size_in_bytes): New inline overload.
      	(size_in_bytes_loc): Renamed from size_in_bytes.
      
      	* c-c++-common/pr70756-2.c: New test.
      	* c-c++-common/pr70756.c: New test.
      
      From-SVN: r236180
      Marek Polacek committed
  9. 04 May, 2016 1 commit
    • re PR c++/70906 (ice in add_expr, at tree.c:7925) · 2d1ac15a
      	PR c++/70906
      	PR c++/70933
      	* tree-core.h (enum operand_equal_flag): Add OEP_HASH_CHECK.
      	* tree.c (inchash::add_expr): If !IS_EXPR_CODE_CLASS (tclass),
      	assert flags & OEP_HASH_CHECK, instead of asserting it
      	never happens.  Handle TARGET_EXPR.
      	* fold-const.c (operand_equal_p): For hash verification,
      	or in OEP_HASH_CHECK into flags.
      
      	* g++.dg/opt/pr70906.C: New test.
      	* g++.dg/opt/pr70933.C: New test.
      
      From-SVN: r235902
      Jakub Jelinek committed
  10. 02 May, 2016 2 commits
    • machmode.h (mode_complex): Add support to give the complex mode for a given mode. · 4304ccfd
      [gcc]
      2016-05-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	* machmode.h (mode_complex): Add support to give the complex mode
      	for a given mode.
      	(GET_MODE_COMPLEX_MODE): Likewise.
      	* stor-layout.c (layout_type): For COMPLEX_TYPE, use the mode
      	stored by build_complex_type and gfc_build_complex_type instead of
      	trying to figure out the appropriate mode based on the size. Raise
      	an assertion error, if the type was not set.
      	* genmodes.c (struct mode_data): Add field for the complex type of
      	the given type.
      	(blank_mode): Likewise.
      	(make_complex_modes): Remember the complex mode created in the
      	base type.
      	(emit_mode_complex): Write out the mode_complex array to map a
      	type mode to the complex version.
      	(emit_insn_modes_c): Likewise.
      	* tree.c (build_complex_type): Set the complex type to use before
      	calling layout_type.
      	* config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Add
      	support for __float128 complex datatypes.
      	(rs6000_hard_regno_mode_ok): Likewise.
      	(rs6000_setup_reg_addr_masks): Likewise.
      	(rs6000_complex_function_value): Likewise.
      	* config/rs6000/rs6000.h (FLOAT128_IEEE_P): Likewise.
      	__float128 and __ibm128 complex.
      	(FLOAT128_IBM_P): Likewise.
      	(ALTIVEC_ARG_MAX_RETURN): Likewise.
      	* doc/extend.texi (Additional Floating Types): Document that
      	-mfloat128 must be used to enable __float128.  Document complex
      	__float128 and __ibm128 support.
      
      [gcc/fortran]
      2016-05-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	* trans-types.c (gfc_build_complex_type):
      
      [gcc/testsuite]
      2016-05-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	* gcc.target/powerpc/float128-complex-1.c: New tests for complex
      	__float128.
      	* gcc.target/powerpc/float128-complex-2.c: Likewise.
      
      From-SVN: r235794
      Michael Meissner committed
    • Simplify cst_and_fits_in_hwi · 05ff4c5f
      While looking at the use of cst_and_fits_in_hwi in tree-ssa-loop-ivopts.c,
      I had difficulty working out what the function actually tests.  The
      final NUNITS check seems redundant, since it asks about the number of
      HWIs in the _unextended_ constant.  We've already checked that the
      unextended constant has no more than HOST_BITS_PER_WIDE_INT bits, so the
      length must be 1.
      
      I think this was my fault, sorry.
      
      Tested on x86_64-linux-gnu and aarch64-linux-gnu.
      
      gcc/
      	* tree.c (cst_and_fits_in_hwi): Simplify.
      
      From-SVN: r235722
      Richard Sandiford committed
  11. 28 Apr, 2016 1 commit
  12. 27 Apr, 2016 1 commit
    • re PR sanitizer/70683 (-fcompare-debug bug with -fsanitize=address) · 108b7b29
      	PR sanitizer/70683
      	* tree.h (inchash::add_expr): Add FLAGS argument.
      	* tree.c (inchash::add_expr): Likewise.  If not OEP_ADDRESS_OF,
      	use STRIP_NOPS first.  For INTEGER_CST assert not OEP_ADDRESS_OF.
      	For REAL_CST and !HONOR_SIGNED_ZEROS (t) hash +/- 0 the same.
      	Formatting fix.  Adjust recursive calls.  For tcc_comparison,
      	if swap_tree_comparison (code) is smaller than code, hash that
      	and arguments in the other order.  Hash CONVERT_EXPR the same
      	as NOP_EXPR.  For OEP_ADDRESS_OF hash MEM_REF with 0 offset
      	of ADDR_EXPR of decl as the decl itself.  Add or remove
      	OEP_ADDRESS_OF from recursive flags as needed.  For
      	FMA_EXPR, WIDEN_MULT_{PLUS,MINUS}_EXPR hash the first two
      	operands commutatively and only the third one normally.
      	For internal CALL_EXPR hash in CALL_EXPR_IFN.
      
      From-SVN: r235469
      Jakub Jelinek committed
  13. 18 Apr, 2016 1 commit
    • tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. · fe37c7af
      	* tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
      	(SET_TYPE_ALIGN, SET_DECL_ALIGN): New.
      	* tree-core.h (tree_type_common.align): Use bit-field.
      	(tree_type_common.spare): New.
      	(tree_decl_common.off_align): Make smaller.
      	(tree_decl_common.align): Use bit-field.
      
      	* expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN.
      	* omp-low.c (install_var_field): Use SET_DECL_ALIGN.
      	(scan_sharing_clauses): Ditto.
      	(finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
      	(omp_finish_file): Ditto.
      	* stor-layout.c (do_type_align): Use SET_DECL_ALIGN.
      	(layout_decl): Ditto.
      	(relayout_decl): Ditto.
      	(finalize_record_size): Use SET_TYPE_ALIGN.
      	(finalize_type_size): Ditto.
      	(finish_builtin_struct): Ditto.
      	(layout_type): Ditto.
      	(initialize_sizetypes): Ditto.
      	* targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN.
      	* tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN.
      	(lookup_field_for_decl): Use SET_DECL_ALIGN.
      	(get_chain_field): Ditto.
      	(get_trampoline_type): Ditto.
      	(get_nl_goto_field): Ditto.
      	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
      	SET_DECL_ALIGN.
      	(unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN.
      	* gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN.
      	* tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
      	(build_qualified_type): Use SET_TYPE_ALIGN.
      	(build_aligned_type, build_range_type_1): Ditto.
      	(build_atomic_base): Ditto.
      	(build_common_tree_nodes): Ditto.
      	* cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN.
      	(expand_one_stack_var_at): Ditto.
      	* coverage.c (build_var): Use SET_DECL_ALIGN.
      	* except.c (init_eh): Ditto.
      	* function.c (assign_parm_setup_block): Ditto.
      	* symtab.c (increase_alignment_1): Ditto.
      	* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto.
      	* tree-vect-stmts.c (ensure_base_align): Ditto.
      	* varasm.c (align_variable): Ditto.
      	(assemble_variable): Ditto.
      	(build_constant_desc): Ditto.
      	(output_constant_def_contents): Ditto.
      
      	* config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN.
      	* config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN.
      	* config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto.
      	* config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto.
      	* config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN.
      
      ada/
      	* gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
      	(gnat_to_gnu_field): Ditto.
      	(components_to_record): Ditto.
      	(create_variant_part_from): Ditto.
      	(copy_and_substitute_in_size): Ditto.
      	(substitute_in_type): Ditto.
      	* gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
      	(make_packable_type): Ditto.
      	(maybe_pad_type): Ditto.
      	(finish_fat_pointer_type): Ditto.
      	(finish_record_type): Ditto and use SET_DECL_ALIGN.
      	(rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
      	(create_field_decl): Use SET_DECL_ALIGN.
      
      c-family/
      	* c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN
      	and SET_DECL_ALIGN.
      
      c/
      	* c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
      	(grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
      
      cp/
      	* class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
      	(layout_class_type): Ditto.
      	(build_base_field): Use SET_DECL_ALIGN.
      	(fixup_attribute_variants): Use SET_TYPE_ALIGN.
      	* decl.c (duplicate_decls): Use SET_DECL_ALIGN.
      	(record_unknown_type): Use SET_TYPE_ALIGN.
      	(cxx_init_decl_processing): Ditto.
      	(copy_type_enum): Ditto.
      	(grokfndecl): Use SET_DECL_ALIGN.
      	(copy_type_enum): Use SET_TYPE_ALIGN.
      	* pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
      	(tsubst): Ditto.
      	* tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
      	* lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
      	* method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
      	* rtti.c (emit_tinfo_decl): Ditto.
      
      fortran/
      	* trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN.
      	* trans-common.c (build_common_decl): Use SET_DECL_ALIGN.
      	* trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN.
      
      go/
      	* go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN.
      
      java/
      	* class.c (add_method_1): Use SET_DECL_ALIGN.
      	(make_class_data): Ditto.
      	(emit_register_classes_in_jcr_section): Ditto.
      	* typeck.c (build_java_array_type): Ditto.
      
      objc/
      	* objc-act.c (objc_build_struct): Use SET_DECL_ALIGN.
      
      libcc1/
      	* plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN.
      
      From-SVN: r235172
      Michael Matz committed
  14. 14 Apr, 2016 1 commit
  15. 10 Mar, 2016 3 commits
  16. 24 Feb, 2016 1 commit
  17. 23 Feb, 2016 1 commit
    • mem-stats.h (struct mem_usage): Use PRIu64 for printing size_t. · 43331dfb
      2016-02-23  Richard Biener  <rguenther@suse.de>
      
      	* mem-stats.h (struct mem_usage): Use PRIu64 for printing size_t.
      	* bitmap.h (struct bitmap_usage): Likewise.
      	(bitmap_move): Declare.
      	* bitmap.c (register_overhead): Take size_t argument.
      	(bitmap_move): New function.
      	* df-problems.c (df_rd_transfer_function): Use bitmap_move
      	to properly account overhead.
      	* tree.c (free_node): Use tree_size.
      
      From-SVN: r233633
      Richard Biener committed
  18. 08 Feb, 2016 1 commit
    • Remove -fshort-double · a011cd92
      	PR target/60410
      	* tree.c (build_common_tree_nodes): Remove short_double argument.
      	All callers changed.
      	* tree.h (build_common_tree_nodes): Adjust declaration.
      	* doc/invoke.texi (-fshort-double): Remove documentation.
      	* config/mips/t-img-elf (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
      	MULTILIB_EXCEPTIONS): Remove -fshort-double variant.
      	* lto-wrapper.c (merge_and_complain, append_compiler_options,
      	append_linker_options): Don't handle OPT_fshort_double.
      	
      c-family/
      	PR target/60410
      	* c.opt (fshort-double): Remove.
      
      testsuite/
      	PR target/60410
      	* gcc.dg/lto/pr55113_0.c: Remove test.
      
      From-SVN: r233218
      Bernd Schmidt committed
  19. 05 Feb, 2016 1 commit
  20. 26 Jan, 2016 1 commit
    • re PR c++/68782 (bad reference member formed with constexpr) · 2d63bc39
      	PR c++/68782
      
      gcc/
      	* tree.c (recompute_constructor_flags): Split out from
      	build_constructor.
      	(verify_constructor_flags): New.
      	* tree.h: Declare them.
      gcc/cp/
      	* constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
      	and TREE_SIDE_EFFECTS.
      	(cxx_eval_constant_expression) [CONSTRUCTOR]: Call
      	verify_constructor_flags.
      
      From-SVN: r232847
      Jason Merrill committed
  21. 23 Jan, 2016 1 commit
    • tree-ssanames.c (release_free_names_and_compact_live_names): Replace "the the"… · 6af801f5
      tree-ssanames.c (release_free_names_and_compact_live_names): Replace "the the" with "the" in the comments.
      
      	* tree-ssanames.c (release_free_names_and_compact_live_names): Replace
      	"the the" with "the" in the comments.
      	* ipa-devirt.c (build_type_inheritance_graph,
      	update_type_inheritance_graph): Likewise.
      	* tree.c (build_function_type_list_1): Likewise.
      	* cfgloopmanip.c (scale_loop_profile): Likewise.
      	* tree-ssa-loop-ivopts.c (get_shiftadd_cost): Likewise.
      	* gimple-ssa-split-paths.c
      	(find_block_to_duplicate_for_splitting_paths): Likewise.
      	* tree-sra.c (init_subtree_with_zero, clobber_subtree): Likewise.
      	* expr.c (convert_move): Likewise.
      	* var-tracking.c (vt_stack_adjustments): Likewise.
      	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
      	* tree-vrp.c (test_for_singularity): Likewise.
      
      From-SVN: r232765
      Jakub Jelinek committed
  22. 20 Jan, 2016 1 commit
    • re PR target/69343 (Bootstrap failure on s390{,x}-linux) · b1de98e3
      PR bootstrap/69343
      PR bootstrap/69339
      PR tree-opt/68964
      
      Revert:
      gcc/
        * tree.c (tm_define_builtin): New.
        (find_tm_vector_type): New.
        (build_tm_vector_builtins): New.
        (build_common_builtin_nodes): Call it.
      libitm/
        * Makefile.am (libitm_la_SOURCES) [ARCH_AARCH64]: Add vect128.cc
        (libitm_la_SOURCES) [ARCH_ARM]: Add neon.cc
        (libitm_la_SOURCES) [ARCH_PPC]: Add vect128.cc
        (libitm_la_SOURCES) [ARCH_S390]: Add vect128.cc
        * configure.ac (ARCH_AARCH64): New conditional.
        (ARCH_PPC, ARCH_S390): Likewise.
        * Makefile.in, configure: Rebuild.
        * libitm.h (_ITM_TYPE_M128): Always define.
        * vect64.cc: Split ...
        * vect128.cc: ... out of...
        * config/x86/x86_sse.cc: ... here.
        * config/arm/neon.cc: New file.
      
      From-SVN: r232631
      Richard Henderson committed
  23. 19 Jan, 2016 1 commit
    • Merge of HSA · b2b40051
      2016-01-19  Martin Jambor  <mjambor@suse.cz>
      	    Martin Liska  <mliska@suse.cz>
      	    Michael Matz <matz@suse.de>
      
      libgomp/
      	* plugin/Makefrag.am: Add HSA plugin requirements.
      	* plugin/configfrag.ac (HSA_RUNTIME_INCLUDE): New variable.
      	(HSA_RUNTIME_LIB): Likewise.
      	(HSA_RUNTIME_CPPFLAGS): Likewise.
      	(HSA_RUNTIME_INCLUDE): New substitution.
      	(HSA_RUNTIME_LIB): Likewise.
      	(HSA_RUNTIME_LDFLAGS): Likewise.
      	(hsa-runtime): New configure option.
      	(hsa-runtime-include): Likewise.
      	(hsa-runtime-lib): Likewise.
      	(PLUGIN_HSA): New substitution variable.
      	Fill HSA_RUNTIME_INCLUDE and HSA_RUNTIME_LIB according to the new
      	configure options.
      	(PLUGIN_HSA_CPPFLAGS): Likewise.
      	(PLUGIN_HSA_LDFLAGS): Likewise.
      	(PLUGIN_HSA_LIBS): Likewise.
      	Check that we have access to HSA run-time.
      	* libgomp-plugin.h (offload_target_type): New element
      	OFFLOAD_TARGET_TYPE_HSA.
      	* libgomp.h (gomp_target_task): New fields firstprivate_copies and
      	args.
      	(bool gomp_create_target_task): Updated.
      	(gomp_device_descr): Extra parameter of run_func and async_run_func,
      	new field can_run_func.
      	* libgomp_g.h (GOMP_target_ext): Update prototype.
      	* oacc-host.c (host_run): Added a new parameter args.
      	* target.c (calculate_firstprivate_requirements): New function.
      	(copy_firstprivate_data): Likewise.
      	(gomp_target_fallback_firstprivate): Use them.
      	(gomp_target_unshare_firstprivate): New function.
      	(gomp_get_target_fn_addr): Allow returning NULL for shared memory
      	devices.
      	(GOMP_target): Do host fallback for all shared memory devices.  Do not
      	pass any args to plugins.
      	(GOMP_target_ext): Introduce device-specific argument parameter args.
      	Allow host fallback if device shares memory.  Do not remap data if
      	device has shared memory.
      	(gomp_target_task_fn): Likewise.  Also treat shared memory devices
      	like host fallback for mappings.
      	(GOMP_target_data): Treat shared memory devices like host fallback.
      	(GOMP_target_data_ext): Likewise.
      	(GOMP_target_update): Likewise.
      	(GOMP_target_update_ext): Likewise.  Also pass NULL as args to
      	gomp_create_target_task.
      	(GOMP_target_enter_exit_data): Likewise.
      	(omp_target_alloc): Treat shared memory devices like host fallback.
      	(omp_target_free): Likewise.
      	(omp_target_is_present): Likewise.
      	(omp_target_memcpy): Likewise.
      	(omp_target_memcpy_rect): Likewise.
      	(omp_target_associate_ptr): Likewise.
      	(gomp_load_plugin_for_device): Also load can_run.
      	* task.c (GOMP_PLUGIN_target_task_completion): Free
      	firstprivate_copies.
      	(gomp_create_target_task): Accept new argument args and store it to
      	ttask.
      	* plugin/plugin-hsa.c: New file.
      
      gcc/
      	* Makefile.in (OBJS): Add new source files.
      	(GTFILES): Add hsa.c.
      	* common.opt (disable_hsa): New variable.
      	(-Whsa): New warning.
      	* config.in (ENABLE_HSA): New.
      	* configure.ac: Treat hsa differently from other accelerators.
      	(OFFLOAD_TARGETS): Define ENABLE_OFFLOADING according to
      	$enable_offloading.
      	(ENABLE_HSA): Define ENABLE_HSA according to $enable_hsa.
      	* doc/install.texi (Configuration): Document --with-hsa-runtime,
      	--with-hsa-runtime-include, --with-hsa-runtime-lib and
      	--with-hsa-kmt-lib.
      	* doc/invoke.texi (-Whsa): Document.
      	(hsa-gen-debug-stores): Likewise.
      	* lto-wrapper.c (compile_images_for_offload_targets): Do not attempt
      	to invoke offload compiler for hsa acclerator.
      	* opts.c (common_handle_option): Determine whether HSA offloading
      	should be performed.
      	* params.def (PARAM_HSA_GEN_DEBUG_STORES): New parameter.
      	* builtin-types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
      	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
      	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.
      	* gimple-low.c (lower_stmt): Also handle GIMPLE_OMP_GRID_BODY.
      	* gimple-pretty-print.c (dump_gimple_omp_for): Also handle
      	GF_OMP_FOR_KIND_GRID_LOOP.
      	(dump_gimple_omp_block): Also handle GIMPLE_OMP_GRID_BODY.
      	(pp_gimple_stmt_1): Likewise.
      	* gimple-walk.c (walk_gimple_stmt): Likewise.
      	* gimple.c (gimple_build_omp_grid_body): New function.
      	(gimple_copy): Also handle GIMPLE_OMP_GRID_BODY.
      	* gimple.def (GIMPLE_OMP_GRID_BODY): New.
      	* gimple.h (enum gf_mask): Added GF_OMP_PARALLEL_GRID_PHONY,
      	GF_OMP_FOR_KIND_GRID_LOOP, GF_OMP_FOR_GRID_PHONY and
      	GF_OMP_TEAMS_GRID_PHONY.
      	(gimple_statement_omp_single_layout): Updated comments.
      	(gimple_build_omp_grid_body): New function.
      	(gimple_has_substatements): Also handle GIMPLE_OMP_GRID_BODY.
      	(gimple_omp_for_grid_phony): New function.
      	(gimple_omp_for_set_grid_phony): Likewise.
      	(gimple_omp_parallel_grid_phony): Likewise.
      	(gimple_omp_parallel_set_grid_phony): Likewise.
      	(gimple_omp_teams_grid_phony): Likewise.
      	(gimple_omp_teams_set_grid_phony): Likewise.
      	(gimple_return_set_retbnd): Also handle GIMPLE_OMP_GRID_BODY.
      	* omp-builtins.def (BUILT_IN_GOMP_OFFLOAD_REGISTER): New.
      	(BUILT_IN_GOMP_OFFLOAD_UNREGISTER): Likewise.
      	(BUILT_IN_GOMP_TARGET): Updated type.
      	* omp-low.c: Include symbol-summary.h, hsa.h and params.h.
      	(adjust_for_condition): New function.
      	(get_omp_for_step_from_incr): Likewise.
      	(extract_omp_for_data): Moved parts to adjust_for_condition and
      	get_omp_for_step_from_incr.
      	(build_outer_var_ref): Handle GIMPLE_OMP_GRID_BODY.
      	(fixup_child_record_type): Bail out if receiver_decl is NULL.
      	(scan_sharing_clauses): Handle OMP_CLAUSE__GRIDDIM_.
      	(scan_omp_parallel): Do not create child functions for phony
      	constructs.
      	(check_omp_nesting_restrictions): Handle GIMPLE_OMP_GRID_BODY.
      	(scan_omp_1_op): Checking assert we are not remapping to
      	ERROR_MARK.  Also also handle GIMPLE_OMP_GRID_BODY.
      	(parallel_needs_hsa_kernel_p): New function.
      	(expand_parallel_call): Register apprpriate parallel child
      	functions as HSA kernels.
      	(grid_launch_attributes_trees): New type.
      	(grid_attr_trees): New variable.
      	(grid_create_kernel_launch_attr_types): New function.
      	(grid_insert_store_range_dim): Likewise.
      	(grid_get_kernel_launch_attributes): Likewise.
      	(get_target_argument_identifier_1): Likewise.
      	(get_target_argument_identifier): Likewise.
      	(get_target_argument_value): Likewise.
      	(push_target_argument_according_to_value): Likewise.
      	(get_target_arguments): Likewise.
      	(expand_omp_target): Call get_target_arguments instead of looking
      	up for teams and thread limit.
      	(grid_expand_omp_for_loop): New function.
      	(grid_arg_decl_map): New type.
      	(grid_remap_kernel_arg_accesses): New function.
      	(grid_expand_target_kernel_body): New function.
      	(expand_omp): Call it.
      	(lower_omp_for): Do not emit phony constructs.
      	(lower_omp_taskreg): Do not emit phony constructs but create for them
      	a temporary variable receiver_decl.
      	(lower_omp_taskreg): Do not emit phony constructs.
      	(lower_omp_teams): Likewise.
      	(lower_omp_grid_body): New function.
      	(lower_omp_1): Call it.
      	(grid_reg_assignment_to_local_var_p): New function.
      	(grid_seq_only_contains_local_assignments): Likewise.
      	(grid_find_single_omp_among_assignments_1): Likewise.
      	(grid_find_single_omp_among_assignments): Likewise.
      	(grid_find_ungridifiable_statement): Likewise.
      	(grid_target_follows_gridifiable_pattern): Likewise.
      	(grid_remap_prebody_decls): Likewise.
      	(grid_copy_leading_local_assignments): Likewise.
      	(grid_process_kernel_body_copy): Likewise.
      	(grid_attempt_target_gridification): Likewise.
      	(grid_gridify_all_targets_stmt): Likewise.
      	(grid_gridify_all_targets): Likewise.
      	(execute_lower_omp): Call grid_gridify_all_targets.
      	(make_gimple_omp_edges): Handle GIMPLE_OMP_GRID_BODY.
      	* tree-core.h (omp_clause_code): Added OMP_CLAUSE__GRIDDIM_.
      	(tree_omp_clause): Added union field dimension.
      	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__GRIDDIM_.
      	* tree.c (omp_clause_num_ops): Added number of arguments of
      	OMP_CLAUSE__GRIDDIM_.
      	(omp_clause_code_name): Added name of OMP_CLAUSE__GRIDDIM_.
      	(walk_tree_1): Handle OMP_CLAUSE__GRIDDIM_.
      	* tree.h (OMP_CLAUSE_GRIDDIM_DIMENSION): New.
      	(OMP_CLAUSE_SET_GRIDDIM_DIMENSION): Likewise.
      	(OMP_CLAUSE_GRIDDIM_SIZE): Likewise.
      	(OMP_CLAUSE_GRIDDIM_GROUP): Likewise.
      	* passes.def: Schedule pass_ipa_hsa and pass_gen_hsail.
      	* tree-pass.h (make_pass_gen_hsail): Declare.
      	(make_pass_ipa_hsa): Likewise.
      	* ipa-hsa.c: New file.
      	* lto-section-in.c (lto_section_name): Add hsa section name.
      	* lto-streamer.h (lto_section_type): Add hsa section.
      	* timevar.def (TV_IPA_HSA): New.
              * hsa-brig-format.h: New file.
      	* hsa-brig.c: New file.
      	* hsa-dump.c: Likewise.
      	* hsa-gen.c: Likewise.
      	* hsa.c: Likewise.
      	* hsa.h: Likewise.
      	* toplev.c (compile_file): Call hsa_output_brig.
      	* hsa-regalloc.c: New file.
      
      gcc/fortran/
      	* types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
      	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
      	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.
      
      gcc/lto/
      	* lto-partition.c: Include "hsa.h"
      	(add_symbol_to_partition_1): Put hsa implementations into the
      	same partition as host implementations.
      
      liboffloadmic/
      	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_async_run): New
      	unused parameter.
      	(GOMP_OFFLOAD_run): Likewise.
      
      include/
      	* gomp-constants.h (GOMP_DEVICE_HSA): New macro.
      	(GOMP_VERSION_HSA): Likewise.
      	(GOMP_TARGET_ARG_DEVICE_MASK): Likewise.
      	(GOMP_TARGET_ARG_DEVICE_ALL): Likewise.
      	(GOMP_TARGET_ARG_SUBSEQUENT_PARAM): Likewise.
      	(GOMP_TARGET_ARG_ID_MASK): Likewise.
      	(GOMP_TARGET_ARG_NUM_TEAMS): Likewise.
      	(GOMP_TARGET_ARG_THREAD_LIMIT): Likewise.
      	(GOMP_TARGET_ARG_VALUE_SHIFT): Likewise.
      	(GOMP_TARGET_ARG_HSA_KERNEL_ATTRIBUTES): Likewise.
      
      From-SVN: r232549
      Martin Jambor committed
  24. 14 Jan, 2016 1 commit
  25. 13 Jan, 2016 1 commit
    • re PR target/68964 (Internal compiler error for test case gcc.dg/tm/20100610.c since r231674) · 4c868789
      PR 68964
      
      gcc/
       PR tree-opt/68964
       * target.def (builtin_tm_load, builtin_tm_store): Remove.
       * config/i386/i386.c (ix86_builtin_tm_load): Remove.
       (ix86_builtin_tm_store): Remove.
       (TARGET_VECTORIZE_BUILTIN_TM_LOAD): Remove.
       (TARGET_VECTORIZE_BUILTIN_TM_STORE): Remove.
       * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_TM_LOAD): Remove.
       (TARGET_VECTORIZE_BUILTIN_TM_STORE): Remove.
       * doc/tm.texi: Rebuild.
       * gtm-builtins.def (BUILT_IN_TM_MEMCPY_RNWT): New.
       (BUILT_IN_TM_MEMCPY_RTWN): New.
       * trans-mem.c (tm_log_emit_stmt): Rearrange code for better
       fallback from vector to integer helpers.
       (build_tm_load): Handle vector types directly, instead of
       via target hook.
       (build_tm_store): Likewise.
       (expand_assign_tm): Prepare for register types not handled by
       the above.  Copy them to memory and use memcpy.
       * tree.c (tm_define_builtin): New.
       (find_tm_vector_type): New.
       (build_tm_vector_builtins): New.
       (build_common_builtin_nodes): Call it.
      
      libitm/
       * Makefile.am (libitm_la_SOURCES) [ARCH_AARCH64]: Add vect128.cc
       (libitm_la_SOURCES) [ARCH_ARM]: Add neon.cc
       (libitm_la_SOURCES) [ARCH_PPC]: Add vect128.cc
       (libitm_la_SOURCES) [ARCH_S390]: Add vect128.cc
       * configure.ac (ARCH_AARCH64): New conditional.
       (ARCH_PPC, ARCH_S390): Likewise.
       * Makefile.in, configure: Rebuild.
       * libitm.h (_ITM_TYPE_M128): Always define.
       * vect64.cc: Split ...
       * vect128.cc: ... out of...
       * config/x86/x86_sse.cc: ... here.
       * config/arm/neon.cc: New file.
      
      From-SVN: r232330
      Richard Henderson committed
  26. 04 Jan, 2016 1 commit
  27. 23 Dec, 2015 1 commit
  28. 17 Dec, 2015 1 commit
  29. 15 Dec, 2015 1 commit
    • struct-layout-1_generate.c: Avoid generating further fields after the first flexible array member. · 7e9a3ad3
      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
      Martin Sebor committed
  30. 12 Dec, 2015 1 commit
  31. 07 Dec, 2015 1 commit
    • re PR lto/61886 (LTO breaks fread with _FORTIFY_SOURCE=2) · 71e54687
      	PR ipa/61886
      	* symtab.c (ultimate_transparent_alias_target): New inline function.
      	(symbol_table::assembler_names_equal_p): New method; break out from ...
      	(symbol_table::decl_assembler_name_equal): ... here.
      	(symbol_table::change_decl_assembler_name): Also update names and
      	translation links of transparent aliases.
      	(symtab_node::dump_base): Dump transparent_alias.
      	(symtab_node::verify_base): Implement basic transparent alias
      	verification.
      	(symtab_node::make_decl_local): Support localization of weakrefs;
      	recurse to transparent aliases; set TREE_STATIC.
      	(symtab_node::ultimate_alias_target_1): Handle visibility of
      	transparent aliases.
      	(symtab_node::resolve_alias): New parmaeter transparent; handle
      	transparent aliases; recurse to aliases of aliases to fix comdat
      	groups.
      	(symtab_node::get_partitioning_class): Handle transparent aliases.
      	* ipa-visibility.c (cgraph_externally_visible_p,
      	varpool_node::externally_visible_p): Visibility of transparent alias
      	depends on its target.
      	(function_and_variable_visibility): Do not tweak visibility of
      	transparent laiases.
      	(function_and_variable_visibility): Likewise.
      	* ipa.c (symbol_table::remove_unreachable_nodes): Clear
      	transparent_alias flag.
      	* alias.c (cgraph_node::create_alias, cgraph_node::get_availability):
      	Support transparent aliases.
      	* cgraph.h (symtab_node): Update prototype of resolve_alias;
      	add transparent_alias flag.
      	(symbol_table: Add assembler_names_equal_p.
      	(symtab_node::real_symbol_p): Skip transparent aliases.
      	* cgraphunit.c (cgraph_node::reset): Reset transparent_alias flag.
      	(handle_alias_pairs): Set transparent_alias for weakref.
      	(cgraph_node::assemble_thunks_and_aliases): Do not asemble transparent
      	aliases.
      	* lto-cgraph.c (lto_output_node): When outputting same_comdat_group
      	skip symbols not put into boundary; stream transparent_alias.
      	(lto_output_varpool_node): Likewise.
      	(input_overwrite_node, input_varpool_node): Stream transparent alias.
      	* varpool.c (ctor_for_folding, varpool_node::get_availability,
      	varpool_node::assemble_aliases,
      	symbol_table::remove_unreferenced_decls): Handle transparent aliase.
      	(varpool_node::create_alias): Set transparent_alias.
      
      	* lto-partition.c (add_symbol_to_partition_1, contained_in_symbol,
      	rename_statics, rename_statics): Handle transparent aliases.
      
      From-SVN: r231373
      Jan Hubicka committed
  32. 04 Dec, 2015 1 commit
    • C++ FE: expression ranges · e87eed2a
      gcc/ChangeLog:
      	* convert.c (convert_to_real_1): When converting from a
      	REAL_TYPE, preserve the location of EXPR in the result.
      	* tree.c (get_pure_location): Make non-static.
      	(set_source_range): Return the resulting location_t.
      	(make_location): New function.
      	* tree.h (get_pure_location): New decl.
      	(get_finish): New inline function.
      	(set_source_range): Convert return type from void to location_t.
      	(make_location): New decl.
      
      gcc/cp/ChangeLog:
      	* cp-tree.h (class cp_expr): New class.
      	(finish_parenthesized_expr): Convert return type and param to
      	cp_expr.
      	(perform_koenig_lookup): Convert return type and param from tree
      	to cp_expr.
      	(finish_increment_expr): Likewise.
      	(finish_unary_op_expr): Likewise.
      	(finish_id_expression): Likewise for return type.
      	(build_class_member_access_expr): Likewise for param.
      	(finish_class_member_access_expr): Likewise.
      	(build_x_unary_op): Likewise.
      	(build_c_cast): New decl.
      	(build_x_modify_expr): Convert return type from tree to cp_expr.
      	* cvt.c (cp_convert_and_check): When warning about conversions,
      	attempt to use the location of "expr" if available, otherwise
      	falling back to the old behavior of using input_location.
      	* name-lookup.c (lookup_arg_dependent_1): Convert return type from
      	tree to cp_expr.
      	(lookup_arg_dependent): Likewise; also for local "ret".
      	* name-lookup.h (lookup_arg_dependent): Likewise for return type.
      	* parser.c (cp_lexer_previous_token): Skip past purged tokens.
      	(struct cp_parser_expression_stack_entry): Convert field "lhs" to
      	cp_expr.
      	(cp_parser_identifier): Likewise for return type.  Use cp_expr
      	ctor to preserve the token's location.
      	(cp_parser_string_literal): Likewise, building up a meaningful
      	location for the case where a compound string literal is built by
      	concatentation.
      	(cp_parser_userdef_char_literal): Likewise for return type.
      	(cp_parser_userdef_numeric_literal): Likewise.
      	(cp_parser_statement_expr): Convert return type to cp_expr.
      	Generate a suitable location for the expr and return it via the
      	cp_expr ctor.
      	(cp_parser_fold_expression): Convert return type to cp_expr.
      	(cp_parser_primary_expression): Likewise, and for locals "expr",
      	"lam", "id_expression", "decl".
      	Use cp_expr ctor when parsing literals, to preserve the spelling
      	location of the token.  Preserve the locations of parentheses.
      	Preserve location when calling objc_lookup_ivar.
      	Preserve the location for "this" tokens.  Generate suitable
      	locations for "__builtin_va_arg" constructs and for
      	Objective C 2.0 dot-syntax.  Set the location for the result of
      	finish_id_expression.
      	(cp_parser_primary_expression): Convert return type from tree to
      	cp_expr.
      	(cp_parser_id_expression): Likewise.
      	(cp_parser_unqualified_id): Likewise.  Also for local "id".
      	(cp_parser_postfix_expression): Likewise, also for local
      	"postfix_expression".  Generate suitable locations for
      	C++-style casts, "_Cilk_spawn" constructs.  Convert local
      	"initializer" to cp_expr and use it to preserve the location of
      	compound literals.  Capture the location of the closing
      	parenthesis of a call site via
      	cp_parser_parenthesized_expression_list, and use it to build
      	a source range for a call.  Use cp_expr in ternary expression.
      	(cp_parser_postfix_dot_deref_expression): Convert param from tree to
      	cp_expr.  Generate and set a location.
      	(cp_parser_parenthesized_expression_list): Add "close_paren_loc"
      	out-param, and write back to it.
      	(cp_parser_unary_expression): Convert return type from tree to
      	cp_expr.  Also for locals "cast_expression" and "expression".
      	Generate and use suitable locations for addresses of
      	labels and for cast expressions.  Call cp_expr::set_location where
      	necessary.  Preserve the locations of negated numeric literals.
      	(cp_parser_new_expression): Generate meaningful locations/ranges.
      	(cp_parser_cast_expression): Convert return type from tree to
      	cp_expr; also for local "expr".  Use the paren location to generate a
      	meaningful range for the expression.
      	(cp_parser_binary_expression): Convert return type from tree to
      	cp_expr; also for local "rhs".  Generate a meaningful location
      	for the expression, and use it.  Replace call to
      	protected_set_expr_location by converting a build2 to a build2_loc
      	and using the location in the call to build_x_binary_op, adding a
      	cp_expr::set_location to the latter case.
      	(cp_parser_question_colon_clause): Convert param from tree to
      	cp_expr; also for local "assignment_expr".  Set the spelling range
      	of the expression.
      	(cp_parser_assignment_expression): Likewise for return type and
      	locals "expr" and "rhs".  Build a meaningful spelling range for
      	the expression.  Remove saving of input_location in favor of a
      	call to cp_expr::set_location.
      	(cp_parser_expression): Convert return type and locals
      	"expression" and "assignment_expression" to cp_expr.  Build a
      	meaningful spelling range for assignment expressions.
      	(cp_parser_constant_expression): Likewise for return type and
      	local "expression".
      	(cp_parser_builtin_offsetof): Convert return type and local "expr"
      	to cp_expr.  Generate suitable locations.
      	(cp_parser_lambda_expression): Convert return return type to
      	cp_expr.
      	(cp_parser_operator_function_id): Likewise.
      	(cp_parser_operator): Likewise.  Generate a meaningful range,
      	using cp_expr's ctor to return it.
      	(cp_parser_template_id): When converting a token to
      	CPP_TEMPLATE_ID, update the location.
      	(cp_parser_initializer_clause): Convert return type and local
      	"initializer" to cp_expr.
      	(cp_parser_braced_list): Likewise for return type.  Generate
      	suitable locations.
      	(cp_parser_lookup_name): Likewise for return type.  Use cp_expr's
      	ctor to preserve the location_t of the name.
      	(cp_parser_simple_cast_expression): Likewise for return type.
      	(cp_parser_functional_cast): Convert return type and local "cast"
      	to cp_expr.  Generate suitable locations.
      	(cp_parser_objc_expression): Convert return type to cp_expr.k  Generate
      	(cp_parser_objc_message_expression): Generate suitable locations.
      	(cp_parser_objc_encode_expression): Convert return type to
      	cp_expr.  Generate suitable locations.
      	(cp_parser_objc_protocol_expression): Generate suitable locations.
      	(cp_parser_objc_selector_expression): Generate suitable locations.
      	(cp_parser_omp_for_cond): Attempt to use the location
      	of "cond" for the binary op.
      	(cp_parser_transaction_expression): Issue the tm-not-enabled error
      	at the location of the __transaction_foo token, rather than at
      	input_location.
      	* semantics.c (finish_parenthesized_expr): Convert return type and
      	param to cp_expr.  Preserve location.
      	(perform_koenig_lookup): Likewise for return type
      	and param.
      	(finish_increment_expr): Likewise.  Generate suitable locations.
      	(finish_unary_op_expr): Likewise for return type and local "result".
      	Generate suitable locations.
      	(finish_id_expression): Convert return type to cp_expr and use
      	cp_expr ctor to preserve location information.
      	* typeck.c (build_class_member_access_expr): Convert param to
      	cp_expr.
      	(finish_class_member_access_expr): Likewise.
      	(cp_build_binary_op): Convert a build2 to a build2_loc.
      	(build_x_unary_op): Convert param from tree to cp_expr.
      	(build_nop): Preserve the location of EXPR.
      	(build_c_cast): Provide an overloaded variant that takes a cp_expr
      	and returns a cp_expr.
      	(build_x_modify_expr): Convert return type from tree to cp_expr.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/cpp0x/nsdmi-template14.C: Move dg-error directive.
      	* g++.dg/gomp/loop-1.C: Update dg-error locations.
      	* g++.dg/plugin/diagnostic-test-expressions-1.C: New file, adapted
      	from gcc.dg/plugin/diagnostic-test-expressions-1.c.
      	* g++.dg/plugin/plugin.exp (plugin_test_list): Add the above.
      	* g++.dg/template/crash55.C: Update dg-error directives.
      	* g++.dg/template/pseudodtor3.C: Update column numbers in dg-error
      	directives.
      	* g++.dg/template/pr64100.C: Update location of dg-error
      	directive.
      	* g++.dg/template/ref3.C: Add XFAIL (PR c++/68699).
      	* g++.dg/ubsan/pr63956.C: Update dg directives to reflect
      	improved location information.
      	* g++.dg/warn/pr35635.C (func3): Update location of a
      	dg-warning.
      	* g++.dg/warn/Wconversion-real-integer2.C: Update location of
      	dg-warning; add a dg-message.
      	* obj-c++.dg/plugin/diagnostic-test-expressions-1.mm: New file,
      	based on objc.dg/plugin/diagnostic-test-expressions-1.m.
      	* obj-c++.dg/plugin/plugin.exp: New file, based on
      	objc.dg/plugin/plugin.exp.
      
      From-SVN: r231293
      David Malcolm committed
  33. 02 Dec, 2015 3 commits
    • re PR c++/68653 (ICE: in nonnull_arg_p, at tree.c:13853) · d6221ad4
      	PR c++/68653
      	* tree.c (nonnull_arg_p): Allow OFFSET_TYPE.
      
      	* g++.dg/warn/nonnull3.C: New test.
      
      From-SVN: r231200
      Marek Polacek committed
    • tree.h (tree_invariant_p): Declare. · 7b2eca00
      2015-12-02  Richard Biener  <rguenther@suse.de>
      
      	* tree.h (tree_invariant_p): Declare.
      	* tree.c (tree_invariant_p): Export.
      	* genmatch.c (dt_simplify::gen_1): For GENERIC code-gen never
      	create SAVE_EXPRs but reject patterns if we would need to.
      
      From-SVN: r231178
      Richard Biener committed
    • PR 68432: Add a target hook to control size/speed optab choices · d95ab70a
      The problem in the PR is that some i386 optabs FAIL when
      optimising for size rather than speed.  The gimple level generally
      needs access to this information before calling the generator,
      so this patch adds a new hook to say whether an optab should
      be used when optimising for size or speed.  It also has a "both"
      option for cases where we want code that is optimised for both
      size and speed.
      
      I've passed the optab to the target hook because I think in most
      cases that's more useful than the instruction code.  We could pass
      both if there's a use for it though.
      
      At the moment the match-and-simplify code doesn't have direct access
      to the target block, so for now I've used "both" there.
      
      Tested on x86_64-linux-gnu and powerpc64-linux-gnu.
      
      gcc/
      	PR tree-optimization/68432
      	* coretypes.h (optimization_type): New enum.
      	* doc/tm.texi.in (TARGET_OPTAB_SUPPORTED_P): New hook.
      	* doc/tm.texi: Regenerate.
      	* target.def (optab_supported_p): New hook.
      	* targhooks.h (default_optab_supported_p): Declare.
      	* targhooks.c (default_optab_supported_p): New function.
      	* predict.h (function_optimization_type): Declare.
      	(bb_optimization_type): Likewise.
      	* predict.c (function_optimization_type): New function.
      	(bb_optimization_type): Likewise.
      	* optabs-query.h (convert_optab_handler): Define an overload
      	that takes an optimization type.
      	(direct_optab_handler): Likewise.
      	* optabs-query.c (convert_optab_handler): Likewise.
      	(direct_optab_handler): Likewise.
      	* internal-fn.h (direct_internal_fn_supported_p): Take an
      	optimization_type argument.
      	* internal-fn.c (direct_optab_supported_p): Likewise.
      	(multi_vector_optab_supported_p): Likewise.
      	(direct_internal_fn_supported_p): Likewise.
      	* builtins.c (replacement_internal_fn): Update call to
      	direct_internal_fn_supported_p.
      	* gimple-match-head.c (build_call_internal): Likewise.
      	* tree-vect-patterns.c (vect_recog_pow_pattern): Likewise.
      	* tree-vect-stmts.c (vectorizable_internal_function): Likewise.
      	* tree.c (maybe_build_call_expr_loc): Likewise.
      	* config/i386/i386.c (ix86_optab_supported_p): New function.
      	(TARGET_OPTAB_SUPPORTED_P): Define.
      	* config/i386/i386.md (asinxf2): Remove optimize_insn_for_size_p check.
      	(asin<mode>2, acosxf2, acos<mode>2, log1pxf2, log1p<mode>2)
      	(expNcorexf3, expxf2, exp<mode>2, exp10xf2, exp10<mode>2, exp2xf2)
      	(exp2<mode>2, expm1xf2, expm1<mode>2, ldexpxf3, ldexp<mode>3)
      	(scalbxf3, scalb<mode>3, rint<mode>2, round<mode>2)
      	(<rounding_insn>xf2, <rounding_insn><mode>2): Likewise.
      
      gcc/testsuite/
      	* gcc.target/i386/pr68432-1.c: New test.
      	* gcc.target/i386/pr68432-2.c: Likewise.
      	* gcc.target/i386/pr68432-3.c: Likewise.
      
      From-SVN: r231161
      Richard Sandiford committed
  34. 25 Nov, 2015 1 commit
  35. 24 Nov, 2015 1 commit
    • alias.c (get_alias_set): Before checking TYPE_ALIAS_SET_KNOWN_P double check… · ba6a6a1d
      alias.c (get_alias_set): Before checking TYPE_ALIAS_SET_KNOWN_P double check that type is main variant.
      
      
      	* alias.c (get_alias_set): Before checking TYPE_ALIAS_SET_KNOWN_P
      	double check that type is main variant.
      	* tree.c (build_variant_type_copy): Clear TYPE_ALIAS_SET when producing
      	variant.
      	(verify_type_variant): Verify that variants have no
      	TYPE_ALIAS_SET_KNOWN_P set
      	* tree-streamer-out.c (pack_ts_type_common_value_fields): Reorder
      	streaming so constant fields come first; stream TYPE_ALIAS_SET==0
      	only for main variants; stream TYPE_ALIAS_SET as a bit.
      	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Update
      	accordingly.
      
      From-SVN: r230838
      Jan Hubicka committed