From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9105 invoked by alias); 19 Mar 2008 15:14:00 -0000 Received: (qmail 9024 invoked by uid 22791); 19 Mar 2008 15:13:59 -0000 X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Mar 2008 15:13:37 +0000 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.13.7/8.13.7/ROSCH/DDB) with ESMTP id m2JFDTNQ011670; Wed, 19 Mar 2008 16:13:34 +0100 To: "GCC Patches" Cc: NightStrike , jh@suse.cz Subject: Re: [patch]: pr33617 vector modes have to be passed via memory for x86_64-pc-mingw32 MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Kai Tietz Date: Wed, 19 Mar 2008 15:44:00 -0000 Content-Type: multipart/mixed; boundary="=_mixed 0053A185C1257411_=" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg01154.txt.bz2 --=_mixed 0053A185C1257411_= Content-Type: text/plain; charset="US-ASCII" Content-length: 806 Hello, This bug was found by running testsuite gcc.c-torture for test pr33617.c for target x86_64-pc-mingw32. By ABI complex and vector types have to be returned via memory and passed as memory reference for functions. This patch fixes the ICE happening. ChangeLog entries for gcc 2008-03-19 Kai Tietz * gcc/config/i386/i386.c (return_in_memory_ms_64): Vector and block types are passed via memory. (testsuite gcc.c-torture/compile/pr33617.c). (ix86_pass_by_reference): Check for complex and vector modes. Tested for x86_64-pc-mingw32 target. Other targets are not affected. Is this patch OK for apply? Cheers, Kai | (\_/) This is Bunny. Copy and paste Bunny | (='.'=) into your signature to help him gain | (")_(") world domination. --=_mixed 0053A185C1257411_= Content-Type: text/plain; name="mingw64_pr33617.txt" Content-Disposition: attachment; filename="mingw64_pr33617.txt" Content-Transfer-Encoding: quoted-printable Content-length: 1662 Index: gcc/gcc/config/i386/i386.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/gcc/config/i386/i386.c +++ gcc/gcc/config/i386/i386.c @@ -4506,11 +4506,15 @@ ix86_pass_by_reference (CUMULATIVE_ARGS=20 } } =20 - /* __m128 is passed by reference. */ - /* ??? How to handle complex? For now treat them as structs, - and pass them by reference if they're too large. */ - if (GET_MODE_SIZE (mode) > 8) - return true; + if (COMPLEX_MODE_P (mode) || VECTOR_MODE_P (mode)) + return true; + switch (GET_MODE_SIZE (mode)) + { + case 1: case 2: case 4: case 8: + break; + default: + return true; + } } else if (TARGET_64BIT && type && int_size_in_bytes (type) =3D=3D -1) return 1; @@ -4823,13 +4827,14 @@ return_in_memory_ms_64 (const_tree type, { HOST_WIDE_INT size =3D int_size_in_bytes (type); =20 - /* __m128 and friends are returned in xmm0. */ - if (!COMPLEX_MODE_P (mode) && size =3D=3D 16 && VECTOR_MODE_P (mode)) - return 0; + /* Structures pass always via memory. */ + if (mode =3D=3D BLKmode) + return 1; =20 - /* Otherwise, the size must be exactly in [1248]. But not for complex. */ + /* Otherwise, the size must be exactly in [1248]. But not for complex + and vector. */ return (size !=3D 1 && size !=3D 2 && size !=3D 4 && size !=3D 8) - || COMPLEX_MODE_P (mode); + || COMPLEX_MODE_P (mode) || VECTOR_MODE_P (mode); } =20 int =3D= --=_mixed 0053A185C1257411_=--