From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3104 invoked by alias); 1 Aug 2007 08:20:41 -0000 Received: (qmail 3084 invoked by uid 22791); 1 Aug 2007 08:20:40 -0000 X-Spam-Check-By: sourceware.org Received: from smtp1.dnsmadeeasy.com (HELO smtp1.dnsmadeeasy.com) (205.234.170.134) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Aug 2007 08:20:32 +0000 Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 78D273053C3; Wed, 1 Aug 2007 08:20:30 +0000 (UTC) X-Authenticated-Name: js.dnsmadeeasy X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com Received: from avtrex.com (unknown [67.116.42.147]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP; Wed, 1 Aug 2007 08:20:30 +0000 (UTC) Received: from jennifer.localdomain ([192.168.7.228]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 1 Aug 2007 01:20:29 -0700 Message-ID: <46B04209.3000509@avtrex.com> Date: Wed, 01 Aug 2007 08:20:00 -0000 From: David Daney User-Agent: Thunderbird 2.0.0.5 (X11/20070719) MIME-Version: 1.0 To: GCJ-patches , GCC Patches Cc: andreast@gcc.gnu.org Subject: [Patch] libffi: Fix broken return_ul.c test. Content-Type: multipart/mixed; boundary="------------020309010806010908070506" 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: 2007-08/txt/msg00014.txt.bz2 This is a multi-part message in MIME format. --------------020309010806010908070506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 511 The return_ul.c test is failing for mips64 n32 ABI. The problem is that the return value location was too small and was overflowing into adjacent memory. According to the libffi README, return values must be at least as large as ffi_arg, so that is what I used. Tested on x86_64-pc-linux-gnu and mips64-linux-gnu. OK to commit? 2007-08-01 David Daney * testsuite/libffi.call/return_ul.c (main): Define return type as ffi_arg. Use proper printf conversion specifier. --------------020309010806010908070506 Content-Type: text/x-patch; name="ffi-ul.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ffi-ul.diff" Content-length: 705 Index: testsuite/libffi.call/return_ul.c =================================================================== --- testsuite/libffi.call/return_ul.c (revision 127010) +++ testsuite/libffi.call/return_ul.c (working copy) @@ -16,7 +16,7 @@ int main (void) ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; - unsigned long res; + ffi_arg res; unsigned long ul1, ul2; args[0] = &ffi_type_ulong; @@ -31,7 +31,7 @@ int main (void) ul2 = 1073741824L; ffi_call(&cif, FFI_FN(return_ul), &res, values); - printf("res: %ld, %ld\n", res, ul1 + ul2); + printf("res: %lu, %lu\n", (unsigned long)res, ul1 + ul2); /* { dg-output "res: 2147483647, 2147483647" } */ exit(0); --------------020309010806010908070506--