http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45925

--- Comment #3 from Nicola Pero <nicola at gcc dot gnu.org> 2010-10-07 08:38:16 
UTC ---
You can easily confirm the bug even in a 32 bit machine by making the following
change to objc-foreach-1.m:

Index: objc-foreach-1.m
===================================================================
--- objc-foreach-1.m    (revision 165067)
+++ objc-foreach-1.m    (working copy)
@@ -12,7 +12,7 @@
 @end

 @implementation MyList
-- (unsigned int)countByEnumeratingWithState:(struct __objcFastEnumerationState
*)state objects:(id *)items count:(unsigned int)stackcount
+- (char)countByEnumeratingWithState:(struct __objcFastEnumerationState *)state
objects:(id *)items count:(unsigned int)stackcount
 {
         return 0;
 }


Then, the result is 

---------------------------

objc-foreach-1.m: In function ‘-[MyList(BasicTest) compilerTestAgainst]’:
objc-foreach-1.m:31:1: error: invalid conversion in gimple call
long unsigned int

char

__objc_foreach_batchsize = OBJ_TYPE_REF(D.2129;__objc_foreach_collection.0->0)
(__objc_foreach_collection.0, &_OBJC_SELECTOR_TABLE,
&__objc_foreach_enum_state, &__objc_foreach_items, 16);

objc-foreach-1.m:31:1: error: invalid conversion in gimple call
long unsigned int

char

__objc_foreach_batchsize = OBJ_TYPE_REF(D.2145;__objc_foreach_collection.1->0)
(__objc_foreach_collection.1, &_OBJC_SELECTOR_TABLE,
&__objc_foreach_enum_state, &__objc_foreach_items, 16);

objc-foreach-1.m:31:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

-------------------------

And it's correct that the test fails, because the declaration of the method is
wrong; it's the internal compiler error which shouldn't be there. :-)

Anyway, I think it makes sense to fix the testcases, but leave this bug open as
a low-priority bug fix.  The problem is very unlikely to happen in practice
since that method will be declared once (hopefully correctly) in the Foundation
frameworks.

Thanks

Reply via email to