This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
- From: Andi Kleen <andi at firstfloor dot org>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 29 Oct 2007 20:43:28 +0100
- Subject: Re: Optimization of conditional access to globals: thread-unsafe?
- References: <Pine.LNX.4.64.0710281753210.23011@wotan.suse.de.suse.lists.egcs> <20071028.180108.71876074.davem@davemloft.net.suse.lists.egcs> <02e701c819c7$be985620$2e08a8c0@CAM.ARTIMI.COM.suse.lists.egcs> <20071028.183401.197068473.davem@davemloft.net.suse.lists.egcs> <20071029162032.GA10611@synopsys.com.suse.lists.egcs> <47260E97.4020309@adacore.com.suse.lists.egcs>
Robert Dewar <dewar@adacore.com> writes:
>
> a) the standard allows the optimization (or rather does not forbid it)
Assuming it is an optimization. See http://gcc.gnu.org/ml/gcc/2007-10/msg00607.html
for a counter example. In general cache misses are so costly that anything
that risks introducing more is in general a bad idea.
-Andi