public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization
@ 2015-02-09  9:36 krebbel at gcc dot gnu.org
  2015-02-09 14:36 ` [Bug target/64979] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: krebbel at gcc dot gnu.org @ 2015-02-09  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64979
           Summary: S/390: va_list overflow area pointer is not setup due
                    to stdarg optimization
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: krebbel at gcc dot gnu.org

Created attachment 34699
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34699&action=edit
Experimental fix

The following testcase aborts when compiled with at least -O1:

#include <stdarg.h>

extern void abort (void);

void __attribute__((noinline))
bar(int msgno, va_list *args)
{
  int i;

  for (i = 0; i < 10; i++)
    if (i != va_arg(*args, int))
      abort ();
}


void __attribute__((noinline))
foo(int msgno, ...)
{
  va_list args;
  int nargs;

  va_start(args, msgno);
  nargs = va_arg(args, int);
  bar(msgno, (va_list *)((nargs == 0) ? ((void *)0) : &args));
}


int main(void)
{
  foo(100 /* msgno */,
      1 /* nargs - part of vararg list */,
      0, 1, 2, 3, 4, 5, 6, 7, 8, 9);

  return 0;
}

It is present since we enabled stdarg optimization in the S/390 backend:
https://gcc.gnu.org/ml/gcc-patches/2005-05/msg02429.html

The field __overfloat_arg_area in the va_list struct is not set up if the
va_arg expansions in the current function are found not to exceed the number of
argument registers. This fails with the testcase since the va_list pointer is
passed to another function - still needing that field.

The final patch will include the testcase.


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

* [Bug target/64979] S/390: va_list overflow area pointer is not setup due to stdarg optimization
  2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
@ 2015-02-09 14:36 ` rguenth at gcc dot gnu.org
  2015-02-09 14:42 ` [Bug target/64979] [4.8/4.9/5 Regression] stdarg optimization not able to find escape sites in phi nodes jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-02-09 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|                            |s390-linux
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-09
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug target/64979] [4.8/4.9/5 Regression] stdarg optimization not able to find escape sites in phi nodes
  2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
  2015-02-09 14:36 ` [Bug target/64979] " rguenth at gcc dot gnu.org
@ 2015-02-09 14:42 ` jakub at gcc dot gnu.org
  2015-02-09 21:29 ` [Bug target/64979] [4.8/4.9 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-09 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|s390-linux                  |
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.8.5
            Summary|S/390: va_list overflow     |[4.8/4.9/5 Regression]
                   |area pointer is not setup   |stdarg optimization not
                   |due to stdarg optimization  |able to find escape sites
                   |                            |in phi nodes


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

* [Bug target/64979] [4.8/4.9 Regression] stdarg optimization not able to find escape sites in phi nodes
  2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
  2015-02-09 14:36 ` [Bug target/64979] " rguenth at gcc dot gnu.org
  2015-02-09 14:42 ` [Bug target/64979] [4.8/4.9/5 Regression] stdarg optimization not able to find escape sites in phi nodes jakub at gcc dot gnu.org
@ 2015-02-09 21:29 ` jakub at gcc dot gnu.org
  2015-02-11 14:46 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-09 21:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.8/4.9/5 Regression]      |[4.8/4.9 Regression] stdarg
                   |stdarg optimization not     |optimization not able to
                   |able to find escape sites   |find escape sites in phi
                   |in phi nodes                |nodes

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.


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

* [Bug target/64979] [4.8/4.9 Regression] stdarg optimization not able to find escape sites in phi nodes
  2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-02-09 21:29 ` [Bug target/64979] [4.8/4.9 " jakub at gcc dot gnu.org
@ 2015-02-11 14:46 ` jakub at gcc dot gnu.org
  2015-02-12 12:18 ` [Bug target/64979] [4.8 " jakub at gcc dot gnu.org
  2015-02-12 12:18 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-11 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Feb 11 14:45:26 2015
New Revision: 220623

URL: https://gcc.gnu.org/viewcvs?rev=220623&root=gcc&view=rev
Log:
    Backported from mainline
    2015-02-09  Jakub Jelinek  <jakub@redhat.com>

    PR target/64979
    * tree-stdarg.c (pass_stdarg::execute): Scan phi node args for
    va_list escapes.

    * gcc.dg/tree-ssa/stdarg-7.c: New test.
    * gcc.c-torture/execute/pr64979.c: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr64979.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/tree-stdarg.c


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

* [Bug target/64979] [4.8 Regression] stdarg optimization not able to find escape sites in phi nodes
  2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-02-12 12:18 ` [Bug target/64979] [4.8 " jakub at gcc dot gnu.org
@ 2015-02-12 12:18 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-12 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

* [Bug target/64979] [4.8 Regression] stdarg optimization not able to find escape sites in phi nodes
  2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-02-11 14:46 ` jakub at gcc dot gnu.org
@ 2015-02-12 12:18 ` jakub at gcc dot gnu.org
  2015-02-12 12:18 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-12 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Thu Feb 12 12:17:41 2015
New Revision: 220645

URL: https://gcc.gnu.org/viewcvs?rev=220645&root=gcc&view=rev
Log:
    Backported from mainline
    2015-02-09  Jakub Jelinek  <jakub@redhat.com>

    PR target/64979
    * tree-stdarg.c (pass_stdarg::execute): Scan phi node args for
    va_list escapes.

    * gcc.dg/tree-ssa/stdarg-7.c: New test.
    * gcc.c-torture/execute/pr64979.c: New test.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.c-torture/execute/pr64979.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_8-branch/gcc/tree-stdarg.c


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

end of thread, other threads:[~2015-02-12 12:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-09  9:36 [Bug target/64979] New: S/390: va_list overflow area pointer is not setup due to stdarg optimization krebbel at gcc dot gnu.org
2015-02-09 14:36 ` [Bug target/64979] " rguenth at gcc dot gnu.org
2015-02-09 14:42 ` [Bug target/64979] [4.8/4.9/5 Regression] stdarg optimization not able to find escape sites in phi nodes jakub at gcc dot gnu.org
2015-02-09 21:29 ` [Bug target/64979] [4.8/4.9 " jakub at gcc dot gnu.org
2015-02-11 14:46 ` jakub at gcc dot gnu.org
2015-02-12 12:18 ` [Bug target/64979] [4.8 " jakub at gcc dot gnu.org
2015-02-12 12:18 ` 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).