LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1400 - LLVM frontend crashes when compiling a header file with implementation
Summary: LLVM frontend crashes when compiling a header file with implementation
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-08 10:54 PDT by Veli-Pekka Jaaskelainen
Modified: 2010-03-06 14:00 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veli-Pekka Jaaskelainen 2007-05-08 10:54:23 PDT
vjaaskel@kizarwexius:~/testdata/c/testi$ cat testi.h
int main() {
   return 0;
}

vjaaskel@kizarwexius:~/testdata/c/testi$ llvm-gcc -emit-llvm testi.h
testi.h:3: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.org/bugs> for instructions.

vjaaskel@kizarwexius:~/testdata/c/testi$ gcc testi.h

vjaaskel@kizarwexius:~/testdata/c/testi$ llvm-gcc --version
llvm-gcc (GCC) 4.0.1 LLVM (Apple Computer, Inc. build 5449)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 Reid Spencer 2007-05-08 11:34:13 PDT
Veli-Pekka,

Could you please get a stack trace for this? You can do that by running:

llvm-gcc -v -emit-llvm testi.h

That will produce a command line that llvm-gcc runs (probably cc1) to do the
actual work. Simply run that command under a debugger with the options printed
out by llvm-gcc and when it fails (segmentation fault), get a stack trace
(probably the "where" command). Please post the stack trace here.

Thanks,

Reid.
Comment 2 Anton Korobeynikov 2007-05-08 12:47:27 PDT
I cannot reproduce it here (mingw32, llvm-gcc 2.0cvs as of March). The result is
.gch file.

Veli-Pekka, have you used 1.9 sources/binaries or built llvm-gcc from svn?
Comment 4 Anton Korobeynikov 2007-05-18 07:42:05 PDT
Recent addendum of eraseLocalLLVMValues() breaks this again (However, release
branch is happy!)
Comment 5 Anton Korobeynikov 2007-05-18 07:44:47 PDT
Sorry, eraseLocalLLVMValues() wasn't commited yet. It seems to be local problem
of mine and Duncan's tree :)