public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rionda at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59800] New: Compilation with g++ fails when -Ofast -flto is used to compile code using some <random> distribution Date: Tue, 14 Jan 2014 06:01:00 -0000 [thread overview] Message-ID: <bug-59800-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59800 Bug ID: 59800 Summary: Compilation with g++ fails when -Ofast -flto is used to compile code using some <random> distribution Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rionda at gmail dot com Created attachment 31828 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31828&action=edit Code that fails The attached code compiles cleanly when using g++ -Ofast -Wall -Wextra -Wno-unused-parameter test.cpp test.cpp and when using g++ -flto -Wall -Wextra -Wno-unused-parameter test.cpp but fails when using "g++8 -std=c++11 -Ofast -flto -Wall -Wextra -Wno-unused-parameter test.cpp" (i.e., when using both -Ofast and -flto). The reported error is: test.cpp: In function 'main': /opt/local/include/gcc48/c++/bits/random.h:2404:60: warning: 'MEM[(struct normal_distribution *)&my_lognormal + 16B]._M_saved' may be used uninitialized in this function [-Wmaybe-uninitialized] { return std::exp(__p.s() * _M_nd(__urng) + __p.m()); } ^ test.cpp:11:33: note: 'MEM[(struct normal_distribution *)&my_lognormal + 16B]._M_saved' was declared here lognormal_distribution<double> my_lognormal(0.0, 1.0); ^ I am running g++-mp-4.8 (MacPorts gcc48 4.8.2_0) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. on Mac OS X 10.6.8 (uname -a : darwin xxxx.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386)
next reply other threads:[~2014-01-14 6:01 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-01-14 6:01 rionda at gmail dot com [this message] 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
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@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: linkBe 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).