public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95870] New: ICE(segmentation fault) in most_general_template(), in gcc/cp/pt.c
@ 2020-06-24 15:30 viktor.rosendahl at bmw dot de
  2020-06-24 16:46 ` [Bug c++/95870] " mpolacek at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: viktor.rosendahl at bmw dot de @ 2020-06-24 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95870
           Summary: ICE(segmentation fault) in most_general_template(), in
                    gcc/cp/pt.c
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: viktor.rosendahl at bmw dot de
  Target Milestone: ---

Created attachment 48780
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48780&action=edit
Selfcontained example (preprocessed cource code)

I can reproduce this bug with the following gcc versions:
9.3.0
10.1.0
11.0.0 20200624 (experimental) [this was built with revision eb0ff770e29 from
git://gcc.gnu.org/git/gcc.git, which was the tip of the master branch on 24th
of June, 2020]

The bug does not happen with:
7.5.0

I have not tested any 8.x version.

All compilers were built from pristine sources, no patches added.

My system is a x86_64 machine with Ubuntu 18.04.4 LTS.

I configured all compiler builds like this:
./configure --disable-multilib --prefix=/home/viktor/gcc-bin-9.3.0
--enable-languages=c,c++

Steps to reproduce:
xz -dc preproc_example4.ii.xz > preproc_example4.ii
g++  -c -pipe -O2 -Wall -std=c++17 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG
-DQT_GUI_LIB -DQT_CORE_LIB  -o obj/example4.o preproc_example4.ii

I get the following output (with gcc-9.3.0):
example4.cpp: In instantiation of ‘BungleFooBar<U, V>::BungleFooBar() [with U =
FailFoo; V = BotchFoo]’:
example4.cpp:44:22:   required from here
example4.cpp:17:5: internal compiler error: Segmentation fault
   17 |     MACRO_FOOBAR(foofoobar, bar);
      |     ^
0xb8ff1f crash_signal
        ../.././gcc/toplev.c:326
0x6e4260 most_general_template(tree_node*)
        ../.././gcc/cp/pt.c:23652
0x6e457d enclosing_instantiation_of
        ../.././gcc/cp/pt.c:13424
0x701c53 tsubst_function_decl
        ../.././gcc/cp/pt.c:12943
0x6fe2b8 tsubst_decl
        ../.././gcc/cp/pt.c:13464
0x6f9ee7 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.c:14365
0x70263a lookup_template_class_1
        ../.././gcc/cp/pt.c:9483
0x70263a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../.././gcc/cp/pt.c:9771
0x700e5d tsubst_aggr_type
        ../.././gcc/cp/pt.c:12764
0x6f9cbf tsubst(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.c:14447
0x6fe940 tsubst_decl
        ../.././gcc/cp/pt.c:13731
0x6f9ee7 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.c:14365
0x6f42ce tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../.././gcc/cp/pt.c:17173
0x6f2378 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../.././gcc/cp/pt.c:17088
0x6f24ec tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../.././gcc/cp/pt.c:17389
0x6f24ec tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../.././gcc/cp/pt.c:17389
0x6f5885 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../.././gcc/cp/pt.c:17073
0x6f5885 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.c:18301
0x6f7775 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../.././gcc/cp/pt.c:19666
0x6f618e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../.././gcc/cp/pt.c:18918
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

end of thread, other threads:[~2022-05-13 17:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 15:30 [Bug c++/95870] New: ICE(segmentation fault) in most_general_template(), in gcc/cp/pt.c viktor.rosendahl at bmw dot de
2020-06-24 16:46 ` [Bug c++/95870] " mpolacek at gcc dot gnu.org
2020-06-24 16:46 ` mpolacek at gcc dot gnu.org
2020-06-24 17:22 ` mpolacek at gcc dot gnu.org
2020-06-24 17:23 ` mpolacek at gcc dot gnu.org
2020-06-24 18:05 ` [Bug c++/95870] [8/9/10/11 Regression] ICE (segmentation " mpolacek at gcc dot gnu.org
2020-10-12 12:52 ` rguenth at gcc dot gnu.org
2021-03-12  0:37 ` mpolacek at gcc dot gnu.org
2021-03-12  0:37 ` mpolacek at gcc dot gnu.org
2021-04-05 13:53 ` jason at gcc dot gnu.org
2021-04-05 13:53 ` viktor.rosendahl at bmw dot de
2021-04-05 19:39 ` cvs-commit at gcc dot gnu.org
2021-04-05 21:30 ` [Bug c++/95870] [8/9/10 " jason at gcc dot gnu.org
2021-05-14  9:53 ` [Bug c++/95870] [9/10 " jakub at gcc dot gnu.org
2021-05-14 16:11 ` cvs-commit at gcc dot gnu.org
2021-05-20 21:35 ` cvs-commit at gcc dot gnu.org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2022-05-13 17:41 ` [Bug c++/95870] [9 " cvs-commit at gcc dot gnu.org
2022-05-13 17:46 ` jason 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).