[LLVMbugs] [Bug 2680] New: apparent union bug

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Aug 14 19:44:06 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2680

           Summary: apparent union bug
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


This is seen on r54780 on Ubuntu Feisty on ia32.  Removing any field of cjt5
makes the problem go away.

[regehr at babel tmp8]$ llvm-gcc -O -Wall small.c -o small ; ./small 
small: small.c:26: main: Assertion `cj41.cj35 == cj43.cj35' failed.
Aborted (core dumped)

[regehr at babel tmp8]$ cat small.c
#include <assert.h>

union cjt7
{
  double *cj35;
  struct cjt5 {
    float cj27;
    signed int cj29:7;
    signed int cj30:7;
    signed int cj31:5;
  } cj37;
};

union cjt7 cj41 = {
  (double *) 2140832546U, 
};

union cjt7 callee_cj0f(void)
{
  return cj41;
}

int main(void)
{
  union cjt7 cj43 = callee_cj0f();
  assert(cj41.cj35 == cj43.cj35);
  return 0;
}


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list