public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/105548] New: -frounding-math description contains an misleading sentence
@ 2022-05-10 12:59 vincent-gcc at vinc17 dot net
0 siblings, 0 replies; only message in thread
From: vincent-gcc at vinc17 dot net @ 2022-05-10 12:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105548
Bug ID: 105548
Summary: -frounding-math description contains an misleading
sentence
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: vincent-gcc at vinc17 dot net
Target Milestone: ---
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html has
-frounding-math
Disable transformations and optimizations that assume default
floating-point
rounding behavior. This is round-to-zero for all floating point to integer
conversions, and round-to-nearest for all other arithmetic truncations.
This
option should be specified for programs that change the FP rounding mode
dynamically, or that may be executed with a non-default rounding mode. This
option disables constant folding of floating-point expressions at compile
time (which may be affected by rounding mode) and arithmetic
transformations
that are unsafe in the presence of sign-dependent rounding modes.
However, the sentence "This is round-to-zero for all floating point to integer
conversions, and round-to-nearest for all other arithmetic truncations." is
misleading, because even code with no rounding in the source code may be
affected (e.g. PR102498, due to code generated by GCC to load particular
floating-point constants). This sentence doesn't bring anything useful and
should be removed (in short, if some part of the code runs in non-default
rounding mode, then -frounding-math should be used, whatever the operations
involved in the source code). Note also that "round-to-zero for all floating
point to integer conversions" probably doesn't concern the user (or are there
languages with dynamic FP-to-integer rounding modes?).
Possibly add "(round-to-nearest)" at the end of the first sentence.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-10 12:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 12:59 [Bug other/105548] New: -frounding-math description contains an misleading sentence vincent-gcc at vinc17 dot net
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).