On Thu, May 09, 2024 at 08:20:00PM +0200, Jakub Jelinek wrote: > --- gcc/cp/decl.cc.jj 2024-05-09 10:30:54.804505130 +0200 > +++ gcc/cp/decl.cc 2024-05-09 17:07:08.400110018 +0200 > @@ -19280,6 +19280,14 @@ cxx_comdat_group (tree decl) > else > break; > } > + /* If a ctor/dtor has already set the comdat group by > + maybe_clone_body, don't override it. */ > + if (SUPPORTS_ONE_ONLY > + && TREE_CODE (decl) == FUNCTION_DECL > + && DECL_CLONED_FUNCTION_P (decl) > + && SUPPORTS_ONE_ONLY) > + if (tree comdat = DECL_COMDAT_GROUP (decl)) > + return comdat;
This checks SUPPORTS_ONE_ONLY twice. Marek