public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53663] New: 4.7 inconsistent inline handling of bool within union
@ 2012-06-13 22:47 brendan.jones.it at gmail dot com
  2012-06-13 23:20 ` [Bug tree-optimization/53663] " pinskia at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: brendan.jones.it at gmail dot com @ 2012-06-13 22:47 UTC (permalink / raw)
  To: gcc-bugs

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;
}


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-12-03 16:54 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13 22:47 [Bug c/53663] New: 4.7 inconsistent inline handling of bool within union brendan.jones.it at gmail dot com
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

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).