PR libstdc++/57440
	* config/os/mingw32/os_defines.h (_GTHREAD_USE_MUTEX_INIT_FUNC):
	Define to avoid leak.
	* config/os/mingw32-w64/os_defines.h: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216212 138bc75d-0d04-0410-961f-82ee72b054a4
Fix sanitizer build on sparc.

	* sanitizer_common/sanitizer_platform_limits_linux.cc (time_t):
	Define at __kernel_time_t, as needed for sparc.
	(struct __old_kernel_stat): Don't check if __sparc__ is defined.
	* libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer): Define struct___old_kernel_stat_sz,
	struct_kernel_stat_sz, and struct_kernel_stat64_sz for sparc.
	(__sanitizer_ipc_perm): Adjust for sparc targets.
	(__sanitizer_shmid_ds): Likewsie.
	(__sanitizer_sigaction): Likewsie.
	(IOC_SIZE): Likewsie.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216219 138bc75d-0d04-0410-961f-82ee72b054a4
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216227 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-15  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2014-08-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/62031
	* tree-data-ref.c (dr_analyze_indices): Do not set
	DR_UNCONSTRAINED_BASE.
	(dr_may_alias_p): All indirect accesses have to go the
	formerly DR_UNCONSTRAINED_BASE path.
	* tree-data-ref.h (struct indices): Remove
	unconstrained_base member.
	(DR_UNCONSTRAINED_BASE): Remove.

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


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216236 138bc75d-0d04-0410-961f-82ee72b054a4
	* stor-layout.c (self_referential_size): Do not promote arguments.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216250 138bc75d-0d04-0410-961f-82ee72b054a4
	PR c++/63455
	Revert:
	* parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
	committed to this tentative parse.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216261 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-15  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/63448
	* lra-int.h (LRA_MAX_CONSTRAINT_ITERATION_NUMBER): Remove.
	(LRA_MAX_ASSIGNMENT_ITERATION_NUMBER): New.
	(LRA_MAX_INHERITANCE_PASSES): Use it.
	(lra_constraint_iter_after_spill): Remove.
	(lra_assignment_iter): New.
	(lra_assignment_iter_after_spill): New.
	* lra-assigns.c (lra_assignment_iter): New.
	(lra_assignment_iter_after_spill): New.
	(former_reload_pseudo_spill_p): New.
	(spill_for): Set up former_reload_pseudo_spill_p.
	(setup_live_pseudos_and_spill_after_risky): Ditto.
	(assign_by_spills): Ditto.
	(lra_assign): Increment lra_assignment_iter.  Print the iteration
	number.  Reset former_reload_pseudo_spill_p.  Check
	lra_assignment_iter_after_spill.
	* lra.c (lra): Remove lra_constraint_iter_after_spill.  Initialize
	lra_assignment_iter and lra_assignment_iter_after_spill.
	* lra-constraints.c (lra_constraint_iter_after_spill): Remove.
	(lra_constraints): Remove code with
	lra_assignment_iter_after_spill.

