This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: RFC/RFHelp: c-decl.c rewrite - almost but not quite


On Mar 18, 2004, at 11:01, Andrew Pinski wrote:

Some investigating work on my part, some of the Objective-C failures is
due to the front-end putting a variable in the global scope only as
there is no file scope at the point which it inserts it.
The function which causes this is generate_forward_declaration_to_string_table.
But the code to use the decl has been dead for a long time and maybe should be
removed too.
The code that used it was removed <http://gcc.gnu.org/ml/gcc-patches/2001-05/msg01940.html>
but it was "#if 0" before that and I cannot find the place where it was "#if 0" out.


I will run the whole Objective-C testsuite on this change.

One more fix fixed all the ICEs in the testsuite.
The fix was to check to make sure that file_scope was not null in pushdecl_top_level
because it can be called when no files are being parsed.



now this leads to either a warning message:
In file included from /Users/pinskia/src/gcc-clean/src/gcc/testsuite/objc/execute/bf- common.h:5,
from /Users/pinskia/src/gcc-clean/src/gcc/testsuite/objc/execute/bf-1.m:24:
/Users/pinskia/src/gcc-clean/src/gcc/testsuite/objc/execute/ next_mapping.h: In function `objc_sizeof_type':
/Users/pinskia/src/gcc-clean/src/gcc/testsuite/objc/execute/ next_mapping.h:135: warning: unexpected type for `id' (struct objc_object *)


And an error message:
/Users/pinskia/src/gcc-clean/src/gcc/testsuite/objc/execute/bf- common.h: In function `compare_structures':
/Users/pinskia/src/gcc-clean/src/gcc/testsuite/objc/execute/bf- common.h:21: error: dereferencing pointer to incomplete type


void compare_structures (Class class, const char* type)
{
struct objc_struct_layout layout;
struct objc_ivar_list* ivars = class->ivars; // <--- error message here



The error message is incorrect because Class is of type "struct objc_class *" which is defined
in objc-class.h which is included (checked by looking into the preprocessed file) but it is
also defined by the Objective-C front-end.


Both of these issues might be caused by an use of xref_tag but I do not know.

Thanks,
Andrew Pinski


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