From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 9CBE93858D1E for ; Fri, 23 Dec 2022 20:27:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CBE93858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 2BNKQhTX006079; Fri, 23 Dec 2022 14:26:43 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 2BNKQguZ006078; Fri, 23 Dec 2022 14:26:42 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 23 Dec 2022 14:26:42 -0600 From: Segher Boessenkool To: "Kewen.Lin" Cc: GCC Patches , Iain Sandoe , David Edelsohn , Peter Bergner Subject: Re: [PATCH v2] rs6000: Rework option -mpowerpc64 handling [PR106680] Message-ID: <20221223202642.GC25951@gate.crashing.org> References: <63afd344-38fa-7a8e-4958-8256c2a9bca7@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63afd344-38fa-7a8e-4958-8256c2a9bca7@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! On Wed, Oct 12, 2022 at 04:12:21PM +0800, Kewen.Lin wrote: > PR106680 shows that -m32 -mpowerpc64 is different from > -mpowerpc64 -m32, this is determined by the way how we > handle option powerpc64 in rs6000_handle_option. > > Segher pointed out this difference should be taken as > a bug and we should ensure that option powerpc64 is > independent of -m32/-m64. So this patch removes the > handlings in rs6000_handle_option and add some necessary > supports in rs6000_option_override_internal instead. Sorry for the late review. > + /* Don't expect powerpc64 enabled on those OSes with OS_MISSING_POWERPC64, > + since they don't support saving the high part of 64-bit registers on > + context switch. If the user explicitly specifies it, we won't interfere > + with the user's specification. */ It depends on the OS, and what you call "context switch". For example on Linux the context switches done by the kernel are fine, only things done by setjmp/longjmp and getcontext/setcontext are not. So just be a bit more vague here? "Since they do not save and restore the high half of the GPRs correctly in all cases", something like that? Okay for trunk like that. Thanks! Segher