https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106124
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:1cfc7f22eb4587029624050006c2ab4e82e9a0b1 commit r11-10672-g1cfc7f22eb4587029624050006c2ab4e82e9a0b1 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.c (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. (cherry picked from commit 36330e2e95564a360e6dbcfb4e7566d5c2177415)