2014-10-15  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/63448
	* gcc.target/i386/pr63448.c: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216271 138bc75d-0d04-0410-961f-82ee72b054a4
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216294 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-05-14  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61100

	* Makefile.am (nodist_saninclude_HEADERS): Install
	public headers.
	* Makefile.in: Regenerate.

	* c-c++-common/asan/asan-interface-1.c: New test.
	* lib/asan-dg.exp (asan_include_flags): New function.
	(asan_init): Call asan_include_flags to obtain path
	to sanitizer headers.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216322 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-05-30  Jakub Jelinek  <jakub@redhat.com>

	* sanitizer.def (BUILT_IN_ASAN_REPORT_LOAD_N,
	BUILT_IN_ASAN_REPORT_STORE_N): New.
	* asan.c (struct asan_mem_ref): Change access_size type to
	HOST_WIDE_INT.
	(asan_mem_ref_init, asan_mem_ref_new, get_mem_refs_of_builtin_call,
	update_mem_ref_hash_table): Likewise.
	(asan_mem_ref_hasher::hash): Hash in a HWI.
	(report_error_func): Change size_in_bytes argument to HWI.
	Use *_N builtins if size_in_bytes is larger than 16 or not power of
	two.
	(build_shadow_mem_access): New function.
	(build_check_stmt): Use it.  Change size_in_bytes argument to HWI.
	Handle size_in_bytes not power of two or larger than 16.
	(instrument_derefs): Don't give up if size_in_bytes is not
	power of two or is larger than 16.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216323 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-05-30  Jakub Jelinek  <jakub@redhat.com>

	* asan.c (report_error_func): Add SLOW_P argument, use
	BUILT_IN_ASAN_*_N if set.
	(build_check_stmt): Likewise.
	(instrument_derefs): If T has insufficient alignment,
	force same handling as for odd sizes.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216325 138bc75d-0d04-0410-961f-82ee72b054a4
New asan-instrumentation-with-call-threshold
 parameter.

2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-06-16  Yury Gribov  <y.gribov@samsung.com>

	* asan.c (check_func): New function.
	(maybe_create_ssa_name): Likewise.
	(build_check_stmt_with_calls): Likewise.
	(use_calls_p): Likewise.
	(report_error_func): Change interface.
	(build_check_stmt): Allow non-integer lengths; add support
	for new parameter.
	(asan_instrument): Likewise.
	(instrument_mem_region_access): Moved code to
	build_check_stmt.
	(instrument_derefs): Likewise.
	(instrument_strlen_call): Likewise.
	* cfgcleanup.c (old_insns_match_p): Add support for new
	functions.
	* doc/invoke.texi: Describe new parameter.
	* params.def: Define new parameter.
	* params.h: Likewise.
	* sanitizer.def: Describe new builtins.

	* c-c++-common/asan/instrument-with-calls-1.c: New test.
	* c-c++-common/asan/instrument-with-calls-2.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-1.c: Update
	test patterns.
	* c-c++-common/asan/no-redundant-instrumentation-2.c:
	Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-4.c:
	Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-5.c:
	Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-6.c:
	Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-7.c:
	Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-8.c:
	Likewise.

	Backport from mainline
	2014-06-16  Yury Gribov  <y.gribov@samsung.com>

	* asan.c (build_check_stmt): Fix maybe-uninitialized warning.

	Backport from mainline
	2014-06-18  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61530

	* asan.c (build_check_stmt): Add condition.

	* c-c++-common/asan/pr61530.c: New test.

	Backport from mainline
	2014-06-18  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61547

	* asan.c (instrument_strlen_call): Fixed instrumentation of
	trailing byte.

	* c-c++-common/asan/strlen-overflow-1.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216326 138bc75d-0d04-0410-961f-82ee72b054a4
Do not instrument first byte in strlen if already instrumented.

2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-06-24  Max Ostapenko  <m.ostapenko@partner.samsung.com>

	* asan.c (instrument_strlen_call): Do not instrument first byte in strlen
	if already instrumented.

	* c-c++-common/asan/no-redundant-instrumentation-9.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216327 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-07-31  Yury Gribov  <y.gribov@samsung.com>

	* doc/cpp.texi (__SANITIZE_ADDRESS__): Updated description.
	* doc/invoke.texi (-fsanitize=kernel-address): Describe new option.
	* flag-types.h (SANITIZE_USER_ADDRESS, SANITIZE_KERNEL_ADDRESS):
	New enums.
	* gcc.c (sanitize_spec_function): Support new option.
	(SANITIZER_SPEC): Remove now redundant check.
	* opts.c (common_handle_option): Support new option.
	(finish_options): Check for incompatibilities.
	* toplev.c (process_options): Split userspace-specific checks.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216328 138bc75d-0d04-0410-961f-82ee72b054a4
Added fnspec to internal functions.

