public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug objc/45925] New: New objc test failures
@ 2010-10-07  0:09 hjl.tools at gmail dot com
  2010-10-07  8:18 ` [Bug objc/45925] " nicola at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-07  0:09 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: New objc test failures
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: nicola.pero@meta-innovation.com


On Linux/x86-64, revision 165021 gave

FAIL: objc.dg/objc-foreach-1.m -fgnu-runtime (internal compiler error)
FAIL: objc.dg/objc-foreach-1.m -fgnu-runtime (test for excess errors)
FAIL: objc.dg/objc-foreach-2.m -fgnu-runtime (internal compiler error)
FAIL: objc.dg/objc-foreach-2.m -fgnu-runtime (test for excess errors)
FAIL: objc.dg/objc-foreach-3.m -fgnu-runtime (internal compiler error)
FAIL: objc.dg/objc-foreach-3.m -fgnu-runtime (test for excess errors)

Revision 165014 is OK.  It is caused by revision 165019:

http://gcc.gnu.org/ml/gcc-cvs/2010-10/msg00201.html


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
@ 2010-10-07  8:18 ` nicola at gcc dot gnu.org
  2010-10-07  8:36 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-10-07  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

Nicola Pero <nicola at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nicola at gcc dot gnu.org

--- Comment #1 from Nicola Pero <nicola at gcc dot gnu.org> 2010-10-07 08:18:03 UTC ---
Is there any way I can see the detailed logs of the failure ?

If it's the same problem that IainS reported to me privately, then it's caused
by a bug in the Apple testcases (objc-foreach-1.m etc) --

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

the return value should be 'long unsigned int', not 'unsigned int', and so for
'stackcount'.

What happens then is that the ObjC code generates a method call
returning/taking a 'long unsigned int', but the prototype says 'unsigned int',
and a gimplify check fails and aborts compilation.

I would imagine a fix would entail:

 * having the ObjC FE check that countByEnumeratingWithState:objects:count: has
the expected method signature; if not, produce an error.  The testcases would
still fail, but with an informative message rather than an internal compiler
error :-)

 * fix the testcases (and add a testcase for the above error).

Thanks


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
  2010-10-07  8:18 ` [Bug objc/45925] " nicola at gcc dot gnu.org
@ 2010-10-07  8:36 ` jakub at gcc dot gnu.org
  2010-10-07  8:38 ` nicola at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-07  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-10-07 08:35:42 UTC ---
Executing on host: /usr/src/gcc/obj280/gcc/xgcc -B/usr/src/gcc/obj280/gcc/
/usr/src/gcc/gcc/testsuite/objc.dg/objc-foreach-1.m  -fgnu-runtime  -I/u
sr/src/gcc/gcc/testsuite/../../libobjc 
-B/usr/src/gcc/obj280/x86_64-unknown-linux-gnu/./libobjc/.libs  
-L/usr/src/gcc/obj280/x86_64-unknown-linux
-gnu/./libobjc/.libs  -S  -o objc-foreach-1.s    (timeout = 300)
/usr/src/gcc/gcc/testsuite/objc.dg/objc-foreach-1.m: In function
'-[MyList(BasicTest) compilerTestAgainst]':
/usr/src/gcc/gcc/testsuite/objc.dg/objc-foreach-1.m:31:1: error: invalid
conversion in gimple call
long unsigned int
unsigned int
__objc_foreach_batchsize = OBJ_TYPE_REF(D.2863;__objc_foreach_collection.0->0)
(__objc_foreach_collection.0, &_OBJC_SELECTOR_TABLE,
&__objc_foreach_enum_state, &__objc_foreach_items, 16);
/usr/src/gcc/gcc/testsuite/objc.dg/objc-foreach-1.m:31:1: error: invalid
conversion in gimple call
long unsigned int
unsigned int
__objc_foreach_batchsize = OBJ_TYPE_REF(D.2879;__objc_foreach_collection.1->0)
(__objc_foreach_collection.1, &_OBJC_SELECTOR_TABLE,
&__objc_foreach_enum_state, &__objc_foreach_items, 16);
/usr/src/gcc/gcc/testsuite/objc.dg/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.
compiler exited with status 1

Even if the testcase is buggy, we shouldn't ICE on it, so it is also an ObjC FE
bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
  2010-10-07  8:18 ` [Bug objc/45925] " nicola at gcc dot gnu.org
  2010-10-07  8:36 ` jakub at gcc dot gnu.org
@ 2010-10-07  8:38 ` nicola at gcc dot gnu.org
  2010-10-07  9:09 ` nicola at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-10-07  8:38 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2010-10-07  8:38 ` nicola at gcc dot gnu.org
