This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use aliases instead of separate copies for !DECL_ONE_ONLY C[12] ctors or D[12] dtors with identical bodies (PR c++/3187, take 2)
> >
> > At least for the cdtor COMDAT aliases I need to output either all of them
> > (if any of them is needed), or none of them. Otherwise the COMDAT group
> > could provide different symbols between different CUs and we'd lose.
>
> Ah, if you unify only within single unit only, then this should be safe, yes.
>
> At present we are freely removing DECL_COMDAT functions when not dead without
> looking into COMDAT groups. As we happen to have multiple in the same group
> without any other means of knowing that we need to keep either all of them or
> none? We would need to update unreachable functions removal otherwise.
Actually the DECL_COMDAT_GROUP does not imply DECL_COMDAT. So at present, we
always output DECL_COMDAT_GROUP functions/vars from every unit no matter if
they are used or not.
I will look into this now.
Honza