This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug in Objective-C compiler found
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Bug in Objective-C compiler found
- From: Nicola Pero <nicola at brainstorm dot co dot uk>
- Date: Tue, 20 Feb 2001 14:14:32 +0000 (GMT)
Hi -
the Objective-C compiler can't currently compile protocol stuff - see for
example
testsuite/objc/bycopy-1
testsuite/objc/bycopy-2
testsuite/objc/np-1
testsuite/objc/np-2
All these four tests are failing (they compile fine under gcc-2.95.2).
The compiler seems to have been broken on 7 September 2000 by zack, with
the change 1.152 to gcc/c-decl.c.
Reverting a tiny amount of his changes, as follows, seem to fix the
problems:
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.207.2.1
diff -u -r1.207.2.1 c-decl.c
--- c-decl.c 2001/02/16 13:02:14 1.207.2.1
+++ c-decl.c 2001/02/20 13:59:45
@@ -3912,7 +3912,7 @@
if (id == ridpointers[(int) RID_CHAR])
explicit_char = 1;
- if (TREE_CODE (id) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (id))
+ if (TREE_CODE (id) == IDENTIFIER_NODE)// && C_IS_RESERVED_WORD (id))
{
enum rid i = C_RID_CODE (id);
if (i <= RID_LAST_MODIFIER)
In particular, the four tests above compile and run again.
I have no idea whether this patch should be applied or not, but the
problem is certainly there, because the patch kills it, so I hope it will
help someone with a better understanding of the compiler internals to fix
Objective-C code generation.
Thanks.