public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
@ 2011-10-16 10:46 mikpe at it dot uu.se
  2011-10-16 10:51 ` [Bug objc/50743] " mikpe at it dot uu.se
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2011-10-16 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50743
           Summary: [4.7 regression] objc-act.c triggers
                    -Werror=sign-compare breaking bootstrap
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mikpe@it.uu.se


Attempting to bootstrap gcc-4.7-20111015 with objc enabled and
--disable-build-poststage1-with-cxx fails with:

/mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c: In function
'check_duplicates':
/mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5073:21: error: comparison
between signed and unsigned integer expressions [-Werror=sign-compare]
/mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5106:17: error: comparison
between signed and unsigned integer expressions [-Werror=sign-compare]
/mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c: In function
'insert_method_into_method_map':
/mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5828:18: error: comparison
between signed and unsigned integer expressions [-Werror=sign-compare]
/mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5840:18: error: comparison
between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors

make[3]: *** [objc/objc-act.o] Error 1
make[3]: Leaving directory `/mnt/scratch/objdir47/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/mnt/scratch/objdir47'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir47'
make: *** [bootstrap] Error 2

This is a regression from r179965:
http://gcc.gnu.org/ml/gcc-cvs/2011-10/msg00561.html

The issue is that the code was rewritten to use a number or for-loops with a
size_t index and a TREE_VEC_LENGTH limit; however, TREE_VEC_LENGTH returns a
signed integer, resulting in a signed/unsigned comparison.  The C front-end
catches this error, but the C++ front-end fails to do so due to PR50012.


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

* [Bug objc/50743] [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
  2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
@ 2011-10-16 10:51 ` mikpe at it dot uu.se
  2011-10-16 11:04 ` nicola at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2011-10-16 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> 2011-10-16 10:50:19 UTC ---
Created attachment 25515
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25515
preliminary patch

Casting the value of TREE_VEC_LENGTH to size_t before comparing it with a
size_t index fixes the issue for me on i686-linux.


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

* [Bug objc/50743] [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
  2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
  2011-10-16 10:51 ` [Bug objc/50743] " mikpe at it dot uu.se
@ 2011-10-16 11:04 ` nicola at gcc dot gnu.org
  2011-10-16 11:32 ` mikpe at it dot uu.se
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nicola at gcc dot gnu.org @ 2011-10-16 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-16
     Ever Confirmed|0                           |1

--- Comment #2 from Nicola Pero <nicola at gcc dot gnu.org> 2011-10-16 11:03:59 UTC ---
Thanks for reporting this!  The patch looks good to me (but I can't approve
it).  
Alternatively, I suppose, the iterating variable itself could be declared as
int.

Do you want to submit the patch to gcc-patches@gnu.org ?

Thanks


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

* [Bug objc/50743] [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
  2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
  2011-10-16 10:51 ` [Bug objc/50743] " mikpe at it dot uu.se
  2011-10-16 11:04 ` nicola at gcc dot gnu.org
@ 2011-10-16 11:32 ` mikpe at it dot uu.se
  2011-10-18 11:33 ` nicola at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2011-10-16 11:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mikael Pettersson <mikpe at it dot uu.se> 2011-10-16 11:31:52 UTC ---
(In reply to comment #2)
> Thanks for reporting this!  The patch looks good to me (but I can't approve
> it).  

Thanks.

> Do you want to submit the patch to gcc-patches@gnu.org ?

Submitted:
http://gcc.gnu.org/ml/gcc-patches/2011-10/msg01416.html


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

* [Bug objc/50743] [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
  2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
                   ` (2 preceding siblings ...)
  2011-10-16 11:32 ` mikpe at it dot uu.se
@ 2011-10-18 11:33 ` nicola at gcc dot gnu.org
  2011-10-18 11:40 ` nicola at gcc dot gnu.org
  2011-10-18 22:27 ` mikpe at it dot uu.se
  5 siblings, 0 replies; 7+ messages in thread
From: nicola at gcc dot gnu.org @ 2011-10-18 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Nicola Pero <nicola at gcc dot gnu.org> 2011-10-18 11:31:49 UTC ---
Author: nicola
Date: Tue Oct 18 11:31:45 2011
New Revision: 180132

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180132
Log:
In gcc/objc/:
2011-10-18  Mikael Pettersson  <mikpe@it.uu.se>

    PR objc/50743
    * objc-act.c (check_duplicates): Cast TREE_VEC_LENGTH result to
    size_t to avoid signed/unsigned
    comparison.
    (insert_method_into_method_map): Likewise.

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


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

* [Bug objc/50743] [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
  2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
                   ` (3 preceding siblings ...)
  2011-10-18 11:33 ` nicola at gcc dot gnu.org
@ 2011-10-18 11:40 ` nicola at gcc dot gnu.org
  2011-10-18 22:27 ` mikpe at it dot uu.se
  5 siblings, 0 replies; 7+ messages in thread
From: nicola at gcc dot gnu.org @ 2011-10-18 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Nicola Pero <nicola at gcc dot gnu.org> 2011-10-18 11:39:55 UTC ---
Can you confirm that trunk is now OK ?

Thanks


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

* [Bug objc/50743] [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap
  2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
                   ` (4 preceding siblings ...)
  2011-10-18 11:40 ` nicola at gcc dot gnu.org
@ 2011-10-18 22:27 ` mikpe at it dot uu.se
  5 siblings, 0 replies; 7+ messages in thread
From: mikpe at it dot uu.se @ 2011-10-18 22:27 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Mikael Pettersson <mikpe at it dot uu.se> 2011-10-18 22:26:28 UTC ---
Fixed.


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

end of thread, other threads:[~2011-10-18 22:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-16 10:46 [Bug objc/50743] New: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap mikpe at it dot uu.se
2011-10-16 10:51 ` [Bug objc/50743] " mikpe at it dot uu.se
2011-10-16 11:04 ` nicola at gcc dot gnu.org
2011-10-16 11:32 ` mikpe at it dot uu.se
2011-10-18 11:33 ` nicola at gcc dot gnu.org
2011-10-18 11:40 ` nicola at gcc dot gnu.org
2011-10-18 22:27 ` mikpe at it dot uu.se

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).