From patchwork Sun Oct 6 15:41:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1172542 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-510363-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mqrZ7qX9"; 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 46mSXc2Gz8z9s4Y for ; Mon, 7 Oct 2019 02:42:08 +1100 (AEDT) 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:date:message-id:mime-version:content-type; q=dns; s=default; b=exkMe8k17Y2rJehctdk+dK5bLM7CS643PaHuwjIYhl1XRE3DGm dUhQKz/XuOVLHZrCILt9eoXQn/1VO83d1OIutHHUB62UATQPrMfhqhZx0DP4azV9 wxqm7JeEaThdd0rGRwJAa5Dck1Iqb9ds+jOYhhBK6v6X1u8nUxefKDBA4= 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:date:message-id:mime-version:content-type; s= default; bh=E/VZuk0mwJNZPZ+xNY3i7ylO+2g=; b=mqrZ7qX9mY7S/XwKX++9 avwlXL1hPdlCT95E+wcy3DC9dtgn4D5M9ml3lZo2GOmF+JvQt1xPo/MjG3OMUeyT AylNV8JA1/MlOjCxMyWpnEO5VKzCiTQAJ5TuESMiuPnuyuLUddLE9wfGHf6ahd0/ xHcC/tTm2q4XjVCbMASZWVs= Received: (qmail 120892 invoked by alias); 6 Oct 2019 15:42:01 -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 120692 invoked by uid 89); 6 Oct 2019 15:42:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=broke, 20190930, 2019-09-30, maxim X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Oct 2019 15:41:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 77FDB15AB; Sun, 6 Oct 2019 08:41:57 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0099C3F6C4; Sun, 6 Oct 2019 08:41:56 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, Maxim Kuvyrkov , richard.sandiford@arm.com Cc: Maxim Kuvyrkov Subject: [committed] Fix EXECUTE_IF_SET_IN_HARD_REG_SET use Date: Sun, 06 Oct 2019 16:41:55 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes As Maxim pointed out, r276309 broke -O3 bootstrap for aarch64-linux-gnu. It turns out that EXECUTE_IF_SET_IN_HARD_REG_SET isn't safe to use for temporary objects because their lifetimes don't extend to the end of the loop. This patch therefore uses an explicit temporary instead. Other patches in the series already used this style (but for full_reg_and_partial_clobbers rather than full_reg_clobbers), so AFAICT this is the only place that needs fixing. Tested on aarch64-linux-gnu, both with a normal bootstrap and with bootstrap-O3. Applied as obvious. Richard 2019-10-06 Richard Sandiford gcc/ * var-tracking.c (dataflow_set_clear_at_call): Hoist temporary function result outside of EXECUTE_IF_SET_IN_HARD_REG_SET. Index: gcc/var-tracking.c =================================================================== --- gcc/var-tracking.c 2019-09-30 17:19:45.051128625 +0100 +++ gcc/var-tracking.c 2019-10-06 16:35:52.453747845 +0100 @@ -4902,9 +4902,10 @@ dataflow_set_clear_at_call (dataflow_set unsigned int r; hard_reg_set_iterator hrsi; - function_abi callee_abi = insn_callee_abi (call_insn); + HARD_REG_SET callee_clobbers + = insn_callee_abi (call_insn).full_reg_clobbers (); - EXECUTE_IF_SET_IN_HARD_REG_SET (callee_abi.full_reg_clobbers (), 0, r, hrsi) + EXECUTE_IF_SET_IN_HARD_REG_SET (callee_clobbers, 0, r, hrsi) var_regno_delete (set, r); if (MAY_HAVE_DEBUG_BIND_INSNS)