Commit Graph

146553 Commits

Author SHA1 Message Date
Bernd Schmidt 73d73b4803 re PR debug/71432 (-fcompare-debug failure (length))
PR debug/71432
	PR ada/71413
	* tree-ssa-strlen.c (handle_builtin_memcmp): Ignore debug insns.

	* g++.dg/debug/pr71432.C: New test.

From-SVN: r237208
2016-06-08 11:41:54 +00:00
Prathamesh Kulkarni bdd15d0c8e section-anchors-vect-70.c: Rename to aligned-section-anchors-vect-71.c.
2016-06-08  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* gcc.dg/vect/section-anchors-vect-70.c: Rename to aligned-section-anchors-vect-71.c.
	* gcc.dg/vect/section-anchors-vect-71.c: Rename to aligned-section-anchors-vect-72.c.
	* gcc.dg/vect/section-anchors-vect-72.c: Rename to aligned-section-anchors-vect-72.c.

From-SVN: r237207
2016-06-08 11:15:17 +00:00
Richard Biener a80a705181 c-common.c (parse_optimize_options): Improve diagnostic messages.
2016-06-08  Richard Biener  <rguenther@suse.de>

	* c-common.c (parse_optimize_options): Improve diagnostic messages.

From-SVN: r237206
2016-06-08 10:26:54 +00:00
Jiong Wang 3629030e36 [AArch64, 6/6] Reimplement vpadd intrinsics & extend rtl patterns to all modes
* config/aarch64/aarch64-builtins.def (faddp): New builtins for modes in
	VDQF.
	* config/aarch64/aarch64-simd.md (aarch64_faddp<mode>): New.
	(arch64_addpv4sf): Delete.
	(reduc_plus_scal_v4sf): Use "gen_aarch64_faddpv4sf" instead of
	"gen_aarch64_addpv4sf".
	* config/aarch64/arm_neon.h (vpadd_f32): Remove inline assembly.  Use
	builtin.
	(vpadds_f32): Likewise.
	(vpaddq_f32): Likewise.
	(vpaddq_f64): Likewise.

From-SVN: r237205
2016-06-08 10:17:58 +00:00
Jiong Wang a672fa1247 [AArch64, 5/6] Reimplement fabd intrinsics & merge rtl patterns
* config/aarch64/aarch64-builtins.def (fabd): New builtins for modes
	VALLF.
	* config/aarch64/aarch64-simd.md (fabd<mode>_3): Extend modes from VDQF
	to VALLF.  Rename to "fabd<mode>3".
	"*fabd_scalar<mode>3): Delete.
	* config/aarch64/arm_neon.h (vabds_f32): Remove inline assembly.
	Use builtin.
	(vabdd_f64): Likewise.
	(vabd_f32): Likewise.
	(vabd_f64): Likewise.
	(vabdq_f32): Likewise.
	(vabdq_f64): Likewise.

From-SVN: r237204
2016-06-08 10:16:07 +00:00
Jiong Wang 00ea75d4e2 [AArch64, 4/6] Reimplement frsqrts intrinsics
* config/aarch64/aarch64-builtins.def (rsqrts): New builtins for modes
	VALLF.
	* config/aarch64/aarch64-simd.md (aarch64_rsqrts_<mode>3): Rename to
	"aarch64_rsqrts<mode>".
	* config/aarch64/aarch64.c (get_rsqrts_type): Update gen* name.
	* config/aarch64/arm_neon.h (vrsqrtss_f32): Remove inline assembly.  Use
	builtin.
	(vrsqrtsd_f64): Likewise.
	(vrsqrts_f32): Likewise.
	(vrsqrts_f64): Likewise.
	(vrsqrtsq_f32): Likewise.
	(vrsqrtsq_f64): Likewise.

From-SVN: r237203
2016-06-08 10:14:30 +00:00
Jiong Wang 2a82343319 [AArch64, 3/6] Reimplement frsqrte intrinsics
* config/aarch64/aarch64-builtins.def (rsqrte): New builtins for modes
	VALLF.
	* config/aarch64/aarch64-simd.md (aarch64_rsqrte_<mode>2): Rename to
	"aarch64_rsqrte<mode>".
	* config/aarch64/aarch64.c (get_rsqrte_type): Update gen* name.
	* config/aarch64/arm_neon.h (vrsqrts_f32): Remove inline assembly.  Use
	builtin.
	(vrsqrted_f64): Likewise.
	(vrsqrte_f32): Likewise.
	(vrsqrte_f64): Likewise.
	(vrsqrteq_f32): Likewise.
	(vrsqrteq_f64): Likewise.

