From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0504385BF83; Tue, 14 Apr 2020 19:35:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0504385BF83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586892942; bh=1aMM2RYyPAWSvhb0WR8yvObQhaP+euQCY1Vra7QhRlQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n6jVRRVWpd47dAWxT2Xz7pb2EIXJurq/YZ7QzP+vjUHAdjaiPSPT8tzxZxf9tETLy 3q0TtozXWRXZs7lXPxlsbNg++s6UJDDtP553/HBz99gog3uITzcD098nG2RIkaE62g 7bgFtb2kJCsvHpQf4FuSARj/7a+aTEqEin09jrMs= From: "lopresti at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94587] Intrinsics optimization bug with -O2 -march=skylake-avx512 Date: Tue, 14 Apr 2020 19:35:42 +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: 9.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: lopresti at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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, 14 Apr 2020 19:35:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94587 --- Comment #5 from Patrick J. LoPresti --- (In reply to Andrew Pinski from comment #4) >=20 > Note this is true even without using intrinsics really. You can get the > same behavior you are seeing with using standard C code.=20=20 Yes, which is one reason I am using intrinsics: They provide deterministic behavior on literally every compiler at every optimization level by default. Except GCC when AVX512 is enabled, that is. > >=20 > > Wouldn't fp-contract be more appropriate as part of "-ffast-math"? >=20 > No. This has been discussed many times and decided no.=20=20 A ridiculous but not surprising decision. > https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/Floating-point-implementatio= n. > html#Floating-point-implementation Well, that page is wrong. "Expressions are currently only contracted if -ffp-contract=3Dfast, -funsafe-math-optimizations or -ffast-math are used." I did not use -ffp-contract=3Dfast nor -funsafe-math-optimizations nor -ffast-math. Yet the statements were contracted. So the documentation has a bug. More to the point, it does not answer the question I asked, which is what options are required to get deterministic behavior from intrinsics. So I suppose I have to re-read that chapter on every release, then search t= he rest of the documentation to learn what the defaults are, to figure out whe= ther and how you broke something further? OK thanks=