Verify the code used for the optimized comparison is valid for the comparison's mode.
authorJeff Law <law@redhat.com>
Mon, 23 Mar 2020 23:55:20 +0000 (17:55 -0600)
committerJeff Law <law@redhat.com>
Mon, 23 Mar 2020 23:59:34 +0000 (17:59 -0600)
commit75fb811dfaa29d60a897924b0d1629577b90eee7
treed92865643c0d3d33c9b3db1acdbdb35a651729d8
parent1f6c1c82eb5001a844b5ac535f6aba4a3257031f
Verify the code used for the optimized comparison is valid for the comparison's mode.

PR rtl-optimization/90275
PR target/94238
PR target/94144
* simplify-rtx.c (comparison_code_valid_for_mode): New function.
(simplify_logical_relational_operation): Use it.

PR target/94144
PR target/94238
* gcc.c-torture/compile/pr94144.c: New test.
* gcc.c-torture/compile/pr94238.c: New test.
gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr94144.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr94238.c [new file with mode: 0644]