public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754
@ 2020-11-19 10:38 dcb314 at hotmail dot com
  2020-11-19 11:13 ` [Bug c++/97905] " dcb314 at hotmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-11-19 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97905
           Summary: ice in duplicate_decls, at cp/decl.c:2754
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 49594
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49594&action=edit
gzipped C++ source code

For the attached C++ code, recent gcc trunk does this:

route.cc:37:12: internal compiler error: in duplicate_decls, at cp/decl.c:2754
0x6f5168 duplicate_decls(tree_node*, tree_node*, bool, bool)
        ../../trunk.git/gcc/cp/decl.c:2752
0x79cf73 do_pushdecl(tree_node*, bool)
        ../../trunk.git/gcc/cp/name-lookup.c:2970
0x79fed5 pushdecl(tree_node*, bool)
        ../../trunk.git/gcc/cp/name-lookup.c:3109
0x79fed5 maybe_push_decl(tree_node*)
        ../../trunk.git/gcc/cp/name-lookup.c:3140

The bug seems to exist sometime between git hash ecf65330c11544eb,
dated 20201117 and hash cb1a4876a0e724ca, dated 20201118.

Flag -march=bdver2 required.

Since I now understand git bisect, I will have a go at finding a broken
commit.

I will also have my usual go at reducing the code.

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

* [Bug c++/97905] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
@ 2020-11-19 11:13 ` dcb314 at hotmail dot com
  2020-11-19 12:21 ` dcb314 at hotmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-11-19 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C++ test case seems to be:

template <typename> void a() { extern int *b; }
int *b;

git bisect proceeds in other window. 

If all I am interested in is the performance of cc1plus, which 
make target should I use to build only this binary and not all 
the C and C++ libraries ?

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

* [Bug c++/97905] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
  2020-11-19 11:13 ` [Bug c++/97905] " dcb314 at hotmail dot com
@ 2020-11-19 12:21 ` dcb314 at hotmail dot com
  2020-11-19 13:46 ` [Bug c++/97905] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-11-19 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
I am getting git bisect results which indicate either commit
cb1a4876a0e724ca3962ec14dce9e7819fa72ea5 or commit
ba97b532604815333848ee30e069dde6e36ce4c9 is at fault.

Neither seem anything to do with C++ or the optimizer, so I must 
have made a mistake somewhere.

Assistance sought.

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
  2020-11-19 11:13 ` [Bug c++/97905] " dcb314 at hotmail dot com
  2020-11-19 12:21 ` dcb314 at hotmail dot com
@ 2020-11-19 13:46 ` rguenth at gcc dot gnu.org
  2020-11-19 14:49 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-19 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |11.0
           Keywords|                            |ice-on-valid-code
            Summary|ice in duplicate_decls, at  |[11 Regression] ice in
                   |cp/decl.c:2754              |duplicate_decls, at
                   |                            |cp/decl.c:2754
   Target Milestone|---                         |11.0

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2020-11-19 13:46 ` [Bug c++/97905] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-11-19 14:49 ` mpolacek at gcc dot gnu.org
  2020-11-19 15:07 ` nathan at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org,
                   |                            |nathan at gcc dot gnu.org
   Last reconfirmed|                            |2020-11-19
     Ever confirmed|0                           |1

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, started with r11-5108.

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2020-11-19 14:49 ` mpolacek at gcc dot gnu.org
@ 2020-11-19 15:07 ` nathan at gcc dot gnu.org
  2020-11-19 15:10 ` nathan at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-11-19 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

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

--- Comment #4 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
discussion on cwg leads me to conclude part of the error in the original
problem is believing the block-scope extern is matching the one found by the
using decl.

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2020-11-19 15:07 ` nathan at gcc dot gnu.org
@ 2020-11-19 15:10 ` nathan at gcc dot gnu.org
  2020-11-19 15:18 ` dcb314 at hotmail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-11-19 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
David, to build just cc1plus: 'make -C gcc cc1plus -j$how_many_cpus_available'

