------- Comment #2 from jakub at gcc dot gnu dot org  2010-07-15 09:49 -------
Seems ix86_function_arg_advance ignores padding for > 8 byte aligned arguments
when updating cum->words.

With:
#include <stdarg.h>

long double
test (int a, int b, int c, int d, int e, int f, int g, int g2, int g3, long
double h, int g4, long double h2, int g5, long double h3, ...)
{
  int i;
  va_list ap;

  va_start (ap, h3);
  i = va_arg (ap, int);
  __builtin_printf ("Got %d, expected %d\n", i, 123456789);
  va_end (ap);
  return h + h2 + h3 + g3 + g4 + g5;
}

int
main ()
{
  test (0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0L, 0, 0.0L, 0, 0.0L, 123456789,
0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL);
  return 0;
}

testcase the reading of the va_arg is already off by 24 bytes (3 times 8 byte
padding before each of the long double arguments).
Looking into it.


-- 


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

Reply via email to