From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18229 invoked by alias); 23 Feb 2011 13:36:44 -0000 Received: (qmail 18042 invoked by uid 22791); 23 Feb 2011 13:36:41 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Feb 2011 13:36:35 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/47858] New: [4.5/4.6 Regression] IPA-SRA decreases quality of debug info X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 23 Feb 2011 14:01:00 -0000 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: 2011-02/txt/msg02653.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47858 Summary: [4.5/4.6 Regression] IPA-SRA decreases quality of debug info Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned@gcc.gnu.org ReportedBy: jakub@gcc.gnu.org CC: aoliva@gcc.gnu.org struct inode { char i_pad[16]; unsigned int i_flags; }; struct dentry { unsigned int d_pad[16]; struct inode *d_inode; }; extern int inode_permission (struct inode *, int); extern int fsnotify_create (struct inode *, struct dentry *); static inline int may_create (struct inode *dir, struct dentry *child) { if (child->d_inode) return -17; if (((dir)->i_flags & 16)) return -2; return inode_permission (dir, 2 | 1); } int foo (struct inode *dir, struct dentry *child) { if (may_create (dir, child) < 0) return -1; return fsnotify_create (dir, child); } int bar (struct inode *dir, struct dentry *child) { if (may_create (dir, child) < 0) return -1; return fsnotify_create (dir, child); } int baz (struct inode *dir, struct dentry *child) { if (may_create (dir, child) < 0) return -1; return fsnotify_create (dir, child); } at -Os on x86_64-linux (distilled from Linux kernel) pessimizes debug info because child parameter in may_create (which isn't emitted inline) doesn't have location (well, it doesn't have even DW_TAG_formal_parameter in the out of line DIE, just in the abstract inline DIE). This could be solvable with my proposed DW_TAG_GNU_call_site stuff and the (still in drafting DW_OP_GNU_parameter_ref stuff for completely optimized away parameters - here it isn't completely optimized away, just replaced by something based on it). In this testcase it is of course also questionable why IPA-SRC actually performs this "optimization" when it increases code size and doesn't improve anything at all.