[LLVMbugs] [Bug 4282] New: Crash when returning empty structure and using specific compiler flags

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu May 28 23:28:57 PDT 2009


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

           Summary: Crash when returning empty structure and using specific
                    compiler flags
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 3696


struct empty_struct {
};

struct empty_struct *
crash(void)
{
}

The above code causes LLVM to crash when being called like this:

clang-cc -triple x86_64-undermydesk-freebsd8.0 -S -disable-free -main-file-name
ppp_l2tp_avp.c --relocation-model static --disable-fp-elim --unwind-tables=1
--mcpu=x86-64 --fmath-errno=1 -g -DTYPED_MEM_UNDEFINE_ORIGINALS
-I/usr/ports/devel/libpdel/work/libpdel-0.5.3 -I/usr/local/include -O2 -Wall
-Wcast-align -Wchar-subscripts -Wcomment -Wformat -Wimplicit
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long
-Wparentheses -Wpointer-arith -Wreturn-type -Wswitch -Wtrigraphs
-Wuninitialized -Wunused -Wwrite-strings -std=gnu99 -fdiagnostics-show-option
-o /tmp/cc-keDoNh.s -x c llvm-crash.c

Assertion failed: (Begin + idx < End), function operator[], file
llvm/include/llvm/ADT/SmallVector.h, line 125.
Stack dump:
0.      Program arguments: clang-cc -triple x86_64-undermydesk-freebsd8.0 -S
-disable-free -main-file-name ppp_l2tp_avp.c --relocation-model static
--disable-fp-elim --unwind-tables=1 --mcpu=x86-64 --fmath-errno=1 -g
-DTYPED_MEM_UNDEFINE_ORIGINALS -I/usr/ports/devel/libpdel/work/libpdel-0.5.3
-I/usr/local/include -O2 -Wall -Wcast-align -Wchar-subscripts -Wcomment
-Wformat -Wimplicit -Wmissing-declarations -Wmissing-prototypes
-Wnested-externs -Wno-long-long -Wparentheses -Wpointer-arith -Wreturn-type
-Wswitch -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings -std=gnu99
-fdiagnostics-show-option -o /tmp/cc-keDoNh.s -x c llvm-crash.c 
1.      <eof> parser at end of file
2.      llvm-crash.c:5:1: LLVM IR generation of declaration 'crash'


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