From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83051 invoked by alias); 12 Aug 2015 19:03:29 -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 83009 invoked by uid 48); 12 Aug 2015 19:03:25 -0000 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/67196] New: Another false positive from -Wmaybe-uninitialized Date: Wed, 12 Aug 2015 19:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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: 2015-08/txt/msg00824.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D67196 Bug ID: 67196 Summary: Another false positive from -Wmaybe-uninitialized Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Target Milestone: --- Created attachment 36176 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D36176&action=3Dedit Reproducer The attached generates a false -Wmaybe-uninitialized warning: $ gcc -O1 -Wall -c diagnostic.cc diagnostic.cc: In function =E2=80=98void test(int)=E2=80=99: diagnostic.cc:28:28: warning: =E2=80=98first_caption_idx=E2=80=99 may be us= ed uninitialized in this function [-Wmaybe-uninitialized] foo (first_caption_idx); /* get bogus warning here at -O1 and above */ ^ Seen with gcc 4.8.3 and with trunk (specifically, r226697). >>From gcc-bugs-return-494683-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Aug 12 19:29:39 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 20872 invoked by alias); 12 Aug 2015 19:29:39 -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 20835 invoked by uid 48); 12 Aug 2015 19:29:33 -0000 From: "luto at mit dot edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug inline-asm/66631] inability to clobber segment regs makes tls problematic Date: Wed, 12 Aug 2015 19:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: inline-asm X-Bugzilla-Version: 5.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luto at mit dot edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: 2015-08/txt/msg00825.txt.bz2 Content-length: 1060 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 Andy Lutomirski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |luto at mit dot edu --- Comment #17 from Andy Lutomirski --- I'll chime in, possibly uselessly. Before Linux 4.1, only CS was saved. (Unless you go *way* back.) In 4.1 or newer, SS is saved, too. In 64-bit code, DS and ES have no effect*, so I don't think it should affect code gen. FS and GS are weird, and they may get weirder when WRGSBASE and friends are enabled, which will happen at some point. Anyway, I tend to agree with Andrew here, I think: if you want to fiddle with FS and GS, write a little asm wrapper around the C code. * Except in an odd case on AMD processors that is mostly invisible to userspace. On new enough kernels, it's completely invisible to userspace, and I don't think it was ever visible without long jumps or such.