First Last Prev Next    No search results available
Details
: #ident is not recognized by C frontend
Bug#: 63
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: PC
: Linux
: 1.0
: P2
: normal
: 1.1

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Vipin Gokhale <vipin.gokhale@comcast.net>
Assigned To: Chris Lattner <sabre@nondot.org>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-10-28 19:01
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...
------- Comment #1 From Chris Lattner 2003-10-28 19:05:02 -------
I'm not familiar with #ident, can you please provide a testcase?  Have you tried
#pragma ident?

-Chris
------- Comment #2 From Chris Lattner 2003-10-28 19:11:22 -------
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
------- Comment #3 From Chris Lattner 2003-10-28 19:21:51 -------
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
------- Comment #4 From Chris Lattner 2003-10-28 19:23:56 -------
For the record, this is tested as: test/Regression/CFrontend/2003-10-28-ident.c

-Chris
------- Comment #5 From Chris Lattner 2003-12-10 16:41:22 -------
*** Bug 173 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available