https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Bug ID: 95192 Summary: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- gcc-11.0.0-alpha20200517 snapshot (g:2b9a271b2d0ba340234a138b7f8289bd7dca2fc5) ICEs when compiling the following testcase, extracted from test/SemaCXX/builtin-assume-aligned-tmpl.cpp from the clang 10.0.0 test suite: template<typename T> __attribute__((assume_aligned(sizeof(int(T()))))) T *f(); void test21() { void *p = f<void>() } % g++-11.0.0 -c iu1wkpbg.cpp iu1wkpbg.cpp: In substitution of 'template<class T> T* f() [with T = void]': iu1wkpbg.cpp:3:21: required from here iu1wkpbg.cpp:1:75: internal compiler error: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 1 | template<typename T> __attribute__((assume_aligned(sizeof(int(T()))))) T *f(); | ^ 0x7c0c50 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/tree.c:9686 0x6af9db tree_check(tree_node*, char const*, int, char const*, tree_code) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/tree.h:3296 0x6af9db handle_assume_aligned_attribute /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/c-family/c-attribs.c:2996 0x6af9db handle_assume_aligned_attribute /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/c-family/c-attribs.c:2977 0xa96507 decl_attributes(tree_node**, tree_node*, int, tree_node*) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/attribs.c:714 0x9236f7 cplus_decl_attributes(tree_node**, tree_node*, int) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/decl2.c:1598 0xa178f4 tsubst_function_decl /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:13929 0xa0196f tsubst_decl /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:14182 0xa11b19 instantiate_template_1 /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:20678 0xa2137c instantiate_template(tree_node*, tree_node*, int) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:20735 0xa2137c fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:21179 0x876223 add_template_candidate_real /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:3415 0x876cf6 add_template_candidate /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:3500 0x876cf6 add_candidates /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:5866 0x8771e7 add_candidates /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:4522 0x8771e7 perform_overload_resolution /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:4530 0x87eea5 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:4604 0xa3d1b4 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/semantics.c:2675 0x9b3e51 cp_parser_postfix_expression /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:7465 0x9958e9 cp_parser_binary_expression /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:9559