From-SVN: r237202
2016-06-08 10:12:53 +00:00
Jiong Wang 2644d4d983 [AArch64, 2/6] Reimplement vector fixed-point intrinsics
* config/aarch64/aarch64-builtins.def (scvtf): Register vector modes.
	(ucvtf): Likewise.
	(fcvtzs): Likewise.
	(fcvtzu): Likewise.
	* config/aarch64/aarch64-simd.md
	(<FCVT_F2FIXED:fcvt_fixed_insn><VDQF:mode>3): New.
	(<FCVT_FIXED2F:fcvt_fixed_insn><VDQ_SDI:mode>3): Likewise.
	* config/aarch64/arm_neon.h (vcvt_n_f32_s32): Remove inline assembly.
	Use builtin.
	(vcvt_n_f32_u32): Likewise.
	(vcvt_n_s32_f32): Likewise.
	(vcvt_n_u32_f32): Likewise.
	(vcvtq_n_f32_s32): Likewise.
	(vcvtq_n_f32_u32): Likewise.
	(vcvtq_n_f64_s64): Likewise.
	(vcvtq_n_f64_u64): Likewise.
	(vcvtq_n_s32_f32): Likewise.
	(vcvtq_n_s64_f64): Likewise.
	(vcvtq_n_u32_f32): Likewise.
	(vcvtq_n_u64_f64): Likewise.
	* config/aarch64/iterators.md (VDQ_SDI): New mode iterator.
	(VSDQ_SDI): Likewise.
	(fcvt_target): Support V4DI, V4SI and V2SI.
	(FCVT_TARGET): Likewise.

