https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69308
Bug ID: 69308 Summary: ifcombine joins together floating point expression with side effects Product: gcc Version: 5.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: mtliang at synopsys dot com Target Milestone: --- Created attachment 37366 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37366&action=edit test case With floating point exceptions enabled, passing a signaling NaN into the expression ( !isnan(x) && x > 0.0 ) ends up with the second half evaluating and raising an FPE. Compiling with the -fsignaling-nans flag does not help, and the only way to get past this is to disable this pass with the -fdisable-tree-ifcombine flag. Should ifcombine look at the -fsignaling-nans flag and disqualify floating point expressions for that case? The attached test case should print "pass" for all cases. With the current GCC the optimized build fails with FPE unless built with ifcombine disabled.