public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61677] New: False positive with -Wmaybe-uninitialized (test case included)
@ 2014-07-02 22:24 josh at joshtriplett dot org
  2014-07-03  6:51 ` [Bug middle-end/61677] " schwab@linux-m68k.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: josh at joshtriplett dot org @ 2014-07-02 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61677

            Bug ID: 61677
           Summary: False positive with -Wmaybe-uninitialized (test case
                    included)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: josh at joshtriplett dot org

Created attachment 33055
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33055&action=edit
Test case for false positive in -Wmaybe-uninitialized

With the attached file bug.i:

$ gcc -Wall -O2 -c bug.i -o /dev/null
In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c:551:19: note: ‘jump’ was declared here

The warning occurs in get_prompt_str, which initializes jump if (head &&
location), and subsequently uses jump if (head && location && ...).

gcc --version says "gcc (Debian 4.9.0-9) 4.9.0"
>From gcc-bugs-return-455535-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 02 22:32:31 2014
Return-Path: <gcc-bugs-return-455535-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13553 invoked by alias); 2 Jul 2014 22:32:29 -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 13119 invoked by uid 48); 2 Jul 2014 22:32:16 -0000
From: "larsbj at gullik dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/61678] New: internal compiler error: in expand_expr_real_1, at expr.c:9467
Date: Wed, 02 Jul 2014 22:32: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.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: larsbj at gullik dot net
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: <bug-61678-4@http.gcc.gnu.org/bugzilla/>
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-07/txt/msg00126.txt.bz2
Content-length: 1460

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61678

            Bug ID: 61678
           Summary: internal compiler error: in expand_expr_real_1, at
                    expr.c:9467
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: larsbj at gullik dot net

$ cat main.ii
struct Test {
    Test();
};

Test::Test()
{
    int w = 512;
    unsigned rgb_ref[1][w];
}


Gives this error:

$ /opt/gcc/gcc-trunk/bin/g++ -c main.ii
main.ii: In constructor ‘Test::Test()’:
main.ii:8:26: internal compiler error: in expand_expr_real_1, at expr.c:9467
     unsigned rgb_ref[1][w];
                          ^
0x77961b expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc/gcc/expr.c:9462
0x7825e5 expand_expr
        ../../gcc/gcc/expr.h:451
0x7825e5 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        ../../gcc/gcc/expr.c:8151
0x6c542e expand_gimple_stmt_1
        ../../gcc/gcc/cfgexpand.c:3294
0x6c542e expand_gimple_stmt
        ../../gcc/gcc/cfgexpand.c:3354
0x6c656a expand_gimple_basic_block
        ../../gcc/gcc/cfgexpand.c:5192
0x6c8166 execute
        ../../gcc/gcc/cfgexpand.c:5799


This is with $ /opt/gcc/gcc-trunk/bin/g++ --version
g++ (GCC) 4.10.0 20140702 (experimental)
>From gcc-bugs-return-455536-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 02 23:00:38 2014
Return-Path: <gcc-bugs-return-455536-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22662 invoked by alias); 2 Jul 2014 23:00:36 -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 22291 invoked by uid 48); 2 Jul 2014 23:00:21 -0000
From: "gary at intrepid dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/61679] New: build fails with G++ 4.5.1 - prototype for hash_table does not match any in class
Date: Wed, 02 Jul 2014 23:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: gary at intrepid 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: <bug-61679-4@http.gcc.gnu.org/bugzilla/>
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-07/txt/msg00127.txt.bz2
Content-length: 2504

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61679

            Bug ID: 61679
           Summary: build fails with G++ 4.5.1 - prototype for hash_table
                    does not match any in class
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gary at intrepid dot com

This build failure shows up on a recent source version of GCC 4.10 (212138
2014-06-30).  An attempt to bootstrap the compiler on an older system with GCC
4.5.1 installed fails as follows:

/a/gcc-4.5.1/bld/rls/bin/g++ -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND
-DIN_GCC_FRONTEND -O0 -g3 -DIN_GCC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I.
-I. -I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc
-I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/.
-I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/../include
-I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/../libcpp/include 
-I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/../libdecnumber
-I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/../libdecnumber/bid
-I../libdecnumber -I/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/../libbacktrace   
-o attribs.o -MT attribs.o -MMD -MP -MF ./.deps/attribs.TPo
/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/attribs.c
In file included from /eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/attribs.c:35:0:
/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/hash-table.h:667:1: error: prototype
for ‘typename Descriptor::value_type** hash_table<Descriptor, Allocator,
false>::find_empty_slot_for_expand(hashval_t)’ does not match any in class
‘hash_table<Descriptor, Allocator, false>’
/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/hash-table.h:606:16: error: candidate
is: hash_table<Descriptor, Allocator, false>::value_type**
hash_table<Descriptor, Allocator, false>::find_empty_slot_for_expand(hashval_t)
/eng/upc/dev/gary/gupc-gcc-trunk/src/gcc/hash-table.h:807:1: error: prototype
for ‘typename Descriptor::value_type* hash_table<Descriptor, Allocator,
false>::find_with_hash(hash_table<Descriptor, Allocator, false>::compare_type*,
hashval_t)’ does not match any in class ‘hash_table<Descriptor, Allocator,
false>’
[...]
>From gcc-bugs-return-455537-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 02 23:24:42 2014
Return-Path: <gcc-bugs-return-455537-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25895 invoked by alias); 2 Jul 2014 23:24:41 -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 25828 invoked by uid 48); 2 Jul 2014 23:24:29 -0000
From: "longb at cray dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/61680] New: vectorization gives wrong answer for sandybridge target
Date: Wed, 02 Jul 2014 23:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: longb at cray 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-61680-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-07/txt/msg00128.txt.bz2
Content-length: 879

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida680

            Bug ID: 61680
           Summary: vectorization gives wrong answer for sandybridge
                    target
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com

Created attachment 33056
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3056&actioníit
test3.f90

Bad result:

> gfortran -march=corei7-avx -O3 test3.f90
> ./a.out
   10.000000000000000

Good result:

> gfortran -march=corei7-avx -O3 -fno-tree-vectorize  test3.f90
> ./a.out
   13.114877048604001
>

Version info:

> gfortran --version
GNU Fortran (GCC) 4.9.0 20140422 (Cray Inc.)
Copyright (C) 2014 Free Software Foundation, Inc.


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

end of thread, other threads:[~2022-08-29 14:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 22:24 [Bug c/61677] New: False positive with -Wmaybe-uninitialized (test case included) josh at joshtriplett dot org
2014-07-03  6:51 ` [Bug middle-end/61677] " schwab@linux-m68k.org
2014-07-03 15:17 ` manu at gcc dot gnu.org
2014-07-03 15:26 ` manu at gcc dot gnu.org
2021-03-29 21:23 ` [Bug middle-end/61677] False positive with -Wmaybe-uninitialized (predicate analysis, VRP) cvs-commit at gcc dot gnu.org
2021-03-29 21:29 ` msebor at gcc dot gnu.org
2022-08-29 14:26 ` [Bug tree-optimization/61677] " rguenth 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).