From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3229 invoked by alias); 6 Feb 2014 08:01:57 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3189 invoked by uid 48); 6 Feb 2014 08:01:54 -0000 From: "chengniansun at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/60090] New: For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned" Date: Thu, 06 Feb 2014 08:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chengniansun at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00540.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60090 Bug ID: 60090 Summary: For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned" Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com For the expression "(l ^ a) !=3D b", gcc -O0 emits no warning, but gcc -O1 = emits a warning "comparison of promoted ~unsigned with unsigned". After checking = the gimple code, I found the optimization transforms the expression to a bitwise not expression.=20 However, in a syntactic perspective, the warning message is confusing, given the fact that there is no '~' in this expression.=20 $: cat s.c int fn1(unsigned char a, unsigned char b) { const unsigned l =3D 4294967295u; return (l ^ a) !=3D b; } $: gcc-trunk -c -Wsign-compare s.c $: gcc-trunk -c -Wsign-compare s.c -O1 s.c: In function =E2=80=98fn1=E2=80=99: s.c:3:18: warning: comparison of promoted ~unsigned with unsigned [-Wsign-compare] return (l ^ a) !=3D b; ^ >>From gcc-bugs-return-442784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 06 08:10:09 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 6800 invoked by alias); 6 Feb 2014 08:10:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 6750 invoked by uid 48); 6 Feb 2014 08:10:05 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/59469] [4.8/4.9 Regression] LLVM build failure with gcc LTO Date: Thu, 06 Feb 2014 08:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00541.txt.bz2 Content-length: 342 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59469 --- Comment #45 from Jan Hubicka --- The bug here is that lto-cgraph.c still checks DECL_COMDAT as a condition if symbol is duplicated or partitioned. We really need to get the logic into lto-cgraph.c and use same test at both places... Will do that tomorrow.