public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/59327] New: warning in expand_used_vars
@ 2013-11-28 10:00 amylaar at gcc dot gnu.org
  2013-11-28 11:42 ` [Bug middle-end/59327] " amylaar at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-11-28 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59327
           Summary: warning in expand_used_vars
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amylaar at gcc dot gnu.org
                CC: jakub at redhat dot com

Code added this morning to cfgexpand.c:expand_used_vars causes a warning:

g++ -c   -g  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/.
-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include 
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd
-I../libdecnumber -I../../gcc/gcc/../libbacktrace    -o cfgexpand.o -MT
cfgexpand.o -MMD -MP -MF ./.deps/cfgexpand.TPo ../../gcc/gcc/cfgexpand.c
../../gcc/gcc/cfgexpand.c: In function ‘rtx_def* expand_used_vars()’:
../../gcc/gcc/cfgexpand.c:1836:35: error: comparison between signed and
unsigned integer expressions [-Werror=sign-compare]
        && sz + ASAN_RED_ZONE_SIZE >= data.asan_alignb)
                                   ^
cc1plus: all warnings being treated as errors
make: *** [cfgexpand.o] Error 1


Seen for target arc-elf.
[amylaar@rowan gcc]$ g++ --version
g++ (GCC) 4.9.0 20131126 (experimental)
Copyright (C) 2013 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.

[amylaar@rowan gcc]$ uname -a
Linux rowan 3.11.7-200.fc19.i686.PAE #1 SMP Mon Nov 4 14:22:33 UTC 2013 i686
i686 i386 GNU/Linux
>From gcc-bugs-return-436096-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Nov 28 10:00:32 2013
Return-Path: <gcc-bugs-return-436096-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4415 invoked by alias); 28 Nov 2013 10:00:32 -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 4386 invoked by uid 48); 28 Nov 2013 10:00:29 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/59323] [4.9 Regression] Int. comp. error: in add_AT_specification, at dwarf2out.c:4026
Date: Thu, 28 Nov 2013 10:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code, lto
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on target_milestone everconfirmed
Message-ID: <bug-59323-4-1YCuEWFjFs@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59323-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59323-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: 2013-11/txt/msg02873.txt.bz2
Content-length: 1736

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-28
   Target Milestone|---                         |4.9.0
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Nested functions.  There seems to be a declaration coming in
from BLOCK_VARS

#5  0x000000000074b91a in decls_for_scope (stmt=<block 0x7ffff6e4f190>,
    context_die=0x7ffff6e4f050, depth=2)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:19971

but the decl itself has non-BLOCK scope (its DECL_CONTEXT is the main fn).

There are two BLOCKs which contain the exact same BLOCK_VARs ...

So it seems we duplicate BLOCKs either bogously during streaming (maybe only
in the context of nested functions) or they are duplicate also in the
compile phase.

It seems that one BLOCK is BLOCK_SUPERCONTEXT of the other which cannot
really be a streaming artifact.

It's a tree merging artifact - we merge the TYPE_DECLs for

    enum { X };

which end up being written to the global section despite their
DECL_CONTEXT being a FUNCTION_DECL (bah).  Such merging happens
without considering DECL_CHAIN as we assume they are not in BLOCK
context.  They end up there because the nested function decl 'foo'
is in that same block (I think) and thus they form a tree SCC
via BLOCK_VARS.

Ah no - it's ultimately the CONST_DECL for X that pulls the enum
type and its type decl global.  Ick...

I have a fix.


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

* [Bug middle-end/59327] warning in expand_used_vars
  2013-11-28 10:00 [Bug middle-end/59327] New: warning in expand_used_vars amylaar at gcc dot gnu.org
@ 2013-11-28 11:42 ` amylaar at gcc dot gnu.org
  2013-11-28 11:46 ` [Bug middle-end/59327] [4.9 Regression] " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-11-28 11:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
sz is HOST_WIDE_INT, ASAN_RED_ZONE_SIZE is an int literal, and data.asan_alignb
is an unsigned int.

With 32 bit int and HOST_WIDE_INT, this results in a 32 bit signed/unsigned
comparison.

When building a target with need_64bit_hwint (according to config.gcc),
on a host with 32 bit int, the right hand side of the comparison gets
sign extended to HOST_WIDE_INT, thus the warning will not show up when
testing such a combination / bootstrapping such a host/target.


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

* [Bug middle-end/59327] [4.9 Regression] warning in expand_used_vars
  2013-11-28 10:00 [Bug middle-end/59327] New: warning in expand_used_vars amylaar at gcc dot gnu.org
  2013-11-28 11:42 ` [Bug middle-end/59327] " amylaar at gcc dot gnu.org
@ 2013-11-28 11:46 ` jakub at gcc dot gnu.org
  2013-11-28 22:52 ` jakub at gcc dot gnu.org
  2013-11-29  7:52 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-28 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31318
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31318&action=edit
gcc49-pr59327.patch

Untested fix.


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

* [Bug middle-end/59327] [4.9 Regression] warning in expand_used_vars
  2013-11-28 10:00 [Bug middle-end/59327] New: warning in expand_used_vars amylaar at gcc dot gnu.org
  2013-11-28 11:42 ` [Bug middle-end/59327] " amylaar at gcc dot gnu.org
  2013-11-28 11:46 ` [Bug middle-end/59327] [4.9 Regression] " jakub at gcc dot gnu.org
@ 2013-11-28 22:52 ` jakub at gcc dot gnu.org
  2013-11-29  7:52 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-28 22:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Thu Nov 28 22:52:40 2013
New Revision: 205499

URL: http://gcc.gnu.org/viewcvs?rev=205499&root=gcc&view=rev
Log:
    PR middle-end/59327
    * cfgexpand.c (expand_used_vars): Avoid warning on 32-bit
    HWI hosts.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgexpand.c


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

* [Bug middle-end/59327] [4.9 Regression] warning in expand_used_vars
  2013-11-28 10:00 [Bug middle-end/59327] New: warning in expand_used_vars amylaar at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-11-28 22:52 ` jakub at gcc dot gnu.org
@ 2013-11-29  7:52 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-29  7:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2013-11-29  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-28 10:00 [Bug middle-end/59327] New: warning in expand_used_vars amylaar at gcc dot gnu.org
2013-11-28 11:42 ` [Bug middle-end/59327] " amylaar at gcc dot gnu.org
2013-11-28 11:46 ` [Bug middle-end/59327] [4.9 Regression] " jakub at gcc dot gnu.org
2013-11-28 22:52 ` jakub at gcc dot gnu.org
2013-11-29  7:52 ` jakub 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).