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: Tomash Brechko <tomash dot brechko at gmail dot com>
- Cc: Andi Kleen <andi at firstfloor dot org>, gcc at gcc dot gnu dot org
- Date: Mon, 29 Oct 2007 14:57:42 +0100
- Subject: Re: Optimization of conditional access to globals: thread-unsafe?
- References: <18210.795.425145.46885@zebedee.pink.suse.lists.egcs> <e2e108260710270510j56fe188dkabe070f4c6bcbe0a@mail.gmail.com.suse.lists.egcs> <87hckcpvp5.fsf@mid.deneb.enyo.de.suse.lists.egcs> <e2e108260710270607u6798af5em6467bd38788f48cd@mail.gmail.com.suse.lists.egcs> <87abq4ofym.fsf@mid.deneb.enyo.de.suse.lists.egcs> <e2e108260710280631i405e4fd8te51ff7aa2ebece23@mail.gmail.com.suse.lists.egcs> <472492F8.90700@adacore.com.suse.lists.egcs> <20071028141821.GA4898@moonlight.home.suse.lists.egcs> <p73ejfe3zm9.fsf@bingen.suse.de> <20071029121406.GJ4915@moonlight.home>
On Mon, Oct 29, 2007 at 03:14:06PM +0300, Tomash Brechko wrote:
> On Mon, Oct 29, 2007 at 12:54:22 +0100, Andi Kleen wrote:
> > See http://gcc.gnu.org/ml/gcc/2007-10/msg00607.html for a test case
> > that shows where it can go horrible wrong (optimized code significantly
> > slower than unoptimized code) Admittedly it is a constructed
> > one, but I don't think it is that unrealistic.
>
> Thanks. I had to change %Lu to %lu, and the example shows the point
> when run multiple times.
Sorry that was a glibc'ism. The correct C99 specifier would be %llu
or %qu for traditional BSD.
-Andi