* [gentoo-dev] Should this be considered a gcc bug?
@ 2015-04-21 3:57 grozin
2015-04-21 4:35 ` Andrew Savchenko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: grozin @ 2015-04-21 3:57 UTC (permalink / raw
To: gentoo-dev
Hello *,
There was a bug #526194 - dev-lisp/sbcl does not respect CFLAGS. It was
"fixed" by Mark Wright <gienah@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] Should this be considered a gcc bug?
2015-04-21 3:57 [gentoo-dev] Should this be considered a gcc bug? grozin
@ 2015-04-21 4:35 ` Andrew Savchenko
2015-04-21 5:18 ` Jeroen Roovers
2015-04-21 15:02 ` William Hubbs
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Savchenko @ 2015-04-21 4:35 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
Hi,
On Tue, 21 Apr 2015 09:57:16 +0600 (NOVT) grozin@gentoo.org wrote:
> Hello *,
>
> There was a bug #526194 - dev-lisp/sbcl does not respect CFLAGS. It was
> "fixed" by Mark Wright <gienah@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
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] Should this be considered a gcc bug?
2015-04-21 3:57 [gentoo-dev] Should this be considered a gcc bug? grozin
2015-04-21 4:35 ` Andrew Savchenko
@ 2015-04-21 5:18 ` Jeroen Roovers
2015-04-21 15:02 ` William Hubbs
2 siblings, 0 replies; 4+ messages in thread
From: Jeroen Roovers @ 2015-04-21 5:18 UTC (permalink / raw
To: gentoo-dev
On Tue, 21 Apr 2015 09:57:16 +0600 (NOVT)
grozin@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] Should this be considered a gcc bug?
2015-04-21 3:57 [gentoo-dev] Should this be considered a gcc bug? grozin
2015-04-21 4:35 ` Andrew Savchenko
2015-04-21 5:18 ` Jeroen Roovers
@ 2015-04-21 15:02 ` William Hubbs
2 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2015-04-21 15:02 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 663 bytes --]
On Tue, Apr 21, 2015 at 09:57:16AM +0600, grozin@gentoo.org wrote:
> Hello *,
>
> There was a bug #526194 - dev-lisp/sbcl does not respect CFLAGS. It was
> "fixed" by Mark Wright <gienah@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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-21 15:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-21 3:57 [gentoo-dev] Should this be considered a gcc bug? grozin
2015-04-21 4:35 ` Andrew Savchenko
2015-04-21 5:18 ` Jeroen Roovers
2015-04-21 15:02 ` William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox