Created attachment 44138 [details] self-contained test After upgrade to version 8.1.0, encountered ICE: "internal compiler error: in check_noexcept_r, at cp/except.c:1027" Slight modifications led to other ICEs. Test script: echo "==== Segfault internal compiler error" /usr/bin/g++ -DSEGFAULT_ERROR test.cpp echo "==== Noexcept internal compiler error" /usr/bin/g++ -DNOEXCEPT_ERROR test.cpp echo "==== Unexpected expression internal compiler error" /usr/bin/g++ -DUNEXPECTED_EXPR_ERROR -Wall test.cpp echo "==== cp_get_fndecl_from_callee internal compiler error (1)" /usr/bin/g++ -DUNEXPECTED_EXPR_ERROR test.cpp echo "==== cp_get_fndecl_from_callee internal compiler error (2)" /usr/bin/g++ test.cpp echo "==== Workaround" /usr/bin/g++ -DWORKAROUND test.cpp Output: ==== Segfault internal compiler error test.cpp: In function ‘value_statistics_t<> calc() [with T = double]’: test.cpp:25:13: internal compiler error: Segmentation fault return {}; ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. ==== Noexcept internal compiler error test.cpp: In instantiation of ‘value_statistics_t<> calc() [with T = double]’: test.cpp:39:46: required from here test.cpp:28:24: internal compiler error: in check_noexcept_r, at cp/except.c:1027 value_statistics_t<> result; ^~~~~~ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. ==== Unexpected expression internal compiler error test.cpp: In instantiation of ‘value_statistics_t<> calc() [with T = double]’: test.cpp:39:46: required from here test.cpp:31:31: internal compiler error: unexpected expression ‘(size_t)0’ of kind implicit_conv_expr return value_statistics_t<>{}; ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. ==== cp_get_fndecl_from_callee internal compiler error (1) test.cpp: In instantiation of ‘value_statistics_t<> calc() [with T = double]’: test.cpp:39:46: required from here test.cpp:35:1: internal compiler error: in cp_get_fndecl_from_callee, at cp/cvt.c:957 } ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. ==== cp_get_fndecl_from_callee internal compiler error (2) test.cpp: In instantiation of ‘value_statistics_t<> calc() [with T = double]’: test.cpp:39:46: required from here test.cpp:35:1: internal compiler error: in cp_get_fndecl_from_callee, at cp/cvt.c:957 } ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. ==== Workaround
Confirmed.
Started with r253599.
Author: jason Date: Wed May 30 19:31:11 2018 New Revision: 260972 URL: https://gcc.gnu.org/viewcvs?rev=260972&root=gcc&view=rev Log: PR c++/85807 - ICE with call in template NSDMI. * init.c (get_nsdmi): Use push_to/pop_from_top_level. * tree.c (bot_manip): Don't set_flags_from_callee in a template. Added: trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template17.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/init.c trunk/gcc/cp/tree.c trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice14.C trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi8.C
Author: jason Date: Mon Jun 11 22:02:01 2018 New Revision: 261461 URL: https://gcc.gnu.org/viewcvs?rev=261461&root=gcc&view=rev Log: PR c++/85807 - ICE with call in template NSDMI. * init.c (get_nsdmi): Use push_to/pop_from_top_level. * tree.c (bot_manip): Don't set_flags_from_callee in a template. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template17.C Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/init.c branches/gcc-8-branch/gcc/cp/tree.c branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice14.C branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi8.C
Fixed for 8.2.