From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2471 invoked by alias); 9 Apr 2009 01:16:17 -0000 Received: (qmail 2403 invoked by uid 48); 9 Apr 2009 01:16:04 -0000 Date: Thu, 09 Apr 2009 01:16:00 -0000 Message-ID: <20090409011604.2402.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/39678] complex type isn't passed correctly In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hjl dot tools at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg00796.txt.bz2 ------- Comment #24 from hjl dot tools at gmail dot com 2009-04-09 01:15 ------- Here is a testcase in C: [hjl@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; } [hjl@gnu-6 pr39678]$ gcc pr39678-2.c [hjl@gnu-6 pr39678]$ ./a.out Aborted [hjl@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