From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5492 invoked by alias); 9 Jul 2014 20:49:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5217 invoked by uid 48); 9 Jul 2014 20:49:41 -0000 From: "manu at gcc dot 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 distribution Date: Wed, 09 Jul 2014 20:49: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: 4.8.2 X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg00578.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59800 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW CC| |manu at gcc dot gnu.org --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- 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 warni= ng should be suppressed for system-headers: manuel@gcc10:~$ ~/test1/210581/install/bin/g++ -std=3Dc++11 -O2 -Wsystem-h= eaders -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 =E2=80=98int main(int, char**)=E2=80=99: /home/manuel/test1/210581/install/include/c++/4.10.0/bits/random.tcc:1964:2: warning: =E2=80=98*((void*)(& my_lognormal)+16).std::normal_distribution::_M_saved=E2=80=99 may b= e used uninitialized in this function [-Wmaybe-uninitialized] __ret =3D __ret * __param.stddev() + __param.mean(); ^ test.cc:11:33: note: =E2=80=98*((void*)(& my_lognormal)+16).std::normal_distribution::_M_saved=E2=80=99 was d= eclared here lognormal_distribution 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: 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: List-Archive: List-Post: List-Help: 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" 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: In-Reply-To: References: 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?id=46097 Phil Miller changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |unmobile at gmail dot com --- Comment #32 from Phil Miller --- 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.