From-SVN: r237201
2016-06-08 10:11:09 +00:00
Jiong Wang 3f598afe16 [AArch64, 1/6] Reimplement scalar fixed-point intrinsics
* config/aarch64/aarch64-builtins.c (TYPES_BINOP_USS): New
        (TYPES_BINOP_SUS): Likewise.
        (aarch64_simd_builtin_data): Update include file name.
        (aarch64_builtins): Likewise.
        * config/aarch64/aarch64-simd-builtins.def (scvtf): New entries
        for conversion between scalar float-point and fixed-point.
        (ucvtf): Likewise.
        (fcvtzs): Likewise.
        (fcvtzu): Likewise.
        * config/aarch64/aarch64.md
        (<FCVT_F2FIXED:fcvt_fixed_insn><GPF:mode>3: New
        pattern for conversion between scalar float to fixed-pointer.
        (<FCVT_FIXED2F:fcvt_fixed_insn><GPI:mode>: Likewise.
        (UNSPEC_FCVTZS): New UNSPEC enumeration.
        (UNSPEC_FCVTZU): Likewise.
        (UNSPEC_SCVTF): Likewise.
        (UNSPEC_UCVTF): Likewise.
        * config/aarch64/arm_neon.h (vcvtd_n_f64_s64): Remove inline assembly.
	Use builtin.
        (vcvtd_n_f64_u64): Likewise.
        (vcvtd_n_s64_f64): Likewise.
        (vcvtd_n_u64_f64): Likewise.
        (vcvtd_n_f32_s32): Likewise.
        (vcvts_n_f32_u32): Likewise.
        (vcvtd_n_s32_f32): Likewise.
        (vcvts_n_u32_f32): Likewise.
        * config/aarch64/iterators.md (fcvt_target): Support integer to float
	mapping.
        (FCVT_TARGET): Likewise.
        (FCVT_FIXED2F): New iterator.
        (FCVT_F2FIXED): Likewise.
        (fcvt_fixed_insn): New define_int_attr.

From-SVN: r237200
2016-06-08 10:07:30 +00:00
Jan Hubicka cd1d802aed predict.c (pass_strip_predict_hints::execute): Cleanup CFG if some statements was removed.
* predict.c (pass_strip_predict_hints::execute): Cleanup CFG if
	some statements was removed.

From-SVN: r237199
2016-06-08 09:39:33 +00:00
Alan Hayward 15bdf5be1a tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline.
2016-06-08  Alan Hayward  <alan.hayward@arm.com>

gcc/
	* tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline.
	* tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): likewise.
	(vect_can_advance_ivs_p): likewise.
	(vect_update_ivs_after_vectorizer): likewise.
	* tree-vect-loop.c (vect_determine_vectorization_factor): likewise.
	(vect_analyze_scalar_cycles_1): likewise.
	(vect_analyze_loop_operations): likewise.
	(report_vect_op): likewise.
	(vect_is_slp_reduction): likewise.
	(vect_is_simple_reduction): likewise.
	(get_initial_def_for_induction): likewise.
	(vect_transform_loop): likewise.
	* tree-vect-patterns.c (vect_recog_dot_prod_pattern): likewise.
	(vect_recog_sad_pattern): likewise.
	(vect_recog_widen_sum_pattern): likewise.
	(vect_recog_widening_pattern): likewise.
	(vect_recog_divmod_pattern): likewise.
	* tree-vect-slp.c (vect-build-slp_tree_1): likewise.
	(vect_analyze_slp_instance): likewise.
	(vect_transform_slp_perm_load): likewise.
	(vect_schedule_slp_instance): likewise.

From-SVN: r237198
2016-06-08 08:38:50 +00:00
Alan Hayward ce0607bbcd vect-live-2.c: Update effective target.
2016-06-08  Alan Hayward  <alan.hayward@arm.com>

gcc/testsuite/
	* gcc.dg/vect/vect-live-2.c: Update effective target.
	* gcc.dg/vect/vect-live-slp-3.c: Likewise.
	* lib/target-supports.exp: Add aarch64 to vect_long.

From-SVN: r237197
2016-06-08 08:26:38 +00:00
Marek Polacek 08203f73d1 re PR c/71426 (gcc ICE on x86_64-linux-gnu in get_parm_info, at c/c-decl.c:7059)
PR c/71426
	* c-decl.c (get_parm_info): Don't crash on an assert on invalid
	code.

	* gcc.dg/noncompile/pr71426.c: New test.

From-SVN: r237196
2016-06-08 06:41:55 +00:00
Marek Polacek 92a5f2bae5 re PR c/71418 (gcc ICE on x86_64-linux-gnu in min_align_of_type, at stor-layout.c:2402)
PR c/71418
	* c-decl.c (grokdeclarator): Check TYPE_P.

	* gcc.dg/noncompile/pr71418.c: New test.

From-SVN: r237195
2016-06-08 06:39:10 +00:00
GCC Administrator 6c40eb0091 Daily bump.
From-SVN: r237194
2016-06-08 00:16:22 +00:00
Jan Hubicka d1fcc2bdef predict.c (predict_iv_comparison): Mention that heuristics is broken.
* predict.c (predict_iv_comparison): Mention that heuristics is broken.
	(return_prediction): PRED_CONST_RETURN predict return as not taken.
	* predict.def (PRED_CONTINUE): Change hitrate 50->67
	(PRED_LOOP_BRANCH): Document predictor as broken.
	(PRED_LOOP_EXIT): Change hitrate 91->92.
	(PRED_LOOP_EXTRA_EXIT): Change hitrate 91->83.
	(PRED_POINTER, PRED_TREE_POINTER): Change hitrate 85->70.
	(PRED_OPCODE_POSITIVE): Change hitrate 79->64.
	(PRED_OPCODE_NONEQUAL): Change hitrate 91->66.
	(PRED_TREE_OPCODE_POSITIVE): Change hitrate 73->64
	(PRED_TREE_OPCODE_NONEQUAL): Chnage hitrate 72->66
	(PRED_CALL): Chane hitrate 71->67.
	(PRED_TREE_EARLY_RETURN): Document issues, change hitrate 61->54.
	(PRED_GOTO): Document as unused right now.
	(PRED_CONST_RETURN): Change hitrate 67->69
	(PRED_NEGATIVE_RETURN): Change hitrate 96->98
	(PRED_NULL_RETURN): Change hitrate 91->90.
	(PRED_LOOP_IV_COMPARE_GUESS): Change hitrate to 98.
	(PRED_FORTRAN_FAIL_ALLOC): Change hitrate to 62; document issues.
	(PRED_FORTRAN_SIZE_ZERO): Change hitrate to 99.
	* gcc.dg/ipa/inlinehint-4.c: Disable partial inlining.
	* gcc.dg/predict-1.c: Update template for new predictor hitrates.
	* gcc.dg/predict-3.c: Update template.
	* gcc.dg/predict-5.c: Update template.
	* gcc.dg/predict-6.c: Update template.
	* gcc.dg/predict-9.c: Update template.
	* gcc.dg/predict-9.c: Update template.
	* gcc.dg/tree-ssa/attr-hotcold-2.c: Update template.

From-SVN: r237185
2016-06-07 21:34:27 +00:00
François Dumont 373c00952c tuple (_Head_base<>): Default specialization condition at type declaration.
2016-06-07  François Dumont  <fdumont@gcc.gnu.org>

	* include/std/tuple (_Head_base<>): Default specialization condition at
	type declaration.

From-SVN: r237184
2016-06-07 20:19:19 +00:00
Bill Seurer a23e6f1c59 This patch adds support for the missing versions of the vec_mul altivec...
This patch adds support for the missing versions of the vec_mul altivec
builtins from the Power Architecture 64-Bit ELF V2 ABI OpenPOWER ABI for
Linux Supplement (16 July 2015 Version 1.1). There are many of the builtins
that are missing and this is part of a series of patches to add them.

There aren't instructions for the {un}signed char, {un}signed short, and
{un}signed int versions of vec_mul so the output code is built from other
built-ins and operations that do have instructions.

The new test case is an executable test which verifies that the generated
code produces expected values. C macros were used so that the same
test case could be used for all the various supported types.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu and
powerpc64-unknown-linux-gnu with no regressions. Is this ok for trunk?

[gcc]

2016-06-07  Bill Seurer  <seurer@linux.vnet.ibm.com>

	* config/rs6000/altivec.h: Add __builtin_vec_mul.
	* config/rs6000/rs6000-builtin.def (vec_mul): Change vec_mul to a
	special case Altivec builtin.
	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Remove
	VSX_BUILTIN_VEC_MUL (replaced with special case code).
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Add
	code for ALTIVEC_BUILTIN_VEC_MUL.
	* config/rs6000/rs6000.c (altivec_init_builtins): Add definition
	for __builtin_vec_mul.

[gcc/testsuite]

2016-06-07  Bill Seurer  <seurer@linux.vnet.ibm.com>

	* gcc.target/powerpc/vec-mul.c: New test.

From-SVN: r237183
2016-06-07 20:18:09 +00:00
Peter Bergner ca51b2afc6 invoke.texi (RS/6000 and PowerPC Options): Document -mhtm and -mno-htm.
* doc/invoke.texi (RS/6000 and PowerPC Options): Document -mhtm and
	-mno-htm.

From-SVN: r237182
2016-06-07 13:50:04 -05:00
David Malcolm 484b59c482 spellcheck.c: add test_find_closest_string
gcc/ChangeLog:
	* spellcheck.c (selftest::test_find_closest_string): New function.
	(spellcheck_c_tests): Call the above.

From-SVN: r237181
2016-06-07 17:33:04 +00:00
Kyrylo Tkachov e10183dce1 [simplify-rtx] Fix unused variable warning in simplify_cond_clz_ctz on some targets
* simplify-rtx.c (simplify_cond_clz_ctz): Delete 'mode' local
	variable.

From-SVN: r237180
2016-06-07 16:52:20 +00:00
David Malcolm 6ffd47b70a C: add fixit hint to misspelled field names
gcc/c/ChangeLog:
	* c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
	and structure element reference, capture the location of the
	element name token and pass it to build_component_ref.
	(c_parser_postfix_expression_after_primary): Likewise for
	structure element dereference.
	(c_parser_omp_variable_list): Likewise for
	OMP_CLAUSE_{_CACHE, MAP, FROM, TO},
	* c-tree.h (build_component_ref): Add location_t param.
	* c-typeck.c (build_component_ref): Add location_t param
	COMPONENT_LOC.  Use it, if available, when issuing hints about
	mispelled member names to provide a fixit replacement hint.

gcc/objc/ChangeLog:
	* objc-act.c (objc_build_component_ref): Update call
	to build_component_ref for added param, passing UNKNOWN_LOCATION.

gcc/testsuite/ChangeLog:
	* gcc.dg/spellcheck-fields-2.c: New test case.

From-SVN: r237176
2016-06-07 15:04:22 +00:00
Jakub Jelinek 0f471dc3e8 sse.md (avx_vec_concat<mode>): Add v=v,vm and Yv=Yv,C alternatives.
* config/i386/sse.md (avx_vec_concat<mode>): Add v=v,vm and
	Yv=Yv,C alternatives.

From-SVN: r237175
2016-06-07 15:00:03 +02:00
Richard Biener bfd67b4731 re PR c++/61564 (#pragma GCC optimize ("-fno-lto") causes the compiler to crash)
2016-06-07  Richard Biener  <rguenther@suse.de>

	PR c/61564
	* c-common.c (parse_optimize_options): Only apply CL_OPTIMIZATION
	options and warn about others.
	* common.opt (ffast-math): Make Optimization.

	* gcc.dg/Wpragmas-1.c: New testcase.
	* gcc.dg/Wattributes-4.c: Likewise.
	* gcc.dg/ipa/pr70646.c: Drop optimize pragma in favor of dg-option
	entry.

From-SVN: r237174
2016-06-07 12:41:46 +00:00
Simon Dardis 6dc0465867 [MIPS] P5600 scheduler fix
gcc/
	* config/mips/p5600.md (p5600_fpu_fadd): Remove checking for
	`fabs' and `fneg' type attributes.
	(p5600_fpu_fabs): Add `fmove' to the comment.

Co-Authored-By: Prachi Godbole <prachi.godbole@imgtec.com>

From-SVN: r237173
2016-06-07 11:56:43 +00:00
Jan Hubicka ce120587f3 gimple.c: Include builtins.h
* gimple.c: Include builtins.h
	(gimple_inexpensive_call_p): New function.
	* gimple.h (gimple_inexpensive_call_p): Declare.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use it.
	* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise;
	fix formatting.

From-SVN: r237172
2016-06-07 11:22:26 +00:00
Christophe Lyon 701b9a47bd p64_p128.c: Remove spurious debug code.
* gcc.target/aarch64/advsimd-intrinsics/p64_p128.c: Remove spurious debug code.

From-SVN: r237171
2016-06-07 12:29:55 +02:00
Rainer Orth c87885ca4f Remove wrong testsuite and gcc/testsuite prefixes from gcc/testsuite/ChangeLog.
From-SVN: r237170
2016-06-07 09:24:21 +00:00
Rainer Orth 48eae47289 Update copyright dates
libcc1:
	Update copyrights.

	gotools:
	Update copyrights.

	contrib:
	* update-copyright.py (LibMudflapFilter): Remove.
	(GCCCmdLine.__init__): Add gotools, libcc1.
	Remove libmudflap.
	List unhandled intl, libcilkrts, libgo, liboffloadmic,
	maintainer-scripts.

From-SVN: r237169
2016-06-07 08:54:22 +00:00
Paolo Carlini c381174498 diagnostic.c (diagnostic_impl, [...]): New.
2016-06-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* diagnostic.c (diagnostic_impl, diagnostic_n_impl): New.
	(inform, inform_at_rich_loc, inform_n, warning, warning_at,
	warning_at_rich_loc, warning_n, pedwarn, permerror,
	permerror_at_rich_loc, error, error_n, error_at, error_at_rich_loc,
	sorry, fatal_error, internal_error, internal_error_no_backtrace):
	Use the above.

From-SVN: r237168
2016-06-07 07:36:02 +00:00
Richard Biener 6b80d6fa72 re PR tree-optimization/71428 (wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump))
2016-06-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71428
	* tree-ssa-math-opts.c (perform_symbolic_merge): Properly distinguish
	BIT_FIELD_REF op vs. load.

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

From-SVN: r237167
2016-06-07 07:31:40 +00:00
Richard Biener 0f3f94375a re PR tree-optimization/71423 (wrong code at -Os and above on x86_64-linux-gnu)
2016-06-07  Richard Biener  <rguenther@suse.de>

	PR middle-end/71423
	* match.pd ((X | ~Y) -> Y <= X): Properly invert the comparison
	for signed ops.

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

From-SVN: r237166
2016-06-07 07:30:47 +00:00
John David Anglin df32c0b335 pa.md (call): Generate indirect long calls to non-local functions on TARGET_64BIT.
* config/pa/pa.md (call): Generate indirect long calls to non-local
	functions on TARGET_64BIT.
	(call_value): Likewise.

From-SVN: r237164
2016-06-07 01:56:01 +00:00
John David Anglin 6552d0dd54 pa.md (call_val_reg_64bit): Remove "reg: DI " clobber from pattern and subsequent splitters.
* config/pa/pa.md (call_val_reg_64bit): Remove "reg: DI " clobber from
	pattern and subsequent splitters.
	(call_val_reg_64bit_post_reload): Likewise.

From-SVN: r237163
2016-06-07 01:43:14 +00:00
GCC Administrator 6965374210 Daily bump.
From-SVN: r237162
2016-06-07 00:16:21 +00:00
Kugan Vivekanandarajah ec963f2ae5 re PR tree-optimization/71408 (wrong code at -Os and above on x86_64-linux-gnu)
gcc/ChangeLog:

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

	PR middle-end/71408
	* tree-ssa-reassoc.c (zero_one_operation): Fix NEGATE_EXPR operand for
	propagate_op_to_single_use.


gcc/testsuite/ChangeLog:

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

	PR middle-end/71408
	* gcc.dg/tree-ssa/pr71408.c: New test.

From-SVN: r237158
2016-06-06 23:46:11 +00:00
Kugan Vivekanandarajah 46ab5b6ede re PR target/71281 (ICE on gcc trunk on knl, wsm, ivb and bdw targets (tree-ssa-reassoc))
gcc/ChangeLog:

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

	PR middle-end/71281
	* tree-ssa-reassoc.c (reassociate_bb): Set uid for negate stmt.


gcc/testsuite/ChangeLog:

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

	PR middle-end/71281
	* g++.dg/torture/pr71281.C: New test.

From-SVN: r237157
2016-06-06 23:41:26 +00:00
Uros Bizjak c7ca8ef875 i386.h (enum ix86_enitity): Add X86_DIRFLAG.
* config/i386/i386.h (enum ix86_enitity): Add X86_DIRFLAG.
	(enum x86_dirflag_state): New enum.
	(NUM_MODES_FOR_MODE_SWITCHING): Add X86_DIRFLAG_ANY.
	(machine_function): Remove needs_cld.
	(ix86_current_function_needs_cld): Remove.
	* config/i386/i386.c (ix86_set_func_type): Set
	ix86_optimize_mode_switching[X86_DIRFLAG] to 1.
	(ix86_expand_prologue): Do not emit CLD here.
	(ix86_dirflag_mode_needed): New function.
	(ix86_dirflag_mode_entry): Ditto.
	(ix86_mode_needed): Handle X86_DIRFLAG entity.
	(ix86_mode_after): Ditto.
	(ix86_mode_entry): Ditto.
	(ix86_mode_exit): Ditto.
	(ix86_emit_mode_set): Ditto.
	* config/i386/i386.md (strmov_singleop): Set
	ix86_optimize_mode_switching[X86_DIRFLAG] to 1 for TARGET_CLD.
	Do not set ix86_current_function_needs_cld.
	(rep_mov): Ditto.
	(strset_singleop): Ditto.
	(rep_stos): Ditto.
	(cmpstrnqi_nz_1): Ditto.
	(cmpstrnqi_1): Ditto.
	(strlenqi_1): Ditto.

From-SVN: r237156
2016-06-07 00:35:18 +02:00
Marek Polacek 1f40cff379 re PR c/71362 (Wrong position for "error: size of unnamed array is negative")
PR c/71362
	* c-parser.c (c_parser_direct_declarator): Set location.

	* gcc.dg/pr71362.c: New test.

From-SVN: r237155
2016-06-06 21:15:07 +00:00
Jakub Jelinek 6f5bcd2400 re PR c++/70847 (exponential time in cp_fold for chained virtual function calls)
PR c++/70847
	PR c++/71330
	PR c++/71393
	* cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
	right after cp_fold call if cp_fold has returned the same stmt
	already in some earlier cp_fold_r call.
	(cp_fold_function): Add pset automatic variable, pass its address
	to cp_walk_tree.

	* g++.dg/opt/pr70847.C: New test.
	* g++.dg/ubsan/pr70847.C: New test.
	* g++.dg/ubsan/pr71393.C: New test.

Co-Authored-By: Patrick Palka <ppalka@gcc.gnu.org>

From-SVN: r237151
2016-06-06 21:48:22 +02:00
Jakub Jelinek 158beb4ab3 re PR tree-optimization/71259 (GCC trunk emits wrong code)
PR tree-optimization/71259
	* tree-vect-slp.c (vect_get_constant_vectors): For
	VECTOR_BOOLEAN_TYPE_P, return all ones constant instead of
	one for constant op, and use COND_EXPR for non-constant.

	* gcc.dg/vect/pr71259.c: New test.

From-SVN: r237147
2016-06-06 20:35:03 +02:00
Joseph Myers 8af8321074 * fr.po: Update.
From-SVN: r237145
2016-06-06 18:39:12 +01:00
David Malcolm d9b950dd44 Selftest framework
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
2016-06-06 17:11:30 +00:00
Ville Voutilainen dbc6221fe5 Support allocators in tuples of zero size.
* include/std/tuple (tuple<>::tuple(),
	tuple<>::tuple(allocator_arg_t, const _Alloc&),
	tuple<>::tuple(allocator_arg_t, const _Alloc&, const tuple&)): New.
	* testsuite/20_util/tuple/cons/allocators.cc: Adjust.

From-SVN: r237143
2016-06-06 19:28:59 +03:00
Kyrylo Tkachov 36f9ad6933 [3/3][RTL ifcvt] PR middle-end/37780: Conditional expression with __builtin_clz() should be optimized out
PR middle-end/37780
	* ifcvt.c (noce_try_ifelse_collapse): New function.
	Declare prototype.
	(noce_process_if_block): Call noce_try_ifelse_collapse.
	* simplify-rtx.c (simplify_cond_clz_ctz): New function.
	(simplify_ternary_operation): Use the above to simplify
	conditional CLZ/CTZ expressions.

	* gcc.c-torture/execute/pr37780.c: New test.
	* gcc.target/aarch64/pr37780_1.c: Likewise.
	* gcc.target/arm/pr37780_1.c: Likewise.

From-SVN: r237141
2016-06-06 16:06:05 +00:00
Kyrylo Tkachov e8536e2b9f [2/3][AArch64] Keep CTZ components together until after reload
PR middle-end/37780
	* config/aarch64/aarch64.md (ctz<mode>2): Convert to
	define_insn_and_split.

From-SVN: r237139
2016-06-06 16:01:47 +00:00
Kyrylo Tkachov 3295b529d2 [1/3][ARM] Keep ctz expressions together until after reload
PR middle-end/37780
	* config/arm/arm.md (ctzsi2): Convert to define_insn_and_split.

From-SVN: r237138
2016-06-06 15:59:48 +00:00
Marek Polacek 5545a90715 c-typeck.c (comptypes_internal): Handle comparisons of INTEGER_TYPE, FIXED_POINT_TYPE, and REAL_TYPE nodes.
* c-typeck.c (comptypes_internal): Handle comparisons of
	INTEGER_TYPE, FIXED_POINT_TYPE, and REAL_TYPE nodes.  Don't check
	TYPE_REF_CAN_ALIAS_ALL.

	* c-c++-common/attr-may-alias-1.c: New test.
	* c-c++-common/attr-may-alias-2.c: New test.
	* gcc.dg/pr39464.c: Turn dg-warning into dg-bogus.

From-SVN: r237137
2016-06-06 15:50:23 +00:00
Jonathan Wakely 94229fb6dc libstdc++/71320 Add or remove file permissions correctly
PR libstdc++/71320
	* src/filesystem/ops.cc (permissions(const path&, perms, error_code&)):
	Add or remove permissions according to perms argument.
	* testsuite/experimental/filesystem/operations/permissions.cc: New
	test.

From-SVN: r237136
2016-06-06 16:50:01 +01:00
Aaron Conole 0a0ec53d12 re PR bootstrap/71400 (profiledbootstrap failed)
PR libgcc/71400
	* libgcov-driver-system.c (__gcov_error_file): Disable if IN_GCOV_TOOL.
	(get_gcov_error_file): Check __gcov_error_file before trying to
	initialize it.
	(gcov_error): Always use get_gcov_error_file.

Co-Authored-By: Nathan Sidwell <nathan@acm.org>

From-SVN: r237135
2016-06-06 15:24:24 +00:00