From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28690 invoked by alias); 4 Jan 2013 14:41:36 -0000 Received: (qmail 28597 invoked by uid 48); 4 Jan 2013 14:41:10 -0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/54971] SRA pessimizes debug info by not creating debug stmts for fields without replacements Date: Fri, 04 Jan 2013 14:41:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00319.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54971 --- Comment #17 from Martin Jambor 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).