[Bug tree-optimization/70013] [6 Regression] packed structure tree-sra loses initialization

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 10 17:29:00 GMT 2016


--- Comment #11 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to alalaw01 from comment #10)
> which is much saner. But I don't really understand why the PARM_DECL case
> that I'm adding to here is that way 

SRA tries to avoid generating unnecessary aggregate loads if it can
figure out that that an area of an aggregate does not have any
(unscalarized) data in it.  In fact, it even removes existing loads of
uninitialized stuff.  The pass is not flow sensitive, so it can only
figure out that a bit of an aggregate does not have anything sensible
in it if there is no store to it anywhere in the function.

However, if the aggregate in question is a parameter, then of course
there is a store it cannot see, which happens in the caller.  The
constants are of course very similar, they contain value even though
there is no store to them anywhere in the function body.  So that is
why they must be considered as containing (unscalarized) data, which
is why you must also set the flag for them.  Does this explain things?

More information about the Gcc-bugs mailing list