public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65887] New: remove va_arg ap copies
@ 2015-04-25 14:46 vries at gcc dot gnu.org
  2015-04-27  6:59 ` [Bug tree-optimization/65887] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-04-25 14:46 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2015-04-28 21:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-25 14:46 [Bug tree-optimization/65887] New: remove va_arg ap copies vries at gcc dot gnu.org
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

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).