public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59800] Compilation with g++ fails when -Ofast -flto is used to compile code using some <random> distribution
Date: Wed, 09 Jul 2014 20:49:00 -0000 [thread overview]
Message-ID: <bug-59800-4-KwUDfxzh1c@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59800-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59800
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
CC| |manu at gcc dot gnu.org
--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
The meaning is explained here: https://gcc.gnu.org/bugs/management.html
but I think it was a slip in this case.
Probably the uninit pass is not powerful enough, but in this case the warning
should be suppressed for system-headers:
manuel@gcc10:~$ ~/test1/210581/install/bin/g++ -std=c++11 -O2 -Wsystem-headers
-Wmaybe-uninitialized test.cc
In file included from
/home/manuel/test1/210581/install/include/c++/4.10.0/random:51:0,
from test.cc:3:
/home/manuel/test1/210581/install/include/c++/4.10.0/bits/random.tcc: In
function ‘int main(int, char**)’:
/home/manuel/test1/210581/install/include/c++/4.10.0/bits/random.tcc:1964:2:
warning: ‘*((void*)(&
my_lognormal)+16).std::normal_distribution<double>::_M_saved’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
__ret = __ret * __param.stddev() + __param.mean();
^
test.cc:11:33: note: ‘*((void*)(&
my_lognormal)+16).std::normal_distribution<double>::_M_saved’ was declared here
lognormal_distribution<double> my_lognormal(0.0, 1.0);
^
and -flto bypassed the system_header pragma somehow.
>From gcc-bugs-return-455988-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 09 21:13:16 2014
Return-Path: <gcc-bugs-return-455988-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7056 invoked by alias); 9 Jul 2014 21:13:15 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 6992 invoked by uid 48); 9 Jul 2014 21:13:08 -0000
From: "unmobile at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/46097] Switch to warn of global variables in a C++ shared object
Date: Wed, 09 Jul 2014 21:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: unmobile at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-46097-4-Azb56Kd1MM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-46097-4@http.gcc.gnu.org/bugzilla/>
References: <bug-46097-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-07/txt/msg00579.txt.bz2
Content-length: 950
https://gcc.gnu.org/bugzilla/show_bug.cgi?idF097
Phil Miller <unmobile at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |unmobile at gmail dot com
--- Comment #32 from Phil Miller <unmobile at gmail dot com> ---
A switch to generate warnings about global variables would be useful to me and
my colleagues (http://ppl.cs.illinois.edu/) for a reason totally distinct from
ODR violations. We have a parallel programming system that includes a feature
for running application code in multiple, nominally independent, user-level
threads within a process. A mechanism to call attention to code that may fail
or misbehave in this setting would be helpful.
I would definitely agree that this doesn't belong in -Wall or -Wextra, as such.
So a -fnote-global-variables might be more appropriate.
prev parent reply other threads:[~2014-07-09 20:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 6:01 [Bug c++/59800] New: " rionda at gmail dot com
2014-01-14 12:05 ` [Bug c++/59800] " rguenth at gcc dot gnu.org
2014-07-09 19:52 ` rionda at gmail dot com
2014-07-09 20:49 ` manu at gcc dot gnu.org [this message]
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=bug-59800-4-KwUDfxzh1c@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).