From patchwork Mon May 13 15:16:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 1098949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-500568-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="KBMurP0s"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VpK4OMx5"; dkim-atps=neutral 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 452kvK2Xg5z9sBb for ; Tue, 14 May 2019 01:17:12 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=vglcj8qawMEdwNBdij1r+n2c63hZfWDUFcphNA6udX8l8g C+RZa6eplm12zyPMsf3h8dWKQ+tQHgeayV2JRJkJlcusDmtrsv06smHm+tipZTz8 ov0JBRGjbuySR07lHMUXZiSDIUb3LMOAi/jqY3ChGTTxXYtaCGpAHjb7+n+pI= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=XUlMg/b3gIVafafEtoxxIUABSUg=; b=KBMurP0spkqdUkCFnwaQ 5mKcAw4MIfRHygFgI72GLMhFs5R4wUbjqmy9Vl/0bkLs1tVwvtU3l3XROHwrXUB+ 1FpgPAqSOIZ4tbgk2GCYVsSt/QXab7m0C7Thw1m0oqs2iizBwSz3E1VcX4bIqsqz 6EMHGkXqgJFrWqHfn2QIcaw= Received: (qmail 74112 invoked by alias); 13 May 2019 15:17:04 -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 74103 invoked by uid 89); 13 May 2019 15:17:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:rs6000_, sk:restore, HX-Languages-Length:1226 X-HELO: mail-wm1-f44.google.com Received: from mail-wm1-f44.google.com (HELO mail-wm1-f44.google.com) (209.85.128.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 May 2019 15:17:03 +0000 Received: by mail-wm1-f44.google.com with SMTP id j187so14119905wmj.1 for ; Mon, 13 May 2019 08:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=HOjAo6Cs2ECK7EiZS3OSlKOZR3aQvRIxu4W2iybvgqM=; b=VpK4OMx5gL9efuX8/Hbuld2MHhibhfaKCBI6YMmYnv6kT7y72XeU3i7+rC658GxOnz SAd5NCldD7SwB9HK/hLi6TkOxgpvBAVNLOAmg/zZINIgaJWmX1uK/KZihhIFtSKSJzQC ISfqK0rbx8tvdlKJK68p2qvPOPzGzjO1Cy7T8Yl6J8w74S5FJMgpJ2z4/O2FGf4S2wMt tsCnGvjoULGF2ZuvViO+zwkI8pIDqfrZuyOaKSNmjeQITx6F7v+WKURIAc43imlOt90Q XJ8pUmsqVBpYRgKhx8CvZdbcBgT93kgTjTLutNMevHyrxGrLnmxbtR6VgUK+QyAU8cZX wKLw== MIME-Version: 1.0 From: David Edelsohn Date: Mon, 13 May 2019 11:16:46 -0400 Message-ID: Subject: [PATCH] Fix rs6000 exception handling (PR target/90418) To: GCC Patches Following the same pattern as the AArch64 patch, this patch fixes the PPC32 BE and AIX EH failures after the sibcall changes. This does not address the Darwin failures because of SAVE_WORLD. Bootstrapped on powerpc-ibm-aix7.2.0.0, powerpc64le-unknown-linux-gnu, powerpc64-unknown-linux-gnu, powerpc-unknown-linux-gnu Approved by Segher and me. Thanks, David * config/rs6000/rs6000.c (rs6000_emit_epilogue): Don't load EH data registers in sibcall epilogues. Don't add EH_RETURN_STACKADJ_RTX to sp in sibcall epilogues. Index: rs6000.c =================================================================== --- rs6000.c (revision 271111) +++ rs6000.c (working copy) @@ -28423,7 +28423,7 @@ rs6000_emit_epilogue (int sibcall) restore_saved_lr (0, exit_func); /* Load exception handler data registers, if needed. */ - if (crtl->calls_eh_return) + if (!sibcall && crtl->calls_eh_return) { unsigned int i, regno; @@ -28614,7 +28614,7 @@ rs6000_emit_epilogue (int sibcall) RTX_FRAME_RELATED_P (insn) = 1; } - if (crtl->calls_eh_return) + if (!sibcall && crtl->calls_eh_return) { rtx sa = EH_RETURN_STACKADJ_RTX; emit_insn (gen_add3_insn (sp_reg_rtx, sp_reg_rtx, sa));