https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102586
--- Comment #28 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Qing Zhao from comment #27) > Does this issue only exist with -flifetime-dse=2? > When -flifetime-dse=2, the call to __builtin_clear_padding should be > inserted AFTER the start point of the constructor of the object, otherwise > it’s dead and will be eliminated by DSE. > And with -flifetime-dse=2, the padding initialization should be done by C++ > FE instead of middle end. > Is this understanding correct? Yes, -flifetime-dse=2 conflicts with -ftrivial-auto-var-init in that both are trying to define the initial state of the variable. Perhaps -ftrivial-auto-var-init should lower to -flifetime-dse=1. Or change build_clobber_this to do the specified initialization instead of a clobber, though that would mean doing the initialization for any object of that type, not just automatics.