]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/101925 - fix VN with reverse storage order
authorRichard Biener <rguenther@suse.de>
Mon, 16 Aug 2021 13:17:08 +0000 (15:17 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 13 Oct 2021 10:17:36 +0000 (12:17 +0200)
commit66615029ec831da23b481cd3a01e90cff02c6891
tree6e597f13dcc5314b1dde3f538873c6217beee011
parent95a95ec274cd0ec125ce48ab002fad4e400e345b
tree-optimization/101925 - fix VN with reverse storage order

This fixes value-numbering breaking reverse storage order accesses
due to a missed check.  It adds a new overload for
reverse_storage_order_for_component_p and sets reversed on the
VN IL ops for component and array accesses accordingly.
It also compares the reversed reference ops flag on reference
lookup.

2021-08-16  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101925
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Set
reverse on COMPONENT_REF and ARRAY_REF according to
what reverse_storage_order_for_component_p does.
(vn_reference_eq): Compare reversed on reference ops.
(reverse_storage_order_for_component_p): New overload.
(vn_reference_lookup_3): Check reverse_storage_order_for_component_p
on the reference looked up.

* gcc.dg/sso-16.c: New testcase.

(cherry picked from commit 0215b3559e55f39f38e10984a804c53907f7491c)
gcc/testsuite/gcc.dg/sso-16.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c
This page took 0.068497 seconds and 6 git commands to generate.