]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/121405 - missed VN with aggregate copy
authorRichard Biener <rguenther@suse.de>
Wed, 6 Aug 2025 10:31:13 +0000 (12:31 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 7 Aug 2025 11:57:18 +0000 (13:57 +0200)
commit53f491ccd1e59fad77fb2cb30d1a58b9e5e5f63c
tree8ea90f0cd74585f7a0617f0fa6393e478d6603af
parenteee51f9a4b6e584230f75e4616438bb5ad5935a9
tree-optimization/121405 - missed VN with aggregate copy

The following handles value-numbering of a BIT_FIELD_REF of
a register that's defined by a load by looking up a subset
load similar to how we handle bit-and masked loads.  This
allows the testcase to be simplified by two FRE passes,
the first one will create the BIT_FIELD_REF.

PR tree-optimization/121405
* tree-ssa-sccvn.cc (visit_nary_op): Handle BIT_FIELD_REF
with reference def by looking up a combination of both.

* gcc.dg/tree-ssa/ssa-fre-107.c: New testcase.
* gcc.target/i386/pr90579.c: Adjust.
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-107.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr90579.c
gcc/tree-ssa-sccvn.cc