Re: [gentoo-dev] Should this be considered a gcc bug?

2015-04-21 Thread William Hubbs
On Tue, Apr 21, 2015 at 09:57:16AM +0600, gro...@gentoo.org wrote:
 Hello *,
 
 There was a bug #526194 - dev-lisp/sbcl does not respect CFLAGS. It was 
 fixed by Mark Wright gie...@gentoo.org on Jan 31 - Feb 1. However, 
 after this fix the upstream CFLAGS were appended to the user-supplyed 
 ${CFLAGS}. And the upstream CFLAGS contain -O3. So, is a user has, e.g., 
 -O2 in his/her ${CFLAGS}, it was silently replaced by -O3. For some time, 
 nobody noticed this: gcc-4.8 happily compiled the C stuff in sbcl with 
 -O3.

The best fix here would be to ask upstream to stop putting -O3 in their
default CFLAGS.

Thanks,

William



signature.asc
Description: Digital signature


[gentoo-dev] Should this be considered a gcc bug?

2015-04-20 Thread grozin

Hello *,

There was a bug #526194 - dev-lisp/sbcl does not respect CFLAGS. It was 
fixed by Mark Wright gie...@gentoo.org on Jan 31 - Feb 1. However, 
after this fix the upstream CFLAGS were appended to the user-supplyed 
${CFLAGS}. And the upstream CFLAGS contain -O3. So, is a user has, e.g., 
-O2 in his/her ${CFLAGS}, it was silently replaced by -O3. For some time, 
nobody noticed this: gcc-4.8 happily compiled the C stuff in sbcl with 
-O3.


However, after the upgrade to gcc-4.9 problems began (bug #544070). On 
amd64, gcc is still happy co compile sbcl with -O3. However, on x86 this 
leads to a crash of a freshly compiled sbcl runtime. Namely, the 
combinations


-O2 -march=something
-O3

behave correctly, and produce a working sbcl; but

-O3 -march=something

lead to the crush. I have changed the above fix in sbcl-1.2.10 in such a 
way that now it appends only -g -Wall -Wsign-compare to ${CFLAGS}, but 
not -O3. This resolves the bug #544070, unless a user has -O3 
-march=something in his/her ${CFLAGS}.


Shouldn't gcc-4.9 on x86 produce with -O3 something functionally 
equivalent to the -O2 case, only more optimized? Should this be considered 
a gcc-4.9 bug?


Andrey



Re: [gentoo-dev] Should this be considered a gcc bug?

2015-04-20 Thread Andrew Savchenko
Hi,

On Tue, 21 Apr 2015 09:57:16 +0600 (NOVT) gro...@gentoo.org wrote:
 Hello *,
 
 There was a bug #526194 - dev-lisp/sbcl does not respect CFLAGS. It was 
 fixed by Mark Wright gie...@gentoo.org on Jan 31 - Feb 1. However, 
 after this fix the upstream CFLAGS were appended to the user-supplyed 
 ${CFLAGS}. And the upstream CFLAGS contain -O3. So, is a user has, e.g., 
 -O2 in his/her ${CFLAGS}, it was silently replaced by -O3. For some time, 
 nobody noticed this: gcc-4.8 happily compiled the C stuff in sbcl with 
 -O3.
 
 However, after the upgrade to gcc-4.9 problems began (bug #544070). On 
 amd64, gcc is still happy co compile sbcl with -O3. However, on x86 this 
 leads to a crash of a freshly compiled sbcl runtime. Namely, the 
 combinations
 
 -O2 -march=something
 -O3
 
 behave correctly, and produce a working sbcl; but
 
 -O3 -march=something
 
 lead to the crush. I have changed the above fix in sbcl-1.2.10 in such a 
 way that now it appends only -g -Wall -Wsign-compare to ${CFLAGS}, but 
 not -O3. This resolves the bug #544070, unless a user has -O3 
 -march=something in his/her ${CFLAGS}.
 
 Shouldn't gcc-4.9 on x86 produce with -O3 something functionally 
 equivalent to the -O2 case, only more optimized? Should this be considered 
 a gcc-4.9 bug?

Please look at gcc-4.9 manual for the list of -O3 expansion and
find what flag exactly causes this issue. There may be two reasons:
gcc bug and sbcl bug. While you have correctly pointed out that
this may be a problem in gcc, another possibility is that extra
optimization triggers some problem in the code itself, which causes
a segfault.

Best regards,
Andrew Savchenko


pgpp5lgZkfT6F.pgp
Description: PGP signature


Re: [gentoo-dev] Should this be considered a gcc bug?

2015-04-20 Thread Jeroen Roovers
On Tue, 21 Apr 2015 09:57:16 +0600 (NOVT)
gro...@gentoo.org wrote:

 However, after this fix the upstream CFLAGS were appended to the
 user-supplyed ${CFLAGS}. And the upstream CFLAGS contain -O3.

There is your problem. We filter out those compiler flags that affect
the output, so -O3 should go (and e.g. -Wall could stay).


 jer