Skip to content
Snippets Groups Projects
Commit 15d85578 authored by Andrew Pinski's avatar Andrew Pinski
Browse files

MATCH: [PR111109] Fix bit_ior(cond,cond) when comparisons are fp

The patterns that were added in r13-4620-g4d9db4bdd458, missed that
(a > b) and (a <= b) are not inverse of each other for floating point
comparisons (if NaNs are supported). Even though there was a check for
intergal types, it was only for the result of the cond rather for the
type of what is being compared. The fix is to check to see if cmp and
icmp are inverse of each other by using the invert_tree_comparison function.

OK for trunk and GCC 13 branch? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

I added the testcase to execute/ieee as it requires support for NAN.

	PR tree-optimization/111109

gcc/ChangeLog:

	* match.pd (ior(cond,cond), ior(vec_cond,vec_cond)):
	Add check to make sure cmp and icmp are inverse.

gcc/testsuite/ChangeLog:

	* gcc.c-torture/execute/ieee/fp-cmp-cond-1.c: New test.

(cherry picked from commit 4aa14ec7)
parent fb6d6129
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment