Skip to content

apparent union bug #3052

@regehr

Description

@regehr
Bugzilla Link 2680
Resolution FIXED
Resolved on Aug 16, 2008 23:27
Version unspecified
OS Linux

Extended Description

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

[regehr@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@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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions