From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15873 invoked by alias); 13 Dec 2018 14:49:09 -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 15828 invoked by uid 89); 13 Dec 2018 14:49:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=10PM, 10pm X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Dec 2018 14:49:06 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id wBDEme2V020652; Thu, 13 Dec 2018 08:48:40 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id wBDEmcJY020646; Thu, 13 Dec 2018 08:48:38 -0600 Date: Thu, 13 Dec 2018 14:49:00 -0000 From: Segher Boessenkool To: Dimitar Dimitrov Cc: Christophe Lyon , Thomas Preudhomme , gcc Patches , Richard Sandiford , "Thomas Preud'homme" Subject: Re: [PATCH] [RFC] PR target/52813 and target/11807 Message-ID: <20181213144837.GD3803@gate.crashing.org> References: <20181209100856.14051-1-dimitar@dinux.eu> <4591520.WeSID5Fo3g@tpdeb> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4591520.WeSID5Fo3g@tpdeb> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00932.txt.bz2 On Wed, Dec 12, 2018 at 06:26:10PM +0200, Dimitar Dimitrov wrote: > I expect that if I mark a HW register as "clobber", compiler would save its > contents before executing the asm statement, and after that it would restore > its contents. This is the GCC behaviour for all but the SP and PIC registers. > That is why I believe that PR52813 is a valid bug. It won't do it for *any* fixed registers. But you do not want to error or even warn for some fixed registers, for example the "flags" register on x86 is *always* written to by asm. But you never want to warn for non-fixed registers, and e.g. PIC_OFFSET_TABLE_REGNUM isn't always a fixed register (when flag_pic is 0 for example). > I'm not sure how GCC could recover if SP is clobbered. If SP is clobbered in > such a way that GCC will not notice (e.g. thread switching), then why should > GCC know about it in the first place? Up until today, GCC has always just ignored it if you claimed to clobber the stack pointer. Segher