public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "brendan.jones.it at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53663] New: 4.7 inconsistent inline handling of bool within union Date: Wed, 13 Jun 2012 22:47:00 -0000 [thread overview] Message-ID: <bug-53663-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53663 Bug #: 53663 Summary: 4.7 inconsistent inline handling of bool within union Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: brendan.jones.it@gmail.com Please refer to the following: /* -*- Mode: C ; c-basic-offset: 4 -*- */ /* gcc test_jack.c -Wall -Wextra -o test -O1 && ./test ; echo $? should print 0, prints 10 gcc known to be affected: Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) */ #include <stdio.h> union u { int i = 0; _Bool b = 0; }; void f(union u * vp, union u v) { *vp = v; } int main() { union u v = 0; union u v1 = 0; union u v2 = 0; v.i = 10; f(&v1, v); v.b = 0; f(&v2, v); if (v2.b) printf("True\n"); else printf("False\n"); return v2.b; }
next reply other threads:[~2012-06-13 22:47 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-06-13 22:47 brendan.jones.it at gmail dot com [this message] 2012-06-13 23:20 ` [Bug tree-optimization/53663] " pinskia at gcc dot gnu.org 2012-06-14 8:41 ` rguenth at gcc dot gnu.org 2012-06-14 9:01 ` brendan.jones.it at gmail dot com 2012-06-24 7:57 ` brendan.jones.it at gmail dot com 2012-09-23 10:01 ` fdziarmagowski at gmail dot com 2012-09-23 11:57 ` mikpe at it dot uu.se 2012-09-23 17:14 ` mikpe at it dot uu.se 2012-09-23 18:45 ` mikpe at it dot uu.se 2012-09-23 19:52 ` fdziarmagowski at gmail dot com 2012-09-23 22:12 ` mikpe at it dot uu.se 2012-09-24 7:18 ` [Bug tree-optimization/53663] [4.7/4.8 Regression] " jakub at gcc dot gnu.org 2012-09-24 9:08 ` rguenth at gcc dot gnu.org 2012-09-24 9:15 ` jakub at gcc dot gnu.org 2012-09-24 11:45 ` rguenth at gcc dot gnu.org 2012-09-24 13:14 ` rguenth at gcc dot gnu.org 2012-09-25 7:52 ` rguenth at gcc dot gnu.org 2012-09-25 7:55 ` [Bug tree-optimization/53663] [4.7 " rguenth at gcc dot gnu.org 2012-09-25 8:31 ` fdziarmagowski at gmail dot com 2012-12-03 15:34 ` rguenth at gcc dot gnu.org 2012-12-03 16:54 ` rguenth at gcc dot gnu.org 2012-12-03 16:54 ` rguenth 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-53663-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).