public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65887] New: remove va_arg ap copies
Date: Sat, 25 Apr 2015 14:46:00 -0000	[thread overview]
Message-ID: <bug-65887-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65887

            Bug ID: 65887
           Summary: remove va_arg ap copies
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org

[ Discussed here: https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01262.html ]

When compiling gcc.target/x86_64/abi/callabi/vaarg-6.c, at original we have:
...
;; Function do_cpy2 (null)
{
  char * e;

    char * e;
  e = VA_ARG_EXPR <argp>;
  e = VA_ARG_EXPR <argp>;
  if (e != b)
    {
      abort ();
    }
}
...

and after gimplify we have:
...
do_cpy2 (char * argp)
{
  char * argp.1;
  char * argp.2;
  char * b.3;
  char * e;

  argp.1 = argp;
  e = VA_ARG (&argp.1, 0B);
  argp = argp.1;

  argp.2 = argp;
  e = VA_ARG (&argp.2, 0B);
  argp = argp.2;

  b.3 = b;
  if (e != b.3) goto <D.1373>; else goto <D.1374>;
  <D.1373>:
  abort ();
  <D.1374>:
}
...

We'd like to generate:
...
  e = VA_ARG (&argp, 0B);
...

instead of:
...
  argp.1 = argp;
  e = VA_ARG (&argp.1, 0B);
  argp = argp.1;
...

The code generating the copyback 'argp = argp.1' is in gimplify_modify_expr.


             reply	other threads:[~2015-04-25 14:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25 14:46 vries at gcc dot gnu.org [this message]
2015-04-27  6:59 ` [Bug tree-optimization/65887] " vries at gcc dot gnu.org
2015-04-27  7:40 ` vries at gcc dot gnu.org
2015-04-27  9:04 ` rguenth at gcc dot gnu.org
2015-04-27 15:45 ` vries at gcc dot gnu.org
2015-04-28 20:59 ` vries at gcc dot gnu.org
2015-04-28 21:03 ` vries 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-65887-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).