https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106124
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:36330e2e95564a360e6dbcfb4e7566d5c2177415 commit r13-6925-g36330e2e95564a360e6dbcfb4e7566d5c2177415 Author: Richard Biener <rguent...@suse.de> Date: Mon Mar 27 16:40:15 2023 +0200 ipa/106124 - ICE with -fkeep-inline-functions and OpenMP The testcases in this bug reveal cases where an early generated type is collected because it was unused but gets attempted to be recreated later when a late DIE for a function (an OpenMP reduction) is created. That's unexpected and possibly the fault of OpenMP but the following allows the re-creation of the context type to succeed. PR ipa/106124 * dwarf2out.cc (lookup_type_die): Reset TREE_ASM_WRITTEN so we can re-create the DIE for the type if required. * g++.dg/gomp/pr106124.C: New testcase.