On Tue, Feb 08, 2022 at 02:20:28PM -0500, Jason Merrill wrote: > > > + return add_const_value_attribute (die, TYPE_MODE (type), rtl); > > > + } > > > + else > > > + { > > > + /* For early_dwarf force mangling of all referenced symbols. */ > > > + tree initializer = init; > > > + STRIP_NOPS (initializer); > > > + /* rtl_for_decl_init punts on other aggregates, and complex > > > values. */ > > > + if (AGGREGATE_TYPE_P (type) > > > + || (TREE_CODE (initializer) == VIEW_CONVERT_EXPR > > > + && AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (initializer, 0)))) > > > + || TREE_CODE (type) == COMPLEX_TYPE) > > > + ; > > Hmm, I don't think we need to mirror the limitations of rtl_for_decl_init > here; IMO we might as well go ahead mangle everything so we don't need to > change this place as well when the FIXME is resolved. OK either way, but if > you decide to keep this condition please update the FIXME in > rtl_for_decl_init to point here.
I did that because the aggregate case can mean very large initializers that would need mangling a lot of symbols even when we actually don't need that because we'd punt on it, and because I'm a little bit afraid how safe the mangling is for -fcompare-debug if done only for the -g case (I vaguely remember it can try to instantiate some templates etc.). Can certainly adjust the FIXME comment. Jakub