gcc: Backported r185234 from trunk.

This patch is necessary for Chrome PGO.

Patch description:
2012-03-12  Richard Guenther  <[email protected]>

	* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
	* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
	(__gthread_mutex_init_function): New function.
	* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.

	PR gcov/49484
	* libgcov.c: Include gthr.h.
	(__gcov_flush_mx): New global variable.
	(init_mx, init_mx_once): New functions.
	(__gcov_flush): Protect self with a mutex.
	(__gcov_fork): Re-initialize mutex after forking.
	* unwind-dw2-fde.c: Change condition under which to use
	__GTHREAD_MUTEX_INIT_FUNCTION.

BUG=none
TEST=`cbuildbot -g <patch#> chromiumos-sdk' passes.
No performance regressions on lumpy/alex.

Change-Id: I5d0a17b4363657cdd517a89239b3e8a623c3829e
Reviewed-on: https://gerrit.chromium.org/gerrit/39357
Reviewed-by: Han Shen <[email protected]>
Commit-Ready: asharif <[email protected]>
Tested-by: asharif <[email protected]>
6 files changed