[Bug debug/54971] SRA pessimizes debug info by not creating debug stmts for fields without replacements

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 4 14:41:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54971

--- Comment #17 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-01-04 14:41:08 UTC ---
(In reply to comment #13)
> So, beyond the creation of new debug only accesses for whole struct writes into
> hole if there aren't too many holes, I wonder if SRA doesn't have
> infrastructure to do aggregate assignment propagation (which could help with
> the rest of the -Os -m32 issues on the committed testcase, but even for code
> generation on say):

No, it does not have any infrastructure for that, it looks at each
statement in isolation and e.g. at the moment it has no way of knowing
that the value of b is the same as value of a.  The propagation-like
effect it can achieve is only done by always splitting small non
bit-field structures into pieces and let the SSA propagation work on
them.  One issue can be that we do not even attempt that with arrays
(but we are unlikely to scalarize them away because they are usually
indexed by a variable).

We need an aggregate copy propagation or extend SRA significantly to
become one (or SSA-ize some aggregates as Richi suggested but that
would not work on partially accessed structures).  I'll revisit my
thoughts about this.

I'll try to come up with some solution for the -Os problem though I'm
afraid it will be a bit limited (I don't think I will even attempt
unions or bit-fields, for example).



More information about the Gcc-bugs mailing list