Fix three issues building with the sun/oracle workshop compiler#21610
Merged
Conversation
khwilliamson
approved these changes
Nov 3, 2023
Contributor
Author
|
Need to look into the MSVC failures, I suspect it's a config.sh issue |
Encountered while testing -O1 with the workshop compiler on Oracle Linux, follows the same test and workaround done in hints/solaris_2.sh
The test in Configure warns: /* Note that whether the sign bit is on or off * for NaN depends on the CPU/FPU, and possibly * can be affected by the build toolchain. but this test assumed that the default NaN was always positive, but this isn't the case with the Sun/Oracle workshop cc, whether on Oracle Linux or on Solaris. copysign() is however well defined for NaN, so we can modify the sign on NaN and test that with signbit(). Fixes Perl#21533
This is enabled in config.gc, and gcc builds were using only msvcrt for a long time, so presumably MSVC 2013 which uses msvcrt also supports it. Later MSVC uses ucrt which definitely supports copysign.
But it appears that the fallback for Perl_signbit() in numeric.c is broken when we've found a definition for Perl_fp_class_nzero(). When Perl_fp_class_nzero is defined, the fallback Perl_signbit() simply returns that value, but Perl_fp_class_nzero() only returns true when the number is negative zero, not for any negative number. But C99 requires signbit(), so I don't think it's worth spending any more time looking into this. We might want to eliminate Perl_signbit() from numeric.c, or try to fix it.
It also defines fpclassify(), but that's a more complex change due to the classification macros in perl.h
6464ba2 to
5414431
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #21535
Fixes #21533
Fixes a build issue with
c99from sun/oracle workshop.