pass 'CXXFLAGS=$whatever' to override the default (usually -O2 -g)

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2020-11-19 15:10 ` nathan at gcc dot gnu.org
@ 2020-11-19 15:18 ` dcb314 at hotmail dot com
  2020-11-19 15:34 ` nathan at acm dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-11-19 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Nathan Sidwell from comment #5)
> David, to build just cc1plus: 'make -C gcc cc1plus
> -j$how_many_cpus_available'
> 
> pass 'CXXFLAGS=$whatever' to override the default (usually -O2 -g)

$ cd /home/dcb/gcc/
$ mkdir working
$ cd working
$ ../trunk.git/configure --whatever
$ ls -l gcc
ls: cannot access 'gcc': No such file or directory

Thanks for the tip, but after a configure, there is no gcc directory
available.

Does your tip only apply if there is a previous build available 
or have I misunderstood ?

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2020-11-19 15:18 ` dcb314 at hotmail dot com
@ 2020-11-19 15:34 ` nathan at acm dot org
  2020-11-19 17:56 ` cvs-commit at gcc dot gnu.org
  2020-11-19 17:57 ` nathan at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at acm dot org @ 2020-11-19 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Nathan Sidwell <nathan at acm dot org> ---
On 11/19/20 10:18 AM, dcb314 at hotmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97905
> 
> --- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
> (In reply to Nathan Sidwell from comment #5)
>> David, to build just cc1plus: 'make -C gcc cc1plus
>> -j$how_many_cpus_available'
>>
>> pass 'CXXFLAGS=$whatever' to override the default (usually -O2 -g)
> 
> $ cd /home/dcb/gcc/
> $ mkdir working
> $ cd working
> $ ../trunk.git/configure --whatever
> $ ls -l gcc
> ls: cannot access 'gcc': No such file or directory
> 
> Thanks for the tip, but after a configure, there is no gcc directory
> available.
> 
> Does your tip only apply if there is a previous build available
> or have I misunderstood ?

sorry, yes, to just 'rebuild' cc1plus.  You can't just build cc1plus in 
a clean build

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2020-11-19 15:34 ` nathan at acm dot org
@ 2020-11-19 17:56 ` cvs-commit at gcc dot gnu.org
  2020-11-19 17:57 ` nathan at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-19 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>:

https://gcc.gnu.org/g:255483e5b70beade63efdf1f3efa6b814831da08

commit r11-5176-g255483e5b70beade63efdf1f3efa6b814831da08
Author: Nathan Sidwell <nathan@acm.org>
Date:   Thu Nov 19 08:00:49 2020 -0800

    c++: Relax new assert [PR 97905]

    It turns out there are legitimate cases for the new decl to not have
    lang-specific.

            PR c++/97905
            gcc/cp/
            * decl.c (duplicate_decls): Relax new assert.
            gcc/testsuite/
            * g++.dg/lookup/pr97905.C: New.

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

* [Bug c++/97905] [11 Regression] ice in duplicate_decls, at cp/decl.c:2754
  2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2020-11-19 17:56 ` cvs-commit at gcc dot gnu.org
@ 2020-11-19 17:57 ` nathan at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-11-19 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

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

--- Comment #9 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
fixed 255483e5b70

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

end of thread, other threads:[~2020-11-19 17:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 10:38 [Bug c++/97905] New: ice in duplicate_decls, at cp/decl.c:2754 dcb314 at hotmail dot com
2020-11-19 11:13 ` [Bug c++/97905] " dcb314 at hotmail dot com
2020-11-19 12:21 ` dcb314 at hotmail dot com
2020-11-19 13:46 ` [Bug c++/97905] [11 Regression] " rguenth at gcc dot gnu.org
2020-11-19 14:49 ` mpolacek at gcc dot gnu.org
2020-11-19 15:07 ` nathan at gcc dot gnu.org
2020-11-19 15:10 ` nathan at gcc dot gnu.org
2020-11-19 15:18 ` dcb314 at hotmail dot com
2020-11-19 15:34 ` nathan at acm dot org
2020-11-19 17:56 ` cvs-commit at gcc dot gnu.org
2020-11-19 17:57 ` nathan 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).