Bug 90747 - [11/12/13/14 Regression] Internal compiler error: Error reporting routines re-entered.
Summary: [11/12/13/14 Regression] Internal compiler error: Error reporting routines re...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P2 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2019-06-04 17:32 UTC by Matthew Beliveau
Modified: 2024-02-20 07:32 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 7.5.0
Known to fail: 10.3.0, 11.1.0, 12.0, 8.5.0, 9.4.0
Last reconfirmed: 2024-02-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Beliveau 2019-06-04 17:32:55 UTC
struct a {};
template <typename> struct b { a operator*(); };
template <typename c, typename d> c e(d);
template <typename, typename d> auto e(b<d> f) -> decltype(e<int>(*f)) {}
void blah() { e<a>(b<int>{}); }

$ ./cc1plus -quiet f.ii
‘
Internal compiler error: Error reporting routines re-entered.
0x9d0882 push_tinst_level_loc
	/home/mbelivea/src/gcc/gcc/cp/pt.c:10258
0x9d09e1 push_tinst_level
	/home/mbelivea/src/gcc/gcc/cp/pt.c:10301
0xa02c62 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:20200
0x850f06 add_template_candidate_real
	/home/mbelivea/src/gcc/gcc/cp/call.c:3315
0x85188c add_template_candidate
	/home/mbelivea/src/gcc/gcc/cp/call.c:3400
0x85188c add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:5724
0x856ea7 add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:4388
0x856ea7 perform_overload_resolution
	/home/mbelivea/src/gcc/gcc/cp/call.c:4396
0x85a245 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
	/home/mbelivea/src/gcc/gcc/cp/call.c:4470
0xa44a2d finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int)
	/home/mbelivea/src/gcc/gcc/cp/semantics.c:2584
0x9fd7bd tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:19093
0x9e8091 tsubst(tree_node*, tree_node*, int, tree_node*)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:15140
0x9e3f50 tsubst_function_type
	/home/mbelivea/src/gcc/gcc/cp/pt.c:14167
0x9e7337 tsubst(tree_node*, tree_node*, int, tree_node*)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:14947
0xa02d0a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:20212
0x850f06 add_template_candidate_real
	/home/mbelivea/src/gcc/gcc/cp/call.c:3315
0x85188c add_template_candidate
	/home/mbelivea/src/gcc/gcc/cp/call.c:3400
0x85188c add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:5724
0x856ea7 add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:4388
0x856ea7 perform_overload_resolution
	/home/mbelivea/src/gcc/gcc/cp/call.c:4396
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.
$ ./cc1plus -quiet f.ii
‘
Internal compiler error: Error reporting routines re-entered.
0x9d0882 push_tinst_level_loc
	/home/mbelivea/src/gcc/gcc/cp/pt.c:10258
0x9d09e1 push_tinst_level
	/home/mbelivea/src/gcc/gcc/cp/pt.c:10301
0xa02c62 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:20200
0x850f06 add_template_candidate_real
	/home/mbelivea/src/gcc/gcc/cp/call.c:3315
0x85188c add_template_candidate
	/home/mbelivea/src/gcc/gcc/cp/call.c:3400
0x85188c add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:5724
0x856ea7 add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:4388
0x856ea7 perform_overload_resolution
	/home/mbelivea/src/gcc/gcc/cp/call.c:4396
0x85a245 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
	/home/mbelivea/src/gcc/gcc/cp/call.c:4470
0xa44a2d finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int)
	/home/mbelivea/src/gcc/gcc/cp/semantics.c:2584
0x9fd7bd tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:19093
0x9e8091 tsubst(tree_node*, tree_node*, int, tree_node*)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:15140
0x9e3f50 tsubst_function_type
	/home/mbelivea/src/gcc/gcc/cp/pt.c:14167
0x9e7337 tsubst(tree_node*, tree_node*, int, tree_node*)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:14947
0xa02d0a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool)
	/home/mbelivea/src/gcc/gcc/cp/pt.c:20212
0x850f06 add_template_candidate_real
	/home/mbelivea/src/gcc/gcc/cp/call.c:3315
0x85188c add_template_candidate
	/home/mbelivea/src/gcc/gcc/cp/call.c:3400
0x85188c add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:5724
0x856ea7 add_candidates
	/home/mbelivea/src/gcc/gcc/cp/call.c:4388
0x856ea7 perform_overload_resolution
	/home/mbelivea/src/gcc/gcc/cp/call.c:4396
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.
Comment 1 Matthew Beliveau 2019-06-04 17:33:54 UTC
Adding missing return on line 4 lets it compile.
Comment 2 Marek Polacek 2019-06-04 18:03:05 UTC
Confirmed.

With -Wreturn-type, started with r253600.  Before:

90747.C: In instantiation of ‘decltype (e<int>((* f))) e(b<d>) [with <template-parameter-1-1> = a; d = int; decltype (e<int>((* f))) = int]’:
90747.C:5:28:   required from here
90747.C:4:73: warning: no return statement in function returning non-void [-Wreturn-type]
 template <typename, typename d> auto e(b<d> f) -> decltype(e<int>(*f)) {}
                                                                         ^
Comment 3 Marek Polacek 2019-06-08 14:41:46 UTC
Possibly the same problem as in PR54080.
Comment 4 Jakub Jelinek 2020-03-04 09:38:55 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 5 Jakub Jelinek 2021-05-14 09:51:48 UTC
GCC 8 branch is being closed.
Comment 6 Richard Biener 2021-06-01 08:14:33 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 7 Richard Biener 2022-05-27 09:41:01 UTC
GCC 9 branch is being closed
Comment 8 Jakub Jelinek 2022-06-28 10:37:35 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 9 Richard Biener 2023-07-07 10:35:32 UTC
GCC 10 branch is being closed.