From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59192 invoked by alias); 5 Oct 2015 17:40: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 59155 invoked by uid 48); 5 Oct 2015 17:40:25 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66697] Feature request: -mstackrealign and force_align_arg_pointer for x86_64 Date: Mon, 05 Oct 2015 17:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ubizjak at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2015-10/txt/msg00353.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66697 --- Comment #7 from Uro=C5=A1 Bizjak --- Formal patch submission at [1]. Wine people, can someone please test that the patched compiler solves unali= gned stack access, as reported in WineHQ bug? [1] https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00450.html >>From gcc-bugs-return-498799-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 05 17:47:50 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 111073 invoked by alias); 5 Oct 2015 17:47:50 -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 111053 invoked by uid 48); 5 Oct 2015 17:47:44 -0000 From: "miyuki at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/67854] Missing diagnostic for passing bool to va_arg Date: Mon, 05 Oct 2015 17:47: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: 6.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: miyuki 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: 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-10/txt/msg00354.txt.bz2 Content-length: 1910 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67854 --- Comment #2 from Mikhail Maltsev --- (In reply to joseph@codesourcery.com from comment #1) > I wonder if this is yet another issue with macros from system headers > (bool being defined in a system header to expand to _Bool) ... Looks like it is. In gimplify.c:gimplify_va_arg_expr we have: /* Unfortunately, this is merely undefined, rather than a constraint violation, so we cannot make this an error. If this call is never executed, the program is still strictly conforming. */ warned = warning_at (loc, 0, "%qT is promoted to %qT when passed through %<...%>", type, promoted_type); And warning_at returns false. Also, for #include #define BOOL _Bool void foo(va_list ap) { va_arg(ap, BOOL); } GCC outputs: In file included from test2.c:1:0: test2.c: In function 'foo': test2.c:2:14: warning: '_Bool' is promoted to 'int' when passed through '...' #define BOOL _Bool ^ test2.c:5:16: note: in expansion of macro 'BOOL' va_arg(ap, BOOL); ^ test2.c:2:14: note: (so you should pass 'int' not '_Bool' to 'va_arg') #define BOOL _Bool ^ test2.c:5:16: note: in expansion of macro 'BOOL' va_arg(ap, BOOL); ^ test2.c:2:14: note: if this code is reached, the program will abort #define BOOL _Bool ^ test2.c:5:16: note: in expansion of macro 'BOOL' va_arg(ap, BOOL); IMHO, it would be more correct to output something like this: test2.c: In function 'foo': test2.c:5:16: warning: '_Bool' is promoted to 'int' when passed through '...' va_arg(ap, BOOL); ^ test2.c:2:14: note: expanded from macro 'BOOL' #define BOOL _Bool ^