------- Comment #16 from ubizjak at gmail dot com  2008-11-20 19:50 -------
Problems from Comment #10 and Comment #11 are fixed by the patch from Comment
#13, but following test still fails, even with a patched compiler:

--cut here--
void abort (void);

struct S2848
{
  unsigned int a;
  _Complex int b;
  struct
  {
  } __attribute__ ((aligned)) c;
};

struct S2848 s2848;

int fails;

void  __attribute__((noinline))
check2848va (int z, ...)
{
  struct S2848 arg;
  __builtin_va_list ap;

  __builtin_va_start (ap, z);

  arg = __builtin_va_arg (ap, struct S2848);

  if (s2848.a != arg.a)
    ++fails;
  if (s2848.b != arg.b)
    ++fails;

  __builtin_va_end (ap);
}

int main (void)
{
  s2848.a = 4027477739U;
  s2848.b = (723419448 + -218144346 * __extension__ 1i);

  check2848va (1, s2848);

  if (fails)
    abort ();

  return 0;
}
--cut here--

> gcc -O2 t1.c

> ./a.out
Aborted

> gdb ./a.out
[...]
(gdb) watch fails
Hardware watchpoint 1: fails
(gdb) run
Starting program: /home/uros/test/compat/a.out 
Hardware watchpoint 1: fails

Old value = 0
New value = 1
0x000000000040051d in check2848va (z=1) at t1.c:29
29          ++fails;
Missing separate debuginfos, use: debuginfo-install glibc.x86_64
(gdb) p /x arg.b
$2 = 0x004005802b1e8138
(gdb) p /x s2848.b
$3 = 0xf2ff61a62b1e8138


-- 


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

Reply via email to