public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
@ 2020-09-24 4:14 asolokha at gmx dot com
2020-09-24 7:17 ` [Bug c++/97186] " rguenth at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2020-09-24 4:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
Bug ID: 97186
Summary: [11 Regression] ICE: Segmentation fault (in
maybe_instantiate_noexcept)
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
g++-11.0.0-alpha20200920 snapshot (g:363e7755f227656684c8e284307ceee451503ca4)
ICEs when compiling the following testcase:
template <class GG>
struct no {
static void
tg ()
{
void
hk () noexcept (tg);
hk ();
}
};
void
os ()
{
no<int> ().tg ();
}
% g++-11.0.0 -c n8bpixef.cc
n8bpixef.cc: In instantiation of 'void hk()':
n8bpixef.cc:9:8: required from 'static void no<GG>::tg() [with GG = int]'
n8bpixef.cc:16:18: required from here
n8bpixef.cc:7:5: internal compiler error: Segmentation fault
7 | hk () noexcept (tg);
| ^~
0x100af6f crash_signal
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/toplev.c:327
0xa1ca2f maybe_instantiate_noexcept(tree_node*, int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/tree.h:3298
0x95054a mark_used(tree_node*, int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/decl2.c:5549
0xa6c9eb finish_id_expression_1
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/semantics.c:3999
0xa6cb17 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/semantics.c:4063
0xa18554 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:19326
0xa18cbd tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:19885
0xa2386f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:18889
0xa25bc9 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:17991
0xa25fa1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:17961
0xa24f2e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:18281
0xa2c70f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:17946
0xa2c70f instantiate_body
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:25577
0xa2d88f instantiate_decl(tree_node*, bool, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:25865
0xa4ff9b instantiate_pending_templates(int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/pt.c:25944
0x95175b c_parse_final_cleanups()
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200920/work/gcc-11-20200920/gcc/cp/decl2.c:4920
clang 10.0.1 accepts it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97186] [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
@ 2020-09-24 7:17 ` rguenth at gcc dot gnu.org
2020-09-24 7:53 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-24 7:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97186] [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
2020-09-24 7:17 ` [Bug c++/97186] " rguenth at gcc dot gnu.org
@ 2020-09-24 7:53 ` marxin at gcc dot gnu.org
2020-09-24 11:48 ` nathan at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-24 7:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-09-24
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |marxin at gcc dot gnu.org,
| |nathan at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started to ICE with r11-3192-ge9fdb9a73249f95f, before that it was rejected:
g++-10 pr97186.C -c
pr97186.C: In instantiation of ‘void hk() [with GG = int]’:
pr97186.C:9:8: required from ‘static void no<GG>::tg() [with GG = int]’
pr97186.C:16:18: required from here
pr97186.C:7:5: error: conversion from ‘void (*)()’ to ‘bool’ in a converted
constant expression
7 | hk () noexcept (tg);
| ^~
pr97186.C:7:5: error: could not convert ‘no<int>::tg’ from ‘void()’ to ‘bool’
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97186] [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
2020-09-24 7:17 ` [Bug c++/97186] " rguenth at gcc dot gnu.org
2020-09-24 7:53 ` marxin at gcc dot gnu.org
@ 2020-09-24 11:48 ` nathan at gcc dot gnu.org
2020-09-24 12:32 ` nathan at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-09-24 11:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97186] [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
` (2 preceding siblings ...)
2020-09-24 11:48 ` nathan at gcc dot gnu.org
@ 2020-09-24 12:32 ` nathan at gcc dot gnu.org
2020-09-24 13:23 ` cvs-commit at gcc dot gnu.org
2020-09-24 13:24 ` nathan at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-09-24 12:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
The error abount conversion failure, if it is a bug, is unrelated to the ICE.
I say 'if', because I think there have been changes in regards to whether
functions decay to pointers which can be implicitly converted to bool in
constant exprs. Not digging into that right now though.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97186] [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
` (3 preceding siblings ...)
2020-09-24 12:32 ` nathan at gcc dot gnu.org
@ 2020-09-24 13:23 ` cvs-commit at gcc dot gnu.org
2020-09-24 13:24 ` nathan at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-24 13:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
--- Comment #3 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:2e66e53b1efb98f5cf6b0a123990c1ca999affd7
commit r11-3436-g2e66e53b1efb98f5cf6b0a123990c1ca999affd7
Author: Nathan Sidwell <nathan@acm.org>
Date: Thu Sep 24 06:17:00 2020 -0700
c++: local-decls are never member fns [PR97186]
This fixes an ICE in noexcept instantiation. It was presuming
functions always have template_info, but that changed with my
DECL_LOCAL_DECL_P changes. Fortunately DECL_LOCAL_DECL_P fns are
never member fns, so we don't need to go fishing out a this pointer.
Also I realized I'd misnamed local10.C, so renaming it local-fn3.C,
and while there adding the effective-target lto that David E pointed
out was missing.
PR c++/97186
gcc/cp/
* pt.c (maybe_instantiate_noexcept): Local externs are never
member fns.
gcc/testsuite/
* g++.dg/template/local10.C: Rename ...
* g++.dg/template/local-fn3.C: .. here. Require lto.
* g++.dg/template/local-fn4.C: New.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/97186] [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept)
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
` (4 preceding siblings ...)
2020-09-24 13:23 ` cvs-commit at gcc dot gnu.org
@ 2020-09-24 13:24 ` nathan at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-09-24 13:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97186
Nathan Sidwell <nathan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #4 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Fixed 2e66e53b1ef
if you think the code should be accepted without error please file a separate
defect.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-09-24 13:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24 4:14 [Bug c++/97186] New: [11 Regression] ICE: Segmentation fault (in maybe_instantiate_noexcept) asolokha at gmx dot com
2020-09-24 7:17 ` [Bug c++/97186] " rguenth at gcc dot gnu.org
2020-09-24 7:53 ` marxin at gcc dot gnu.org
2020-09-24 11:48 ` nathan at gcc dot gnu.org
2020-09-24 12:32 ` nathan at gcc dot gnu.org
2020-09-24 13:23 ` cvs-commit at gcc dot gnu.org
2020-09-24 13:24 ` 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).