@ 2010-10-07  9:09 ` nicola at gcc dot gnu.org
  2010-10-07 18:38 ` nicola at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-10-07  9:09 UTC (permalink / raw)
  To: gcc-bugs

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

Nicola Pero <nicola at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.10.07 09:08:42
         AssignedTo|unassigned at gcc dot       |nicola at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #4 from Nicola Pero <nicola at gcc dot gnu.org> 2010-10-07 09:08:42 UTC ---
Actually, at a closer look it's a bug in the new code.  This fixes it --

Index: objc-act.c
===================================================================
--- objc-act.c  (revision 165067)
+++ objc-act.c  (working copy)
@@ -10325,7 +10325,7 @@ objc_finish_foreach_loop (location_t location, tre
                                    (NULL_TREE, build_int_cst (NULL_TREE, 16),
NULL_TREE))));
   }
 #endif
-  t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl, t);
+  t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl,
convert (long_unsigned_type_node, t));
   SET_EXPR_LOCATION (t, location);
   append_to_statement_list (t, &BIND_EXPR_BODY (bind));

@@ -10498,7 +10498,7 @@ objc_finish_foreach_loop (location_t location, tre
                                    (NULL_TREE, build_int_cst (NULL_TREE, 16),
NULL_TREE))));
   }
 #endif
-  t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl, t);
+  t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl,
convert (long_unsigned_type_node, t));
   SET_EXPR_LOCATION (t, location);
   append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind));

We'll apply once approved.

Thanks


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2010-10-07  9:09 ` nicola at gcc dot gnu.org
@ 2010-10-07 18:38 ` nicola at gcc dot gnu.org
  2010-10-07 18:40 ` nicola at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-10-07 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Nicola Pero <nicola at gcc dot gnu.org> 2010-10-07 18:37:49 UTC ---
Author: nicola
Date: Thu Oct  7 18:37:43 2010
New Revision: 165129

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165129
Log:
In gcc/:
2010-10-07  Nicola Pero  <nicola.pero@meta-innovation.com>

        * doc/objc.texi (Fast enumeration protocol): Mention that
        'unsigned int' can also be used instead of 'unsigned long' in
        countByEnumeratingWithState:objects:count:.

In gcc/objc/:
2010-10-07  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/45925
        * objc-act.c (objc_finish_foreach_loop): Convert return value of
        countByEnumeratingWithState:objects:count: to long unsigned int.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/objc.texi
    trunk/gcc/objc/ChangeLog
    trunk/gcc/objc/objc-act.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2010-10-07 18:38 ` nicola at gcc dot gnu.org
@ 2010-10-07 18:40 ` nicola at gcc dot gnu.org
  2010-10-17  9:59 ` nicola at gcc dot gnu.org
  2010-10-17 17:05 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-10-07 18:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Nicola Pero <nicola at gcc dot gnu.org> 2010-10-07 18:40:38 UTC ---
This should be fixed now.  Can you confirm that the failures on 64-bit have
gone away ? :-)

Thanks


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2010-10-07 18:40 ` nicola at gcc dot gnu.org
@ 2010-10-17  9:59 ` nicola at gcc dot gnu.org
  2010-10-17 17:05 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-10-17  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

Nicola Pero <nicola at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug objc/45925] New objc test failures
  2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2010-10-17  9:59 ` nicola at gcc dot gnu.org
@ 2010-10-17 17:05 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-17 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.0

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-17 17:05:16 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-10-17 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-07  0:09 [Bug objc/45925] New: New objc test failures hjl.tools at gmail dot com
2010-10-07  8:18 ` [Bug objc/45925] " nicola at gcc dot gnu.org
2010-10-07  8:36 ` jakub at gcc dot gnu.org
2010-10-07  8:38 ` nicola at gcc dot gnu.org
2010-10-07  9:09 ` nicola at gcc dot gnu.org
2010-10-07 18:38 ` nicola at gcc dot gnu.org
2010-10-07 18:40 ` nicola at gcc dot gnu.org
2010-10-17  9:59 ` nicola at gcc dot gnu.org
2010-10-17 17:05 ` hjl.tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).