public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "chengniansun at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60036] New: Spurious signedness conversion warning with relational operator
Date: Mon, 03 Feb 2014 00:03:00 -0000	[thread overview]
Message-ID: <bug-60036-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 60036
           Summary: Spurious signedness conversion warning with relational
                    operator
           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

Gcc-trunk emits a signedness conversion warning for the statement "f ^= fn1() >
a;". However, as the value of "fn1() > a" is either 1 or 0, the warning is not
true. 

Moreover, Gcc-4.8 and 4.7 do not output this warning. And if I change the
statement to "f = f ^ (fn1() > a);", gcc-trunk does not emit this warning,
either.



$: cat conversion-for-boolean.c
extern int fn1();
unsigned fn(int a) {
  unsigned f = 9;
  f ^= fn1() > a;
  return f;
}

$: gcc-trunk -c -Wconversion -std=c11 conversion-for-boolean.c
conversion-for-boolean.c: In function ‘fn’:
conversion-for-boolean.c:4:5: warning: conversion to ‘unsigned int’ from ‘int’
may change the sign of the result [-Wsign-conversion]
   f ^= fn1() > a;
     ^
$: gcc-4.8 -c -Wconversion -std=c11 conversion-for-boolean.c
$: gcc-4.7 -c -Wconversion -std=c11 conversion-for-boolean.c
$: gcc-trunk --version
gcc-trunk (GCC) 4.9.0 20140131 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>From gcc-bugs-return-442340-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Feb 03 01:40:36 2014
Return-Path: <gcc-bugs-return-442340-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3922 invoked by alias); 3 Feb 2014 01:40:34 -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 3880 invoked by uid 48); 3 Feb 2014 01:40:29 -0000
From: "alexa.gerancho at hushmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58854] [4.8 regression] "sub sp, fp, #40" hoisted above frame accesses
Date: Mon, 03 Feb 2014 01:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: alexa.gerancho at hushmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ramana at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58854-4-x3AD9ZUnsN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58854-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58854-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/msg00097.txt.bz2
Content-length: 567

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX854

Alexa <alexa.gerancho at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexa.gerancho at hushmail dot com

--- Comment #13 from Alexa <alexa.gerancho at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen live from the domain http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


             reply	other threads:[~2014-02-03  0:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03  0:03 chengniansun at gmail dot com [this message]
2014-02-04 10:59 ` [Bug c/60036] " mpolacek at gcc dot gnu.org
2014-02-04 12:17 ` [Bug c/60036] [4.9 Regression] " mpolacek at gcc dot gnu.org
2014-02-04 18:06 ` mpolacek at gcc dot gnu.org
2014-02-04 18:08 ` mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60036-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).