public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/47858] New: [4.5/4.6 Regression] IPA-SRA decreases quality of debug info
@ 2011-02-23 14:01 jakub at gcc dot gnu.org
  2011-02-23 15:51 ` [Bug debug/47858] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-23 14:01 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-11-28 15:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 14:01 [Bug debug/47858] New: [4.5/4.6 Regression] IPA-SRA decreases quality of debug info jakub at gcc dot gnu.org
2011-02-23 15:51 ` [Bug debug/47858] " rguenth at gcc dot gnu.org
2011-02-24 13:59 ` aoliva at gcc dot gnu.org
2011-03-02 12:47 ` jakub at gcc dot gnu.org
2011-04-28 15:38 ` [Bug debug/47858] [4.5/4.6/4.7 " rguenth at gcc dot gnu.org
2011-06-02 12:23 ` jakub at gcc dot gnu.org
2011-06-03 10:46 ` jakub at gcc dot gnu.org
2011-06-07 15:44 ` jakub at gcc dot gnu.org
2011-06-22 10:43 ` jakub at gcc dot gnu.org
2011-11-28 15:34 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).