]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/121488 - improve BIT_FIELD_REF lookup in VN
authorRichard Biener <rguenther@suse.de>
Mon, 11 Aug 2025 07:42:09 +0000 (09:42 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 11 Aug 2025 13:44:23 +0000 (15:44 +0200)
commitf2a85db9eee7d761692ca8f69ea1a20d32715bad
treef9db300814540a21a61c23cb940aa7047e3ea61e
parent45a56f42b4909e2ae0d1ad35dab05c5c092a14bc
tree-optimization/121488 - improve BIT_FIELD_REF lookup in VN

When a BIT_FIELD_REF lookup combined with a defining load RHS results
in a wrongly typed result, try looking up or inserting a VIEW_CONVERT_EXPR
to the desired type.

PR tree-optimization/121488
* tree-ssa-sccvn.cc (visit_nary_op): If the BIT_FIELD_REF
result is of wrong type, try a VIEW_CONVERT_EXPR around it.

* gcc.dg/tree-ssa/ssa-fre-108.c: New testcase.
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-108.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.cc