------- Comment #24 from hjl dot tools at gmail dot com  2009-04-09 01:15 
-------
Here is a testcase in C:

[...@gnu-6 pr39678]$ cat pr39678-2.c
struct Y { char c; };
struct X {
  struct Y y;
  __complex__ float val;
};

struct X __attribute__((noinline))
foo (float *p)
{
  struct X x;
  __real x.val = p[0];
  __imag x.val = p[1];
  return x;
}
void abort (void);
float a[2] = { 3., -2. };
int main()
{
  struct X x = foo(a);
  if (__real x.val != 3.)
    abort ();
  if (__imag x.val != -2.)
    abort ();
  return 0;
}
[...@gnu-6 pr39678]$ gcc pr39678-2.c  
[...@gnu-6 pr39678]$ ./a.out
Aborted
[...@gnu-6 pr39678]$ 


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|C++ empty struct is passed  |complex type isn't passed
                   |incorrectly                 |correctly


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

Reply via email to