Check for bitwise identity when encoding VECTOR_CSTs (PR 92768)
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 5 Dec 2019 14:20:38 +0000 (14:20 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 5 Dec 2019 14:20:38 +0000 (14:20 +0000)
commit56b4b16eb18e8af5615a9c7b56c6b5e7f9c3adf0
tree5e41d9c2bd48e9c3b6f229b418d7f4fc32780b4d
parent5a784d350c57d670775471bec847370ed7677666
Check for bitwise identity when encoding VECTOR_CSTs (PR 92768)

This PR shows that we weren't checking for bitwise-identical values
when trying to encode a VECTOR_CST, so -0.0 was treated the same as
0.0 for -fno-signed-zeros.  The patch adds a new OEP flag to select
that behaviour.

2019-12-05  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR middle-end/92768
* tree-core.h (OEP_BITWISE): New flag.
* fold-const.c (operand_compare::operand_equal_p): Handle it.
* tree-vector-builder.h (tree_vector_builder::equal_p): Pass it.

gcc/testsuite/
PR middle-end/92768
* gcc.dg/pr92768.c: New test.

From-SVN: r279002
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr92768.c [new file with mode: 0644]
gcc/tree-core.h
gcc/tree-vector-builder.h