This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in Objective-C compiler found


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]