2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-08-11  Yury Gribov  <y.gribov@samsung.com>

	* gimple.c (gimple_call_fnspec): Support internal functions.
	(gimple_call_return_flags): Use const.
	* Makefile.in (GTFILES): Add internal-fn.h to list of GC files.
	* internal-fn.def: Add fnspec information.
	* internal-fn.h (internal_fn_fnspec): New function.
	(init_internal_fns): Declare new function.
	* internal-fn.c (internal_fn_fnspec_array): New global variable.
	(init_internal_fns): New function.
	* tree-core.h: Update macro call.
	* tree.c (build_common_builtin_nodes): Initialize internal fns.

	Backport from mainline
	2014-08-12  Yury Gribov  <y.gribov@samsung.com>

	* internal-fn.c (init_internal_fns): Fix off-by-one.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216329 138bc75d-0d04-0410-961f-82ee72b054a4
Move inlining of Asan memory checks to sanopt pass.
Change asan-instrumentation-with-call-threshold to more closely match LLVM.

2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-08-11  Yury Gribov  <y.gribov@samsung.com>

	* asan.c (asan_check_flags): New enum.
	(build_check_stmt_with_calls): Removed function.
	(build_check_stmt): Split inlining logic to
	asan_expand_check_ifn.
	(instrument_derefs): Rename parameter.
	(instrument_mem_region_access): Rename parameter.
	(instrument_strlen_call): Likewise.
	(asan_expand_check_ifn): New function.
	(asan_instrument): Remove old code.
	(pass_sanopt::execute): Change handling of
	asan-instrumentation-with-call-threshold.
	(asan_clear_shadow): Fix formatting.
	(asan_function_start): Likewise.
	(asan_emit_stack_protection): Likewise.
	* doc/invoke.texi (asan-instrumentation-with-call-threshold):
	Update description.
	* internal-fn.c (expand_ASAN_CHECK): New function.
	* internal-fn.def (ASAN_CHECK): New internal function.
	* params.def (PARAM_ASAN_INSTRUMENTATION_WITH_CALL_THRESHOLD):
	Update description.
	(PARAM_ASAN_USE_AFTER_RETURN): Likewise.
	* tree.c: Small comment fix.

	* c-c++-common/asan/inc.c: Update test.
	* c-c++-common/asan/instrument-with-calls-2.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-1.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-2.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-3.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-4.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-5.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-6.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-7.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-8.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-9.c: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216330 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-08-18  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/62089

	* asan.c (instrument_derefs): Fix bitfield check.

	* c-c++-common/asan/pr62089.c: New test.
	* c-c++-common/asan/bitfield-1.c: New test.
	* c-c++-common/asan/bitfield-2.c: New test.
	* c-c++-common/asan/bitfield-3.c: New test.
	* c-c++-common/asan/bitfield-4.c: New test.

	Backport from mainline
	2014-08-28  Yury Gribov  <y.gribov@samsung.com>

	* c-c++-common/asan/pr62089.c: Fix test on 32-bit platforms.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216331 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-09-01  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61897
	PR sanitizer/62140

	* asan.c (asan_mem_ref_get_end): Handle non-ptroff_t lengths.
	(build_check_stmt): Likewise.
	(instrument_strlen_call): Likewise.
	(asan_expand_check_ifn): Likewise and fix types.
	(maybe_cast_to_ptrmode): New function.

	* c-c++-common/asan/pr62140-1.c: New test.
	* c-c++-common/asan/pr62140-2.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216332 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-10-03  Yury Gribov  <y.gribov@samsung.com>

	* asan.c (asan_finish_file): Disable __asan_init calls for KASan;
	don't emit empty ctors.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216333 138bc75d-0d04-0410-961f-82ee72b054a4
Instrument unaligned objects in KASan.

2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	* asan.c (instrument_derefs): Enable unaligned path for KASan.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216334 138bc75d-0d04-0410-961f-82ee72b054a4