public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Savchenko <bircoph@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Should this be considered a gcc bug?
Date: Tue, 21 Apr 2015 09:35:24 +0500	[thread overview]
Message-ID: <20150421093524.38af30f7125f42e3d02d9984@gentoo.org> (raw)
In-Reply-To: <alpine.LRH.2.11.1504210940150.65217@star.inp.nsk.su>

[-- 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 --]

  reply	other threads:[~2015-04-21  4:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  3:57 [gentoo-dev] Should this be considered a gcc bug? grozin
2015-04-21  4:35 ` Andrew Savchenko [this message]
2015-04-21  5:18 ` Jeroen Roovers
2015-04-21 15:02 ` William Hubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150421093524.38af30f7125f42e3d02d9984@gentoo.org \
    --to=bircoph@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox