]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111807 - ICE in verify_sra_access_forest
authorRichard Biener <rguenther@suse.de>
Mon, 16 Oct 2023 10:54:28 +0000 (12:54 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 17 Oct 2023 06:23:33 +0000 (08:23 +0200)
commit3aaf704bca3e01c72d9fe6de01ae5416dba6b5db
treed4294cb3068c951ca3694e22b4d2c69eac039ed0
parent8eb9cdd142182aaa3ee39750924bc0a0491236c3
tree-optimization/111807 - ICE in verify_sra_access_forest

The following addresses build_reconstructed_reference failing to
build references with a different offset than the models and thus
the caller conditional being off.  This manifests when attempting
to build a ref with offset 160 from the model BIT_FIELD_REF <l_4827[9], 8, 0>
onto the same base l_4827 but the models offset being 288.  This
cannot work for any kind of ref I can think of, not just with
BIT_FIELD_REFs.

PR tree-optimization/111807
* tree-sra.cc (build_ref_for_model): Only call
build_reconstructed_reference when the offsets are the same.

* gcc.dg/torture/pr111807.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr111807.c [new file with mode: 0644]
gcc/tree-sra.cc