From: Christian Hesse <mail@eworm.de>
To: David Sterba <dsterba@suse.cz>
Cc: Qu Wenruo <quwenruo@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/1] btrfs-progs: fix compiler warning
Date: Thu, 5 Jun 2014 10:59:37 +0200 [thread overview]
Message-ID: <20140605105937.33bdd84d@leda.localdomain> (raw)
In-Reply-To: <20140604164437.GA1903@twin.jikos.cz>
[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]
David Sterba <dsterba@suse.cz> on Wed, 2014/06/04 18:44:
> On Wed, Jun 04, 2014 at 09:19:26AM +0200, Christian Hesse wrote:
> > > It seems to be related to default gcc flags from distribution?
> >
> > Probably. I did compile with optimization, so adding -O2 may do the trick:
> >
> > make CFLAGS="${CFLAGS} -O2" all
>
> The warning appears with -O2, so the question is if gcc is not able to
> reason about the values (ie. a false positive) or if there's a bug that
> I don't see.
I do not see a bug either. So probably this is a false positive...
Looks like the warning is triggered as soon as -ftree-vrp is added to CFLAGS.
From gcc man page:
-ftree-vrp
Perform Value Range Propagation on trees. This is similar to the
constant propagation pass, but instead of values, ranges of values are
propagated. This allows the optimizers to remove unnecessary range
checks like array bound checks and null pointer checks. This is
enabled by default at -O2 and higher. Null pointer check elimination
is only done if -fdelete-null-pointer-checks is enabled.
Is it possibly that gcc optimized away any checks?
--
Schoene Gruesse
Chris
O< ascii ribbon campaign
stop html mail - www.asciiribbon.org
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-06-05 8:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 11:29 [PATCH 1/1] btrfs-progs: fix compiler warning Christian Hesse
2014-06-03 16:52 ` David Sterba
2014-06-03 18:04 ` Christian Hesse
2014-06-04 6:48 ` Qu Wenruo
2014-06-04 7:19 ` Christian Hesse
2014-06-04 16:44 ` David Sterba
2014-06-05 8:59 ` Christian Hesse [this message]
2014-06-10 11:05 ` David Sterba
2014-06-03 11:37 Christian Hesse
2014-06-05 8:13 Christian Hesse
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=20140605105937.33bdd84d@leda.localdomain \
--to=mail@eworm.de \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.