From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 34A4D383235B; Mon, 19 Dec 2022 10:37:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34A4D383235B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671446220; bh=LKsZTyaWi4LU2GHaIK+Y/qyM0K15DDANO/0CFTo3G4c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=laza9toqF9QHR/ZgURF1qcxE8zYmWgvRxgm3qJ6/hHV4/HNmsJ7TJxwg6sQ8cSFAE H6kHl6OpfWnlFTd5Ok5JRjZdX94E7XSX8ki607IV4FSlNaqF0/QLWGC0NeDfQDuZqM Mgnj0X7AJKnDJfqFVVHPI1cKAZ0o0LM4fgzb6J+0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55522] -funsafe-math-optimizations is unexpectedly harmful, especially w/ -shared Date: Mon, 19 Dec 2022 10:36:23 +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: 4.6.3 X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: major X-Bugzilla-Who: cvs-commit 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55522 --- Comment #29 from Florian Weimer --- (In reply to H.J. Lu from comment #26) > Created attachment 53686 [details] > A patch not to add crtfastmath.o for -shared on x86 - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s= }} \ Works for me. It's also the change I would have mde. --- Comment #30 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:88b531d0323fc1fc4173f1975d6a4f408a096f8b commit r13-4769-g88b531d0323fc1fc4173f1975d6a4f408a096f8b Author: liuhongt Date: Thu Dec 15 09:38:08 2022 +0800 x86: Don't add crtfastmath.o for -shared Don't add crtfastmath.o for -shared to avoid changing the MXCSR register when loading a shared library. crtfastmath.o will be used only when building executables. PR target/55522 * config/i386/gnu-user-common.h (GNU_USER_TARGET_MATHFILE_SPEC): Don't add crtfastmath.o for -shared. * doc/invoke.texi (-shared): Add related documentation.=