This is the mail archive of the
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: Andi Kleen <andi at firstfloor dot org>, gcc at gcc dot gnu dot org
- Date: Mon, 29 Oct 2007 21:03:24 +0100
- Subject: Re: Optimization of conditional access to globals: thread-unsafe?
- References: <Pine.LNX.email@example.com> <firstname.lastname@example.org> <02e701c819c7$be985620$2e08a8c0@CAM.ARTIMI.COM.suse.lists.egcs> <email@example.com> <20071029162032.GA10611@synopsys.com.suse.lists.egcs> <47260E97.firstname.lastname@example.org> <email@example.com> <472639BF.firstname.lastname@example.org>
On Mon, Oct 29, 2007 at 03:51:27PM -0400, Robert Dewar wrote:
> Sure, well nearly every optimization has some case where it is a
> pessimization (one interesting thing that happens is that if you
> change the length of generated code in *any* way you may be unlucky
> and cause a systematic instruction cache miss in a loop, inlining
icache misses are hard in general and agreed the compiler cannot
do too much about them (except for trying not to generate too bloated
code in general)
But adding gratuious dcache misses is a completely different thing.
That is something the compiler has control over and should just