https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98075
Bug ID: 98075 Summary: [10/11 Regression] ICE: verify_cgraph_node failed (error: malloc attribute should be used for a function that returns a pointer) Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com CC: marxin at gcc dot gnu.org Target Milestone: --- g++-11.0.0-alpha20201129 snapshot (g:bb67ad5cff58a707aaae645d4f45a913d8511c86) ICEs when compiling the following testcase w/ -O2 -fno-inline: template <typename BS> class xg { public: BS * fw () { return static_cast<BS *> (operator new (sizeof (BS))); } }; class zp : xg<int> { public: __attribute__ ((always_inline)) zp () { hy = xg<int>::fw (); } private: int *hy; }; void e5 () { zp ix; } % g++-11.0.0 -O2 -fno-inline -c yhmypmjz.cpp yhmypmjz.cpp:26:1: error: malloc attribute should be used for a function that returns a pointer 26 | } | ^ _ZN2xgIiE2fwEv.isra.0/7 (fw.isra) @0x7fb655a53660 Type: function definition analyzed Visibility: References: Referring: Clone of _ZN2xgIiE2fwEv/4 Availability: local Function flags: count:1073741824 (estimated locally) local Called by: _Z2e5v/3 (1073741824 (estimated locally),1.00 per call) (can throw external) Calls: _Znwm/6 (1073741824 (estimated locally),1.00 per call) (can throw external) yhmypmjz.cpp:26:1: internal compiler error: verify_cgraph_node failed 0xbef9a8 cgraph_node::verify_node() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/cgraph.c:3807 0xbde7c4 symtab_node::verify() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/symtab.c:1356 0xbdf9b7 symtab_node::verify_symtab_nodes() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/symtab.c:1384 0xbf49e0 symtab_node::checking_verify_symtab_nodes() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/cgraph.h:675 0xbf49e0 symbol_table::compile() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/cgraphunit.c:2321 0xbf7d47 symbol_table::compile() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/cgraphunit.c:2274 0xbf7d47 symbol_table::finalize_compilation_unit() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201129/work/gcc-11-20201129/gcc/cgraphunit.c:2542