public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60090] New: For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"
@ 2014-02-06  8:01 chengniansun at gmail dot com
  2014-02-06  8:27 ` [Bug c/60090] " mpolacek at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-06  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

However, in a syntactic perspective, the warning message is confusing, given
the fact that there is no '~' in this expression. 

$: cat s.c
int fn1(unsigned char a, unsigned char b) {
  const unsigned l = 4294967295u;
  return (l ^ a) != b;
}
$: gcc-trunk -c -Wsign-compare s.c
$: gcc-trunk -c -Wsign-compare s.c -O1
s.c: In function ‘fn1’:
s.c:3:18: warning: comparison of promoted ~unsigned with unsigned
[-Wsign-compare]
   return (l ^ a) != b;
                  ^
>From gcc-bugs-return-442784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 06 08:10:09 2014
Return-Path: <gcc-bugs-return-442784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
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: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
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" <gcc-bugzilla@gcc.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: <bug-59469-4-h9ISaan9l4@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59469-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59469-4@http.gcc.gnu.org/bugzilla/>
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?idY469

--- Comment #45 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
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.


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

end of thread, other threads:[~2023-05-20  4:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06  8:01 [Bug c/60090] New: For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned" chengniansun at gmail dot com
2014-02-06  8:27 ` [Bug c/60090] " mpolacek at gcc dot gnu.org
2014-02-06  8:32 ` mpolacek at gcc dot gnu.org
2014-02-06  9:42 ` mpolacek at gcc dot gnu.org
2014-02-06 12:54 ` manu at gcc dot gnu.org
2014-02-06 13:04 ` mpolacek at gcc dot gnu.org
2023-05-20  4:38 ` pinskia at gcc dot gnu.org

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