public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
@ 2020-12-02 17:19 gscfq@t-online.de
2020-12-02 17:29 ` [Bug c++/98103] " mpolacek at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-12-02 17:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
Bug ID: 98103
Summary: [10/11 Regression] ICE tree check: expected tree that
contains 'decl minimal' structure, have 'integer_cst'
in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gscfq@t-online.de
Target Milestone: ---
Using testfile gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
This changed between 20191215 and 20200105 :
$ g++-11-20201129 -c constexpr-dynamic17.C -std=gnu++2a -fsanitize=vptr
constexpr-dynamic17.C:20:13: in 'constexpr' expansion of '((D*)(&
d))->D::D()'
constexpr-dynamic17.C:12:35: in 'constexpr' expansion of
'((D*)this)->D::<anonymous>.B::B((&(&((D*)this)->D::<anonymous>)->A::<anonymous>),
(&((D*)this)->D::<anonymous>))'
constexpr-dynamic17.C:20:13: internal compiler error: tree check: expected tree
that contains 'decl minimal' structure, have 'integer_cst' in
cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
20 | constexpr D d;
| ^
0x64d1b5 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/tree.c:9984
0x6ebbe3 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/tree.h:3445
0x6ebbe3 cxx_eval_dynamic_cast_fn
../../gcc/cp/constexpr.c:2003
0x6ebbe3 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2421
0x6eec61 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:5866
0x6ed3de cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6358
0x6ed3de cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6358
0x6eeb2a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6305
0x6ed39a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6176
0x6eebda cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6044
0x6ee1ee cxx_eval_statement_list
../../gcc/cp/constexpr.c:5436
0x6ee1ee cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6502
0x6eea4e cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6537
0x6ee1ee cxx_eval_statement_list
../../gcc/cp/constexpr.c:5436
0x6ee1ee cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6502
0x6eb576 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2687
0x6eec61 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:5866
0x6ed39a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6176
0x6eebda cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6044
0x6ee1ee cxx_eval_statement_list
../../gcc/cp/constexpr.c:5436
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
@ 2020-12-02 17:29 ` mpolacek at gcc dot gnu.org
2020-12-02 19:08 ` mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-02 17:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-12-02
Keywords| |ice-on-invalid-code
Ever confirmed|0 |1
CC| |mpolacek at gcc dot gnu.org
Priority|P3 |P2
Status|UNCONFIRMED |NEW
Target Milestone|--- |10.3
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
ICE confirmed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
2020-12-02 17:29 ` [Bug c++/98103] " mpolacek at gcc dot gnu.org
@ 2020-12-02 19:08 ` mpolacek at gcc dot gnu.org
2020-12-02 19:26 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-02 19:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
2020-12-02 17:29 ` [Bug c++/98103] " mpolacek at gcc dot gnu.org
2020-12-02 19:08 ` mpolacek at gcc dot gnu.org
@ 2020-12-02 19:26 ` jakub at gcc dot gnu.org
2020-12-08 22:27 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-02 19:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r10-5660-g22edf9431e4519c409ebf41c7589cccfb8c4b625
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
` (2 preceding siblings ...)
2020-12-02 19:26 ` jakub at gcc dot gnu.org
@ 2020-12-08 22:27 ` cvs-commit at gcc dot gnu.org
2020-12-08 22:28 ` [Bug c++/98103] [10 " mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-08 22:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:0221c656bbe5b4ab54e784df3b109c60cb27e5b6
commit r11-5869-g0221c656bbe5b4ab54e784df3b109c60cb27e5b6
Author: Marek Polacek <polacek@redhat.com>
Date: Wed Dec 2 14:33:13 2020 -0500
c++: ICE with -fsanitize=vptr and constexpr dynamic_cast [PR98103]
-fsanitize=vptr initializes all vtable pointers to null so that it can
catch invalid calls; see cp_ubsan_maybe_initialize_vtbl_ptrs. That
means that evaluating a vtable reference can produce a null pointer
in this mode, so cxx_eval_dynamic_cast_fn should check that and give
and error.
gcc/cp/ChangeLog:
PR c++/98103
* constexpr.c (cxx_eval_dynamic_cast_fn): If the evaluating of
vtable
yields a null pointer, give an error and return. Use objtype.
gcc/testsuite/ChangeLog:
PR c++/98103
* g++.dg/ubsan/vptr-18.C: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
` (3 preceding siblings ...)
2020-12-08 22:27 ` cvs-commit at gcc dot gnu.org
@ 2020-12-08 22:28 ` mpolacek at gcc dot gnu.org
2021-01-05 21:30 ` cvs-commit at gcc dot gnu.org
2021-01-05 21:35 ` mpolacek at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-08 22:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11 Regression] ICE tree |[10 Regression] ICE tree
|check: expected tree that |check: expected tree that
|contains 'decl minimal' |contains 'decl minimal'
|structure, have |structure, have
|'integer_cst' in |'integer_cst' in
|cxx_eval_dynamic_cast_fn, |cxx_eval_dynamic_cast_fn,
|at cp/constexpr.c:2003 |at cp/constexpr.c:2003
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed on trunk so far.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
` (4 preceding siblings ...)
2020-12-08 22:28 ` [Bug c++/98103] [10 " mpolacek at gcc dot gnu.org
@ 2021-01-05 21:30 ` cvs-commit at gcc dot gnu.org
2021-01-05 21:35 ` mpolacek at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-05 21:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:a38b0c6d62d90a5a30cbd00d32e7b58ee1a21b78
commit r10-9205-ga38b0c6d62d90a5a30cbd00d32e7b58ee1a21b78
Author: Marek Polacek <polacek@redhat.com>
Date: Wed Dec 2 14:33:13 2020 -0500
c++: ICE with -fsanitize=vptr and constexpr dynamic_cast [PR98103]
-fsanitize=vptr initializes all vtable pointers to null so that it can
catch invalid calls; see cp_ubsan_maybe_initialize_vtbl_ptrs. That
means that evaluating a vtable reference can produce a null pointer
in this mode, so cxx_eval_dynamic_cast_fn should check that and give
and error.
gcc/cp/ChangeLog:
PR c++/98103
* constexpr.c (cxx_eval_dynamic_cast_fn): If the evaluating of
vtable
yields a null pointer, give an error and return. Use objtype.
gcc/testsuite/ChangeLog:
PR c++/98103
* g++.dg/ubsan/vptr-18.C: New test.
(cherry picked from commit 0221c656bbe5b4ab54e784df3b109c60cb27e5b6)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/98103] [10 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
` (5 preceding siblings ...)
2021-01-05 21:30 ` cvs-commit at gcc dot gnu.org
@ 2021-01-05 21:35 ` mpolacek at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-01-05 21:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-01-05 21:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 17:19 [Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003 gscfq@t-online.de
2020-12-02 17:29 ` [Bug c++/98103] " mpolacek at gcc dot gnu.org
2020-12-02 19:08 ` mpolacek at gcc dot gnu.org
2020-12-02 19:26 ` jakub at gcc dot gnu.org
2020-12-08 22:27 ` cvs-commit at gcc dot gnu.org
2020-12-08 22:28 ` [Bug c++/98103] [10 " mpolacek at gcc dot gnu.org
2021-01-05 21:30 ` cvs-commit at gcc dot gnu.org
2021-01-05 21:35 ` mpolacek 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).