public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38696]  New: gcc.dg/torture/pr37868.c wrong code at -O2 and above for 4.3 and trunk / bit packing
@ 2009-01-02 13:30 laurent at guerby dot net
  2009-01-02 15:26 ` [Bug middle-end/38696] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: laurent at guerby dot net @ 2009-01-02 13:30 UTC (permalink / raw)
  To: gcc-bugs

GCC 4.3.2-1 debian gnueabi and trunk at rev 142984 generate wrong code at -O2
and above for pr37868.c

guerby@gcc50:~$ /home/guerby/build-142984/gcc/xgcc
-B/home/guerby/build-142984/gcc/
/home/guerby/trunk/gcc/testsuite/gcc.dg/torture/pr37868.c   -O2 -lm   -o
./pr37868.exeguerby@gcc50:~$ ./pr37868.exe 
Aborted

guerby@gcc50:~$ cat /home/guerby/trunk/gcc/testsuite/gcc.dg/torture/pr37868.c 
/* { dg-do run } */
/* { dg-options "-fno-strict-aliasing" } */
/* { dg-skip-if "unaligned access" { sparc*-*-* } "*" "" } */

extern void abort (void);

struct X {
  unsigned char pad : 4;
  unsigned int a : 32;
  unsigned int b : 24;
  unsigned int c : 6;
} __attribute__((packed));

int main (void)
{
  struct X x;
  unsigned int bad_bits;

  x.pad = -1;
  x.a = -1;
  x.b = -1;
  x.c = -1;

  bad_bits = ((unsigned int)-1) ^ *(1+(unsigned int *) &x);
  if (bad_bits != 0)
    abort ();
  return 0;
}


-- 
           Summary: gcc.dg/torture/pr37868.c wrong code at -O2 and above for
                    4.3 and trunk / bit packing
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: laurent at guerby dot net
 GCC build triplet: arm-linux-gnueabi
  GCC host triplet: arm-linux-gnueabi
GCC target triplet: arm-linux-gnueabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38696


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

end of thread, other threads:[~2010-03-20 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-02 13:30 [Bug c/38696] New: gcc.dg/torture/pr37868.c wrong code at -O2 and above for 4.3 and trunk / bit packing laurent at guerby dot net
2009-01-02 15:26 ` [Bug middle-end/38696] " pinskia at gcc dot gnu dot org
2009-01-10 13:32 ` laurent at guerby dot net
2009-04-30  9:27 ` ramana at gcc dot gnu dot org
2009-04-30 10:37 ` rguenth at gcc dot gnu dot org
2010-03-20 19:16 ` ramana at gcc dot gnu dot org
2010-03-20 19:26 ` laurent at guerby dot net
2010-03-20 19:33 ` ramana at gcc dot gnu dot 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).