public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.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
Date: Wed, 23 Feb 2011 14:01:00 -0000	[thread overview]
Message-ID: <bug-47858-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2011-02-23 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 14:01 jakub at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47858-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).