]> git.ipfire.org Git - thirdparty/gcc.git/commit
Check for matching CONST_VECTOR encodings [PR99929]
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 26 Apr 2021 08:36:48 +0000 (09:36 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 26 Apr 2021 08:36:48 +0000 (09:36 +0100)
commit42a8453ae895c232082d0bcff9ae0edbe599ffc6
tree5c0407d94d74dc9d77aabd1edf4d33e30bf8ac06
parent5ced791a38484705f9d2a009c76674d8e7f0ca57
Check for matching CONST_VECTOR encodings [PR99929]

PR99929 is one of those “how did we get away with this for so long”
bugs: the equality routines weren't checking whether two variable-length
CONST_VECTORs had the same encoding.  This meant that:

   { 1, 0, 0, 0, 0, 0, ... }

would appear to be equal to:

   { 1, 0, 1, 0, 1, 0, ... }

since both are represented using the elements { 1, 0 }.

gcc/
PR rtl-optimization/99929
* rtl.h (same_vector_encodings_p): New function.
* cse.c (exp_equiv_p): Check that CONST_VECTORs have the same encoding.
* cselib.c (rtx_equal_for_cselib_1): Likewise.
* jump.c (rtx_renumbered_equal_p): Likewise.
* lra-constraints.c (operands_match_p): Likewise.
* reload.c (operands_match_p): Likewise.
* rtl.c (rtx_equal_p_cb, rtx_equal_p): Likewise.

(cherry picked from commit a87d3f964df31d4fbceb822c6d293e85c117d992)
gcc/cse.c
gcc/cselib.c
gcc/jump.c
gcc/lra-constraints.c
gcc/reload.c
gcc/rtl.c
gcc/rtl.h