On Mon, Sep 11, 2017 at 9:59 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> I think the issue is that we set SUBREG_PROMOTED_* on something that is >> possibly not so (aka uninitialized in this case). > > Yes, that's what I called inherent weakness of the promoted subregs mechanism. > >> We may only set it if either the ABI or a previous operation forced it to. >> Maybe this is also the reason why we need this zero init pass in some cases >> (though that isn't a full solution either). > > Do you think that we should zero-init all the unsigned promoted subregs (and > sign-extend-init all the signed promoted subregs)? That sounds like a big > hammer to me, but I can give it a try.
My suggestion would be to not set SUBREG_PROMOTED_* on "everything" (which we seem to do). zero-initing looks like the easier way to deal with the situation though. ISTR SUBREG_PROMOTED_* gets set by RTL expansion, the problematic one should be the one in expr.c setting it on all SSA_NAMEs, maybe it is enough to avoid setting it for SSA_NAME_IS_DEFAULT_DEF ones? Richard. > -- > Eric Botcazou