Bugzilla – Bug 63
#ident is not recognized by C frontend
Last modified: 2003-12-10 16:41:22
You need to log in before you can comment on or make changes to this bug.
Gcc 2.96 has no problem with #ident directive in the file. Haven't checked if GCC 3.4 itself has deprecated this directive though...
I'm not familiar with #ident, can you please provide a testcase? Have you tried #pragma ident? -Chris
Here's a testcase: ---- #ident "foo" ---- $ llvmgcc -S test.c test.c:-77: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://llvm.cs.uiuc.edu> for instructions. That is pretty catastrophic. I'll look into it. -Chris
Ok, the bug has been fixed in the mainline C front-end. Here's a patch: $ diff -u c-lex.c-orig c-lex.c --- c-lex.c-orig 2003-10-28 19:19:07.000000000 -0600 +++ c-lex.c 2003-10-28 19:19:23.000000000 -0600 @@ -41,6 +41,7 @@ #include "tm_p.h" #include "splay-tree.h" #include "debug.h" +#include "llvm-out.h" /* The current line map. */ static const struct line_map *map; @@ -179,6 +180,8 @@ unsigned int line ATTRIBUTE_UNUSED, const cpp_string *str ATTRIBUTE_UNUSED) { + if (EMIT_LLVM) return; + #ifdef ASM_OUTPUT_IDENT if (! flag_no_ident) { If you're not interested in rebuilding the C frontend, you can pass '-fno-ident' on the llvmgcc command line to work around this problem. Thanks for the great bug report! -Chris
For the record, this is tested as: test/Regression/CFrontend/2003-10-28-ident.c -Chris
*** Bug 173 has been marked as a duplicate of this bug. ***