This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.0.1 PATCH: Avoid link failure of Objective-C testsuite on Solaris2/Intel
Stan Shebs writes:
> > With this patch, all Objective-C testcases succeed, with the exception of
> >
> > FAIL: objc/execute/class-3.m execution, -O
> >
> > which fails with
> >
> > test_instances failed
>
> That's a new one. I've not seen any other platform fail this one,
> and the test seems pretty straightforward. Does it fail with
> other optimization levels? (I'm working on a testsuite hack to
> run ObjC tests with all the opt levels, but it's not done yet.)
I've just got the machine back and checked this: it fails all the same
without -O, with -O and with -O2.
I've run this under gdb and now think that objc/objc-api.h
(object_is_class) cannot be used in this case, or something else is wrong:
In class-tests-1.h (test_instances), id object is created by
class_create_instance(), which finally allocates a 4-byte (in the
Solaris/Intel case) instance and returns its address. This (object) is
passed to object_is_class(), which casts object into a Class (i.e. struct
objc_class *, where struct objc_class is much larger than 4 bytes), and
tests (via CLS_ISCLASS) the info member to determine if _CLS_CLASS is set.
But this test is completely bogus, since info never got initialized in the
first place. So it's completely arbitrary if this test passes or not.
> Also, is formal-protocol-6.m really passing? I've analyzed it and
> it looks like it exposes a fundamental flaw in the GNU runtime
> (protocols can't exist independent of classes/categories), and
> it should have failed.
No, you're right: this was an XFAIL.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE