]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/113630 - invalid code hoisting
authorRichard Biener <rguenther@suse.de>
Wed, 31 Jan 2024 10:28:50 +0000 (11:28 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 6 May 2024 11:52:20 +0000 (13:52 +0200)
commit47cd06042237bf2d4f05b8355362bc038f6fa445
treec99e737865a2fdb0fe4ecc5418f8e8ad031a1fd4
parent429935510202c4efee933bf907fd9dff816193f2
tree-optimization/113630 - invalid code hoisting

The following avoids code hoisting (but also PRE insertion) of
expressions that got value-numbered to another one that are not
a valid replacement (but still compute the same value).  This time
because the access path ends in a structure with different size,
meaning we consider a related access as not trapping because of the
size of the base of the access.

PR tree-optimization/113630
* tree-ssa-pre.cc (compute_avail): Avoid registering a
reference with a representation with not matching base
access size.

* gcc.dg/torture/pr113630.c: New testcase.

(cherry picked from commit 724b64304ff5c8ac08a913509afd6fde38d7b767)
gcc/testsuite/gcc.dg/torture/pr113630.c [new file with mode: 0644]
gcc/tree-ssa-pre.cc