From patchwork Wed Jul 1 15:25:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 490215 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BF2D51401AD for ; Thu, 2 Jul 2015 01:25:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wH/VkuXA; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=eI1Qn+YgdPgvkFrrLryAfoANqF3/SGp3JqG63bovgTTEl5zivIwBC Z7M56pdlvZsUhxKn0LztYbSjtH5nCw3wwvcOOg2BsyCMqDX5LPKlyXkigFDHp+5u 6ojnKSyfiiWA3d8+FisAfITZbXW7DZRqXo8leFFLkUXMxDfxg05Ozs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=default; bh=9YtIQyIM4eLfjFZr7K11VU2sw04=; b=wH/VkuXASAorMZ9BCgV34U0yL7L3 kVnkL2BQkJT5da4FTxqx4TUDb1Vp0GfZMG2/OTgP9OWklfofP2jv6ltpKK0qLMrN bABPGb4C5DQJozwg3LuEJby6/Ij0s9h9FPcqZm9URGVzga34xBQCtlwfZgte7jpd N3J6Y/A2Q38DRyE= Received: (qmail 115647 invoked by alias); 1 Jul 2015 15:25:22 -0000 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 Received: (qmail 115634 invoked by uid 89); 1 Jul 2015 15:25:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Jul 2015 15:25:20 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-27-eq-FlFf1RJGTa0oDk9AFdQ-1 Received: from localhost ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Jul 2015 16:25:14 +0100 From: Richard Sandiford To: Richard Biener Mail-Followup-To: Richard Biener , GCC Patches , segher@kernel.crashing.org, richard.sandiford@arm.com Cc: GCC Patches , segher@kernel.crashing.org Subject: Re: PR 66685: parallel returns being misclassified References: <87h9ponuzs.fsf@e105548-lin.cambridge.arm.com> Date: Wed, 01 Jul 2015 16:25:14 +0100 In-Reply-To: (Richard Biener's message of "Wed, 1 Jul 2015 10:34:57 +0200") Message-ID: <87zj3fnbmt.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: eq-FlFf1RJGTa0oDk9AFdQ-1 Richard Biener writes: > On Wed, Jul 1, 2015 at 10:27 AM, Richard Sandiford > wrote: >> This patch should restore bootstrap on hppa (and probably other targets >> besides). The change to use target-insns.def put more stress on the >> emit()/classify_insn() group of functions, which were missing a case >> for parallel returns. >> >> Tested with a cross-compiler that it fixes the hppa problem. Bootstrap >> in progress on x86_64-linux-gnu. OK to install? > > Ok. I think this has probably broken bootstrap on powerpc64, where sibcalls have both calls and returns. The loop picks the last candidate, which is the return. Is this patch OK? Thanks, Richard gcc/ PR bootstrap/66685 * rtl.c (classify_insn): Only return JUMP_INSN for parallel returns if there are no CALLs in the same pattern. Index: gcc/rtl.c =================================================================== --- gcc/rtl.c 2015-07-01 16:19:55.055415254 +0100 +++ gcc/rtl.c 2015-07-01 16:19:55.383411635 +0100 @@ -683,17 +683,20 @@ classify_insn (rtx x) if (GET_CODE (x) == PARALLEL) { int j; + bool has_return_p = false; for (j = XVECLEN (x, 0) - 1; j >= 0; j--) if (GET_CODE (XVECEXP (x, 0, j)) == CALL) return CALL_INSN; else if (ANY_RETURN_P (XVECEXP (x, 0, j))) - return JUMP_INSN; + has_return_p = true; else if (GET_CODE (XVECEXP (x, 0, j)) == SET && GET_CODE (SET_DEST (XVECEXP (x, 0, j))) == PC) return JUMP_INSN; else if (GET_CODE (XVECEXP (x, 0, j)) == SET && GET_CODE (SET_SRC (XVECEXP (x, 0, j))) == CALL) return CALL_INSN; + if (has_return_p) + return JUMP_INSN; } #ifdef GENERATOR_FILE if (GET_CODE (x) == MATCH_OPERAND