This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59800] Compilation with g++ fails when -Ofast -flto is used to compile code using some <random> distribution
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 Jul 2014 20:49:39 +0000
- Subject: [Bug c++/59800] Compilation with g++ fails when -Ofast -flto is used to compile code using some <random> distribution
- Auto-submitted: auto-generated
- References: <bug-59800-4 at http dot gcc dot gnu dot 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.