This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Questions before submitting a bug report
> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of Andrew Haley
> Sent: Dienstag, 3. Januar 2012 16:26
> To: gcc-help@gcc.gnu.org
> Subject: Re: Questions before submitting a bug report
>
> On 01/03/2012 03:02 PM, Markus Henschel wrote:
> > Is there some obvious flaw in my code?
>
> What error did you get? Not all CPUs can do __sync_add_and_fetch on a
> long long.
The resulting program crashes with a segmentation fault on the line with __sync_add_and_fetch. This is the complete command line I used for compiling:
"gcc -fPIC -march=i586 -fvisibility=hidden -O3 mytest.c -o mytest"
The error goes away if I remove "-fPIC", "-fvisibility=hidden" or if I use some less aggressive optimization. It also disappears if I use a long instead of a long long.