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

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