https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127792
Bug ID: 127792
Summary: Allow eliding (specific) IEEE exceptions
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
We have -fdelete-dead-exceptions which mentions "delete dead instructions that
may throw exceptions". Add a corresponding -fdelete-dead-ieee-exceptions
that allows deleting dead instructions that may set IEEE exception flags,
defaulted to true.
Document whether this would extend to transforms on instructions that are
not dead but would possibly elide setting of IEEE exceptions, like
raising INVALID on NaN + 0. Of course do not allow to possibly raise
IEEE exceptions that would not have been raised.
Combined, a -fstrict-ieee-exceptions flag might be more useful?
Implementation-wise I'd add, similar to HONOR_NANS, flags like
HONOR_IEEE_INVALID, etc. (for select -fno-trapping-math), and
ELIDE_IEEE_INVALID (for whether eliding a specific exception is valid).