From patchwork Thu Oct 27 16:13:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 687777 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 3t4X5K1nv8z9sfH for ; Fri, 28 Oct 2016 03:14:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=X6iMse5/; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ojvcqXkHltTcI69CdrOvb81/m4CNXbKKuRCjeaE1YmAJt+E0cU NUMkj39wzqk/Nm627cMeaaH1d3k+vjY3GckOgJmxp24BfM+ZnJ6Iewkc7axAaFTv DArxphlhsK87+N7Z6QuY/xd4YCDyMDaVFQNXIYYBVGgG3N8cpiu0ey36A= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ULciHPsv7GhJPRZSuB0ZxsYUsdo=; b=X6iMse5/reFypobgs21k DnS/PAMgmMAHchezvsjfvcIu+aStzOYC/tCGhdE2kTM91rU1shH5u77Kj+aYluaZ N5+htr2+WCOYsHV7Reig23WQpCVoh3OTB2IY/NvJ6/OSup3xxafVs8yZ9GIUqTl4 8y6FdIQ7EKfWxoz3CEkgbXU= Received: (qmail 105493 invoked by alias); 27 Oct 2016 16:14: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 105476 invoked by uid 89); 27 Oct 2016 16:14:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=1140, 8, 11408, emit_use, Mar X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Oct 2016 16:13:53 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A6FC32B0C4 for ; Thu, 27 Oct 2016 16:13:52 +0000 (UTC) Received: from reynosa.quesejoda.com (vpn-59-29.rdu2.redhat.com [10.10.59.29]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9RGDpOa009584 for ; Thu, 27 Oct 2016 12:13:51 -0400 To: gcc-patches From: Aldy Hernandez Subject: [committed] avoid double evaluation of PIC_OFFSET_TABLE_REGNUM Message-ID: Date: Thu, 27 Oct 2016 09:13:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 This patch was approved for stage1 a few months back, and I've neglected to commit it. There are no changes from the posted patch. https://gcc.gnu.org/ml/gcc-patches/2016-03/msg01373.html Committed to trunk. commit 5321d430b8d2cf33ff2b5fd9d6cc3f8d1304b0a2 Author: Aldy Hernandez Date: Thu Mar 24 22:44:59 2016 -0500 * builtins.c (expand_builtin_nonlocal_goto): Avoid evaluating PIC_OFFSET_TABLE_REGNUM twice. diff --git a/gcc/builtins.c b/gcc/builtins.c index 997c0e8..cc711a0 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1140,8 +1140,8 @@ expand_builtin_nonlocal_goto (tree exp) to targets with a nonlocal_goto pattern; they are free to implement it in their own way. Note also that this is a no-op if the GP register is a global invariant.) */ - if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM - && fixed_regs[PIC_OFFSET_TABLE_REGNUM]) + unsigned regnum = PIC_OFFSET_TABLE_REGNUM; + if (regnum != INVALID_REGNUM && fixed_regs[regnum]) emit_use (pic_offset_table_rtx); emit_indirect_jump (r_label);