public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56205] New: [4.8 Regression] stdarg pass confused by jump threading
@ 2013-02-04 16:09 jakub at gcc dot gnu.org
  2013-02-05  9:23 ` [Bug tree-optimization/56205] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-04 16:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56205

             Bug #: 56205
           Summary: [4.8 Regression] stdarg pass confused by jump
                    threading
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: jakub@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


#include <stdarg.h>

int a, b;
char c[128];

static void
foo (int x, char const *y, va_list z)
{
  __builtin_printf ("%s %d %s", x ? "" : "foo", ++a, (y && *y) ? "bar" : "");
  if (y && *y)
    __builtin_vprintf (y, z);
}

void
bar (int x, char const *y, ...)
{
  va_list z;
  va_start (z, y);
  if (!x && *c == '\0')
    ++b;
  foo (x, y, z);
  va_end (z);
}

at -O3 (distilled from MariaDB testcase framework) fails on ppc64, only
floating point registers are saved, but not GPRs needed for varargs.
bar: va_list escapes 0, needs to save 0 GPR units and all FPR units.
from stdarg pass is wrong, va_list escapes in this case.


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

* [Bug tree-optimization/56205] [4.8 Regression] stdarg pass confused by jump threading
  2013-02-04 16:09 [Bug tree-optimization/56205] New: [4.8 Regression] stdarg pass confused by jump threading jakub at gcc dot gnu.org
@ 2013-02-05  9:23 ` rguenth at gcc dot gnu.org
  2013-02-05 10:43 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-05  9:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56205

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-02-05
   Target Milestone|---                         |4.8.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-05 09:22:29 UTC ---
stdarg, ick.


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

* [Bug tree-optimization/56205] [4.8 Regression] stdarg pass confused by jump threading
  2013-02-04 16:09 [Bug tree-optimization/56205] New: [4.8 Regression] stdarg pass confused by jump threading jakub at gcc dot gnu.org
  2013-02-05  9:23 ` [Bug tree-optimization/56205] " rguenth at gcc dot gnu.org
@ 2013-02-05 10:43 ` jakub at gcc dot gnu.org
  2013-02-05 15:55 ` jakub at gcc dot gnu.org
  2013-02-05 15:59 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-05 10:43 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56205

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-05 10:42:34 UTC ---
Created attachment 29354
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29354
gcc48-pr56205.patch

Untested fix.


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

* [Bug tree-optimization/56205] [4.8 Regression] stdarg pass confused by jump threading
  2013-02-04 16:09 [Bug tree-optimization/56205] New: [4.8 Regression] stdarg pass confused by jump threading jakub at gcc dot gnu.org
  2013-02-05  9:23 ` [Bug tree-optimization/56205] " rguenth at gcc dot gnu.org
  2013-02-05 10:43 ` jakub at gcc dot gnu.org
@ 2013-02-05 15:55 ` jakub at gcc dot gnu.org
  2013-02-05 15:59 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-05 15:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56205

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-05 15:54:49 UTC ---
Author: jakub
Date: Tue Feb  5 15:54:39 2013
New Revision: 195760

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195760
Log:
    PR tree-optimization/56205
    * tree-stdarg.c (check_all_va_list_escapes): Return true if
    there are any PHI nodes that set non-va_list_escape_vars SSA_NAME
    and some va_list_escape_vars SSA_NAME appears in some PHI argument.

    * gcc.dg/tree-ssa/stdarg-6.c: New test.
    * gcc.c-torture/execute/pr56205.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr56205.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/stdarg-6.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-stdarg.c


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

* [Bug tree-optimization/56205] [4.8 Regression] stdarg pass confused by jump threading
  2013-02-04 16:09 [Bug tree-optimization/56205] New: [4.8 Regression] stdarg pass confused by jump threading jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-02-05 15:55 ` jakub at gcc dot gnu.org
@ 2013-02-05 15:59 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-05 15:59 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56205

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-05 15:58:32 UTC ---
Should be fixed now.


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

end of thread, other threads:[~2013-02-05 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-04 16:09 [Bug tree-optimization/56205] New: [4.8 Regression] stdarg pass confused by jump threading jakub at gcc dot gnu.org
2013-02-05  9:23 ` [Bug tree-optimization/56205] " rguenth at gcc dot gnu.org
2013-02-05 10:43 ` jakub at gcc dot gnu.org
2013-02-05 15:55 ` jakub at gcc dot gnu.org
2013-02-05 15:59 ` 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).