From patchwork Wed Jan 18 19:26:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 136683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 56BF4B6EE6 for ; Thu, 19 Jan 2012 06:26:36 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1327519599; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=jt6aUuF whLXyNNPcF38Vtfm2YPA=; b=JGZUz7nS2EX0I1TF6g82qEgyn5hczVY1J4oR9Tq 0bGpwg0GUIpfNdUGM1+wvTArilW81+dSd3HQ7yBTEctSsT34GI6WnwXGMeVWlECs BnmU0BFAPwAUQCMw5vXaaKBWWdodYWlXBU5JTnEAaRKHMeZTQ8ApwiEdtdA4v3Ek kJSk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=AVDbqlJIfU3k+DIrNgYzT6TwpLMYtHQ6W3O+TsB6xV4xT0ejox5XcQD3QXqpbd 7qJBD7JnEdprcLNDnT/0x4NIFPKyhBQzDri/+10FhH5RrlqzYIa6vaaizKZOIDm2 LCJy7UFI/3ieREIwLAw+yvlJfYIc43ftfpBuZ6JL/HVOc=; Received: (qmail 28987 invoked by alias); 18 Jan 2012 19:26:33 -0000 Received: (qmail 28979 invoked by uid 22791); 18 Jan 2012 19:26:33 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Jan 2012 19:26:16 +0000 Received: by ghbz2 with SMTP id z2so3217350ghb.20 for ; Wed, 18 Jan 2012 11:26:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.93.4 with SMTP id k4mr33529152yhf.114.1326914776396; Wed, 18 Jan 2012 11:26:16 -0800 (PST) Received: by 10.146.124.2 with HTTP; Wed, 18 Jan 2012 11:26:16 -0800 (PST) Date: Wed, 18 Jan 2012 20:26:16 +0100 Message-ID: Subject: [PATCH, trans-mem]: Fix PR51830, FAIL: libitm.c/mem(cpy|set)-1.c execution test on x86_32 From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: Richard Henderson , Aldy Hernandez , Torvald Riegel , Patrick Marlier Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello! Attached three-liner patch fixes the declaration of BUILT_IN_TM_START (AKA _ITM_beginTransaction) to match its declaration from the libitm.h ABI. This mismatch was the core problem for FAILed libitm.c/mem(cpy|set)-1.c execution tests on x86_32. Following that change, we need to teach _ITM_beginTransaction where to find its first argument, so it can be passed to GTM_begin_transaction. There was some discussion on where to pass arguments to regparm decorated vararg functions. Well, as the ABI is pretty clear - regparm should be ignored in this case, so all function arguments have to be passed in memory, even if that means that the value is kicked to the memory before the call, and pulled back into the register in _ITM_beginTransaction. 2012-01-18 Uros Bizjak PR libitm/51830 * builtin-types.def (BT_FN_UINT_UINT_VAR): New. * gtm-builtins.def (BUILT_IN_TM_START): Declare as BT_FN_UINT_UINT_VAR. libitm/ChangeLog: 2012-01-18 Uros Bizjak PR libitm/51830 * config/x86/sjlj.S (_ITM_beginTransaction) [!__x86_64__]: Load the first function argument to %eax. The patch touches generic libitm part, so I have tested it on i686-pc-linux-gnu (where it fixes all failures), x86_64-pc-linux-gnu and alphaev68-pc-linux-gnu. OK for mainline? Uros. Index: libitm/config/x86/sjlj.S =================================================================== --- libitm/config/x86/sjlj.S (revision 183277) +++ libitm/config/x86/sjlj.S (working copy) @@ -79,6 +79,7 @@ ret #else leal 4(%esp), %ecx + movl 4(%esp), %eax subl $28, %esp cfi_def_cfa_offset(32) movl %ecx, 8(%esp) Index: gcc/builtin-types.def =================================================================== --- gcc/builtin-types.def (revision 183277) +++ gcc/builtin-types.def (working copy) @@ -498,6 +498,8 @@ BT_VOID, BT_CONST_PTR) DEF_FUNCTION_TYPE_VAR_1 (BT_FN_INT_CONST_STRING_VAR, BT_INT, BT_CONST_STRING) +DEF_FUNCTION_TYPE_VAR_1 (BT_FN_UINT_UINT_VAR, + BT_UINT, BT_UINT) DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_FILEPTR_CONST_STRING_VAR, BT_INT, BT_FILEPTR, BT_CONST_STRING) Index: gcc/gtm-builtins.def =================================================================== --- gcc/gtm-builtins.def (revision 183277) +++ gcc/gtm-builtins.def (working copy) @@ -1,5 +1,5 @@ DEF_TM_BUILTIN (BUILT_IN_TM_START, "_ITM_beginTransaction", - BT_FN_UINT_UINT, ATTR_TM_NOTHROW_RT_LIST) + BT_FN_UINT_UINT_VAR, ATTR_TM_NOTHROW_RT_LIST) DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT, "_ITM_commitTransaction", BT_FN_VOID, ATTR_TM_NOTHROW_LIST)