From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by sourceware.org (Postfix) with ESMTPS id BCD24384404C for ; Mon, 9 Nov 2020 12:47:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCD24384404C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=peterz@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MrryuyH/97XScW4BosJAS4zwAeo7tTC3xuL85liT79w=; b=p8/XOfmP/L72zjcLWmn1pZ29ts kpGpy6Mpd+ol+SzElP7jMWvZjy5ubcDiTOKtLSP08eVDelZ+ygu/DckNP2gXnLbh4moyjSwFlSf+f 5xRn+HoQXC/M62HQ36Yy0RHjVHQpkJRW4wgZYwaaUz/1K+IgtBYEBb4H47XaLVYnYam/Tzkz8uy0H SKV/XCAWHEjTBCQFR2xt+sx4LC/zUyUM4Tjeck/kRVpuNOO94ufUJbZeJka98wyrybJv8AL0jMbpM CB3nucSNMmLrNV0mfuhIJUHKOgC4KhXCDCzACP/QLmxGyXWAjjtbnHBxMQfK4aw96kvQ13mk9zd1q oEYNiNyQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kc6Zo-0002bN-5m; Mon, 09 Nov 2020 12:47:16 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A200F304D58; Mon, 9 Nov 2020 13:47:13 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 83D42203E223C; Mon, 9 Nov 2020 13:47:13 +0100 (CET) Date: Mon, 9 Nov 2020 13:47:13 +0100 From: Peter Zijlstra To: Uros Bizjak Cc: GCC Development , X86 ML , Jakub Jelinek , Andy Lutomirski , linux-toolchains@vger.kernel.org, segher@kernel.crashing.org, borntraeger@de.ibm.com, Will Deacon , Linus Torvalds , mpe@ellerman.id.au Subject: Re: typeof and operands in named address spaces Message-ID: <20201109124713.GP2594@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 12:47:25 -0000 + lots of people and linux-toolchains On Wed, Nov 04, 2020 at 07:31:42PM +0100, Uros Bizjak wrote: > Hello! > > I was looking at the recent linux patch series [1] where segment > qualifiers (named address spaces) were introduced to handle percpu > variables. In the patch [2], the author mentions that: > > --q-- > Unfortunately, gcc does not provide a way to remove segment > qualifiers, which is needed to use typeof() to create local instances > of the per-cpu variable. For this reason, do not use the segment > qualifier for per-cpu variables, and do casting using the segment > qualifier instead. > --/q-- C in general does not provide means to strip qualifiers. We recently had a _lot_ of 'fun' trying to strip volatile from a type, see here: https://lore.kernel.org/lkml/875zimp0ay.fsf@mpe.ellerman.id.au which resulted in the current __unqual_scalar_typeof() hack. If we're going to do compiler extentions here, can we pretty please have a sane means of modifying qualifiers in general?