https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70013

--- 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?

Reply via email to