RFR: 8295159: DSO created with -ffast-math breaks Java floating-point arithmetic [v5]
Andrew Haley
aph at openjdk.org
Wed Oct 12 16:13:13 UTC 2022
On Wed, 12 Oct 2022 15:48:25 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Do we need to shuffle^W sort includes in this patch? I presume you'd want this patch to be cleanly backportable, which means it should probably be as point-y as it can get.
OK, I can back that part out.
> src/hotspot/os/linux/os_linux.cpp line 1747:
>
>> 1745: void * os::Linux::dlopen_helper(const char *filename, char *ebuf,
>> 1746: int ebuflen) {
>> 1747: // JDK-8295159: Protect floating-point environment.
>
> We need to be more verbose in these comments. Say something like:
>
>
> There are known cases where global library initialization sets the FPU flags
> that affect computation accuracy, for example, enabling Flush-To-Zero and
> Denormals-Are-Zero. Do not let those libraries break the Java arithmetic.
> Unfortunately, this might break the libraries that might depend on these FPU
> features for performance and/or numerical "accuracy", but we need to protect
> the Java semantics first and foremost. See JDK-8295159.
Thanks, that is elegantly expressed.
-------------
PR: https://git.openjdk.org/jdk/pull/10661
More information about the build-dev
mailing list