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/59976] New: Spurious warning on converting const int variable to unsigned long
Date: Wed, 29 Jan 2014 07:39:00 -0000	[thread overview]
Message-ID: <bug-59976-4@http.gcc.gnu.org/bugzilla/> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 7319 bytes --]

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

            Bug ID: 59976
           Summary: Spurious warning on converting const int variable to
                    unsigned long
           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

I define a static global variable "g" of type "const int", with a value 0. When
assigning it to a variable of type unsigned long, Gcc emits a warning on the
signedness conversion. As "g" is not modifiable and equivalent to "0", there is
no signedness conversion actually. 




$: cat s.c
static const int g = 0;
void fn() {
  unsigned long l = g;
}
$: gcc-trunk -c -Wconversion s.c
s.c: In function ‘fn’:
s.c:3:3: warning: conversion to ‘long unsigned int’ from ‘int’ may change the
sign of the result [-Wsign-conversion]
   unsigned long l = g;
   ^
$: gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/chengniansun/tools/gcc-trunk-binaries/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --enable-languages=c,c++
--disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries :
(reconfigured) ../gcc-trunk/configure --enable-languages=c,c++
--disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries
Thread model: posix
gcc version 4.9.0 20140127 (experimental) (GCC)
$:
$: clang-trunk -c -Wconversion s.c
$:
>From gcc-bugs-return-441835-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 29 08:56:38 2014
Return-Path: <gcc-bugs-return-441835-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30819 invoked by alias); 29 Jan 2014 08:56:37 -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 30804 invoked by uid 48); 29 Jan 2014 08:56:32 -0000
From: "nheghathivhistha at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/59977] New: lto1: internal compiler error: bytecode stream: expected tag real_type instead of error_mark
Date: Wed, 29 Jan 2014 08:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: nheghathivhistha 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 attachments.created
Message-ID: <bug-59977-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-01/txt/msg02977.txt.bz2
Content-length: 3787

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

            Bug ID: 59977
           Summary: lto1: internal compiler error: bytecode stream:
                    expected tag real_type instead of error_mark
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nheghathivhistha at gmail dot com

Created attachment 31975
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1975&actioníit
un-reduced gzipped preprocessed file

When I remove libraries it not ICEs.
Creduce is stuck at beginning and not able to remove any line.
When I ran
cat testcase.i | grep -v '^# .*$' | grep -v '^[[:space:]]*$' > testcase.x
on ii file and test the resulting files with comments removed it not ICEs with
the same compilation command.

gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0-alpha20140128/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140128/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.9.0_alpha20140128/work/gcc-4.9-20140128/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0-alpha20140128
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140128/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140128
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140128/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140128/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140128/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140128/python
--enable-languages=c,c++,java,go,objc,obj-c++,fortran,ada --enable-obsolete
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.9.0_alpha20140128' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --disable-altivec --disable-fixed-point
--enable-targets=all --enable-java-awt=gtk --enable-libgomp --enable-lto
--without-cloog
Thread model: posix
gcc version 4.9.0-alpha20140128 20140129 (experimental) [trunk revision 207224]
(Gentoo 4.9.0_alpha20140128)

The command is:

LC_ALL=C LANG=C  /usr/bin/x86_64-pc-linux-gnu-g++  -fPIC -flto=4
-fuse-linker-plugin -O2 -ggdb -pipe -march=native -mtune=native
-Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall
-W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS
-fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics
-fvisibility=hidden -fvisibility-inlines-hidden  -march=core2 -msse2 -msse3
-mssse3 -msse4.1 -mno-sse4.2 -mno-sse4a -mno-avx -mno-xop -mno-fma4  -Wabi
-fabi-version=0 -ffp-contractúst -Wl,--enable-new-dtags -Wl,--no-undefined
-lc  -flto=4 -fuse-linker-plugin -Wl,--as-needed -Wl,-O2 -O2 -ggdb -pipe
-march=native -mtune=native -shared -Wl,-soname,libpigmentcms.so.13 -o
/dev/null
/var/tmp/portage/app-office/calligra-2.7.91/work/calligra-2.7.91_build/libs/pigment/KoOptimizedCompositeOpFactoryPerArch_Scalar.ii
-L/var/tmp/portage/app-office/calligra-2.7.91/work/calligra-2.7.91_build/lib
-L/usr/lib64/qt4
/var/tmp/portage/app-office/calligra-2.7.91/work/calligra-2.7.91_build/lib/libkoplugin.so.13.0.0
-lImath -lIlmImf -lIex -lHalf -lIlmThread -Wl,-Bstatic -lVc -Wl,-Bdynamic
/usr/lib64/qt4/libQtGui.so /usr/lib64/qt4/libQtXml.so
/usr/lib64/libkdecore.so.5.12.1 /usr/lib64/qt4/libQtDBus.so
/usr/lib64/qt4/libQtCore.so -lpthread

How can I reduce it please?


             reply	other threads:[~2014-01-29  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  7:39 chengniansun at gmail dot com [this message]
2014-02-04 23:16 ` [Bug c/59976] Spurious warning on converting const int variable to unsigned long (Also inconsistency between O0 and O1) chengniansun at gmail dot com

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