On Mon, Mar 10, 2025 at 02:52:07PM -0400, Jason Merrill wrote: > On 3/10/25 9:52 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > Or should this wait for GCC16? > > > > -- >8 -- > > > > While looking at PR c++/119154 I noticed some more properties that we > > don't stream or check properly. This patch adds the ones we were > > missing, and adds checks that the values don't clash with existing > > decls. > > These seem to me like properties that should be recomputed rather than > streamed; aren't we already streaming the section attribute? >
Hm, right; we're streaming the attributes but in general we don't reapply any of the effects they have that aren't streamed regardless. We should probably do that somehow; it looks like using decl_attributes directly for this might do too much so I suppose we would need another interface for this. This is probably the way to go to fix PR108080, too; rather than messing around with trying to work out how to stream OPTIMIZATION_NODEs etc. we can just reapply the attribute, which also would probably have the expected behaviour in the case of mismatching optimisation flags between exporter and consumer. > This comment also applies to the existing streaming of tls_model. > I assume we can just use 'decl_default_tls_model' in the no-attribute case? Is there anything we should worry about wrt to it potentially providing different results in different modules (due to different choices of -ftls-model)? Also, while reworking my other patch I'm now semi-convinced that there's no need to stream comdat group, it should be recalculated correctly anyway in all cases that I could find. But I definitely might have missed something; either way it hasn't bitten us yet. Nathaniel