From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92137 invoked by alias); 14 Nov 2018 13:47:26 -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 92120 invoked by uid 89); 14 Nov 2018 13:47:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=*should* 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; Wed, 14 Nov 2018 13:47:23 +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 wAEDlHqB012933; Wed, 14 Nov 2018 07:47:17 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id wAEDlFKp012921; Wed, 14 Nov 2018 07:47:15 -0600 Date: Wed, 14 Nov 2018 13:47:00 -0000 From: Segher Boessenkool To: Jakub Jelinek Cc: Martin Sebor , Gcc Patch List Subject: Re: [PATCH] diagnose unsupported uses of hardware register variables (PR 88000) Message-ID: <20181114134709.GA23873@gate.crashing.org> References: <20181114122250.GZ23873@gate.crashing.org> <20181114122726.GW11625@tucnak> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181114122726.GW11625@tucnak> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg01263.txt.bz2 On Wed, Nov 14, 2018 at 01:27:26PM +0100, Jakub Jelinek wrote: > On Wed, Nov 14, 2018 at 06:22:51AM -0600, Segher Boessenkool wrote: > > Btw, if you just add > > > > void * > > retsp (void) > > { > > register void *sp __asm ("sp"); > > asm ("" : "+g" (sp)); // <-- this line > > return sp; > > } > > > > everything works fine. > > Even in what you are proposing, i.e. handle the var as any other var > in SSA form and only copy into the hard register right before asm and out of > it after it? Yes, *only* in that: with current trunk sp lives in the "sp" hard register at the "return sp", which cannot work reliably (what value is returned? It is unspecified). > Because > { > void *sp; > asm ("" : "+g" (sp)); > return sp; > } > would store into the register default definition of the SSA_NAME (the var > has no initializer). I'm more concerned about what it looks like in RTL, but sure :-) What *should* it do before RTL? Not much at all I think, just keep track that this var is a register asm and that's that? Segher