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

           Summary: miscompiles led.c:led_create_state from the FreeBSD
                    kernel
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
            Blocks: 3696


Created an attachment (id=3605)
 --> (http://llvm.org/bugs/attachment.cgi?id=3605)
led.i

This is a somewhat vague report just to get this bug going, Roman will fill in
the details.

In the led_create_state() function in led.c the call sc->func() fails, it end
up with a page fault panic where it looks like func points to led_list which is
accessed in the LIST_HEAD_INSERT macro.

Now I the code is changed to insert a printf between there like this it works:
        LIST_INSERT_HEAD(&led_list, sc, list);
        printf("hello\n");
        sc->func(sc->private, state != 0);

Attached you can find the preprocessed led.c, the original asm output as
led-broken.s and the "fixed" asm output where the printf was inserted.


-- 
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