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 D8DF93858288 for ; Mon, 10 Oct 2022 13:59:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D8DF93858288 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 29ADwU05030035; Mon, 10 Oct 2022 08:58:30 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 29ADwT9e030029; Mon, 10 Oct 2022 08:58:29 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 10 Oct 2022 08:58:29 -0500 From: Segher Boessenkool To: "Kewen.Lin" Cc: Iain Sandoe , GCC Patches Subject: Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680] Message-ID: <20221010135829.GA25951@gate.crashing.org> References: <9d9f1f43-b528-387d-45a7-1d89400de0fc@linux.ibm.com> <5B4DCBBB-3237-4A9F-ACCA-6669DE6905B8@sandoe.co.uk> <92415AC8-4A5A-4119-BFCC-D7C66472F961@sandoe.co.uk> <5e64fed0-7e79-3d60-da62-5c2bf3e2c707@linux.ibm.com> <20220929171100.GY25951@gate.crashing.org> <20221003211530.GQ25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,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: On Mon, Oct 10, 2022 at 10:15:58AM +0800, Kewen.Lin wrote: > on 2022/10/4 05:15, Segher Boessenkool wrote: > > Right. If If mpowerpc64 is enabled while OS_MISSING_POWERPC64, warn for > > that; > > Currently if option powerpc64 is enabled explicitly while OS_MISSING_POWERPC64, > there is no warning. One typical case is -m32 compilation on ppc64. I made > a patch to warn for this case as you suggested (btw, this change can be taken > separately from this rework), it caused some test cases to fail as below: "Explicitly" means the user says "-m32 -mpowerpc64". I wonder what "on powerpc64" means in what you say, and why that would matter? > gcc.dg/vect/vect-82_64.c > gcc.dg/vect/vect-83_64.c > gcc.target/powerpc/bswap64-4.c > gcc.target/powerpc/ppc64-double-1.c > gcc.target/powerpc/pr106680-4.c > gcc.target/powerpc/rs6000-fpint-2.c > > It's fine to fix them with one additional option "-w" to disable the warning. > But IIUC one concern is that if we want to test with "--target_board=unix'{-m32, > -m32/-mpowerpc64}'", the latter combination will always have this warning, > with one extra "-w" (that is -m32/-mpowerpc64/-w) can make some cases which > aim to check warning msg ineffective. So maybe we want to re-consider it > (like just leaving it as before)? There will always be false positives (and negatives!) if you put any warning options in RUNTESTFLAGS. -w is merely louder than most :-) But leave this as further improvement. Maybe put in a comment. > > and if mpowerpc64 was only implicit, disable it as well (and say > > we did!) > > But on ppc64 linux, for -m32 compilation mpowerpc64 is implicitly enabled > since it's with bi-arch supported, I made a patch to disable it as well as > warn it, it can't be bootstrapped since it warned for -m32 build (-Werror) > and failed. So I refined it to something like: > > + /* With RS6000_BI_ARCH defined (bi-architecture (32/64) supported), > + TARGET_DEFAULT has bit MASK_POWERPC64 on by default, to keep the > + behavior consistent (like: no warnings for -m32 on ppc64), we > + just sliently disable it. Otherwise, disable it and warn. */ > + rs6000_isa_flags &= ~OPTION_MASK_POWERPC64; > +#ifndef RS6000_BI_ARCH > + warning (0, "powerpc64 is unexpected to be enabled on the " > + "current OS"); > +#endif It has nothing to do with biarch. Let's just not warn if it is so much work to do it correctly. We never did before, and no one complained, how bad can it be :-) Segher