From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116988 invoked by alias); 16 Dec 2018 08:43:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 116973 invoked by uid 89); 16 Dec 2018 08:43:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,SPF_PASS autolearn=no version=3.3.2 spammy=HX-OutGoing-Spam-Status:score, 11807, 52813, filed X-HELO: server28.superhosting.bg Received: from server28.superhosting.bg (HELO server28.superhosting.bg) (217.174.156.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Dec 2018 08:43:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6d9NRaGRnO7nMT/PZCx9wTF5UVpO5GQlZNisEMAOGpU=; b=CMxSD02vjC7S/HG8Fu1aVjLmXW vFxCvIDQGMh/ELu8DPvDTeiol8VA+vcTxDm8gAmYK59Z4PiGzKRtCuW3Q5y17p7y0l62EcquGlPfq v0/MBUIC37vhbPjXWF6neELz645Hno6+NbEbImralqiktx3lLVEvuNukXK0ixR0GH0oRHd0oWA8TE QdocJuFsBtFmcaGtzWIhm36sSThosnezyG1FA8ekpsqRZ87uzIzVqeMNcKB6RJJE37caWvDwjnejg NV6e6Xc/19UedflrHCJecj7CIzPSvoglR/luOofFat5eIrV2wXQhUPzU2eaFeHrjz20oYTjsz5Szk 7NaGL5xA==; Received: from [95.87.234.74] (port=54794 helo=tpdeb.localnet) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gYS1c-0005Zw-An; Sun, 16 Dec 2018 10:43:50 +0200 From: Dimitar Dimitrov To: Segher Boessenkool Cc: Christophe Lyon , Thomas Preudhomme , gcc Patches , Richard Sandiford , Thomas Preud'homme Subject: Re: [PATCH] [RFC] PR target/52813 and target/11807 Date: Sun, 16 Dec 2018 08:43:00 -0000 Message-ID: <53282174.7PqLvzYRYy@tpdeb> User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: <20181214085217.GM3803@gate.crashing.org> References: <20181209100856.14051-1-dimitar@dinux.eu> <3948697.eYaff1WIgU@tpdeb> <20181214085217.GM3803@gate.crashing.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-OutGoing-Spam-Status: No, score=-0.5 X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01163.txt.bz2 On Fri, Dec 14 2018 2:52:17 EET Segher Boessenkool wrote: > You need a few tweaks to what you committed. Or just one perhaps: if > flag_pic is not set, you should not check PIC_OFFSET_TABLE_REGNUM, it is > meaningless in that case. I'm not sure if you need to check whether the > register is fixed or not. The flag_pic flag is already checked by the PIC_OFFSET_TABLE_REGNUM macro. It will return INVALID_REGNUM if flag_pic is false, so no error will be printed. Note that the PIC_OFFSET_TABLE_REGNUM behaviour is not changed by my patch. I merely moved the existing check into a separate function. > > But there are many more regs than just the PIC reg and the stack pointer > that you would want to similarly warn about, because overwriting those > registers is just as fatal: the frame pointer, the program counter, etc. > _Most_ fixed registers, but not _all_. > > So maybe it should be a target hook? OTOH that is a lot of work for such > a trivial warning, that isn't very useful anyway (a better warning for > any asm is: "Are you sure?" :-) ) I'll think about a more generic solution. But in light of the several filed PRs I think it's worth having a simple check for SP. Regards, Dimitar