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

           Summary: Bug with empty C99 structure initialization
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


I don't known if it's a clang or llvm bug:

#cat bug-struct-c99.c
struct E {};
struct G { int I; struct E J; int K; };
struct G k = { .J = {}, 1 };

int main (void)
{
  if (k.I || k.K != 1 )
    abort ();
  exit (0);
}

#clang bug-struct-c99.c
Abort

The bug in the generated assembly is here:

#clang bug-struct-c99.c -S -o -
[...]
k:
        .long   0
        .zero   1
        .long   1
        .size   k, 8

it should be:
k:
        .long   0
        .long   1
        .size   k, 8


-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to