[LLVMbugs] [Bug 6340] New: Bug with empty C99 structure initialization

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Feb 18 01:35:42 PST 2010


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: unassignedbugs at nondot.org
        ReportedBy: quickslyver at free.fr
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list