From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 49FBF3858D3C; Tue, 19 Oct 2021 10:41:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49FBF3858D3C From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102783] [powerpc] FPSCR manipulations cannot be relied upon Date: Tue, 19 Oct 2021 10:41:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 10:41:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102783 --- Comment #8 from Segher Boessenkool --- (In reply to joseph@codesourcery.com from comment #6) > Generically (and if the command-line options are such that floating-point= =20 > control / status bits are to be respected by optimizations), *any*=20 > function call might access or modify floating-point control and status=20 > bits, subject to e.g. const functions not being able to access them, pure= =20 > functions not being able to modify them, functions whose body is known=20 > having properties based on analysis of that body, built-in functions=20 > having semantics based on what the compiler knows about those functions.= =20=20 If FENV_ACCESS is OFF most of those things can be ignored as well. But FENV_ACCESS is much too blunt a hammer for most of our uses. > And then a subset of asms may similarly access or modify them (based on=20 > inputs / outputs / clobbers, but maybe on some architectures existing=20 > practice doesn't provide a register name that inputs / outputs / clobbers= =20 > can use to refer to floating-point state). Like PowerPC. But we *do* model vscr (vector status and control register). It won't be hard to add fpscr. > Then you'd need something like Marc Glisse's -ffenv-access patches (Augus= t=20 > 2020) to represent the other side of things, how floating-point operation= s=20 > also access / modify such bits. Yeah, we need something for normal computational FP insns to clobber (on PowerPC load/store insns never change the fpscr / fenv, but I bet that is different on other archs). Thanks for the pointer, I'll find Marc's work.=