From: Thomas Rast Date: Tue, 25 Oct 2011 16:07:53 GMT Subject: Re: general protection faults with "git grep" version 1.7.7.1 Message-ID: <201110251807.53893.trast@student.ethz.ch> In-Reply-To: <201110251800.28054.trast@student.ethz.ch> Thomas Rast wrote: > Jim Meyering wrote: > > Thomas Rast wrote: > > > [GCC moves access to a file-static variable across pthread_mutex_lock()] > > > > Thanks for the investigation. > > Actually, isn't gcc -O2's code-motion justified? > > While we *know* that those globals may be modified asynchronously, > > builtin/grep.c forgot to tell gcc about that. > > I'm somewhat unwilling to believe that: > > * "volatile" enforces three unrelated things, see e.g. [1]. Argh, forgot my reference: [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2016.html section "Existing portable uses" -- Thomas Rast trast@{inf,student}.ethz.ch