mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-23 11:05:09 +08:00
rtl-optimization/105091 - wrong DSE with missed TREE_ADDRESSABLE
When expanding an aggregate copy into a memcpy call RTL expansion uses mark_addressable to ensure the base object is addressable but that function doesn't handle TARGET_MEM_REF bases. Fixed as follows. 2022-03-31 Richard Biener <rguenther@suse.de> PR rtl-optimization/105091 * gimple-expr.cc (mark_addressable): Handle TARGET_MEM_REF bases.
This commit is contained in:
parent
b8207ad367
commit
b75f996e84
@ -910,7 +910,8 @@ mark_addressable (tree x)
|
|||||||
x = TREE_OPERAND (x, 0);
|
x = TREE_OPERAND (x, 0);
|
||||||
while (handled_component_p (x))
|
while (handled_component_p (x))
|
||||||
x = TREE_OPERAND (x, 0);
|
x = TREE_OPERAND (x, 0);
|
||||||
if (TREE_CODE (x) == MEM_REF
|
if ((TREE_CODE (x) == MEM_REF
|
||||||
|
|| TREE_CODE (x) == TARGET_MEM_REF)
|
||||||
&& TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
|
&& TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
|
||||||
x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
|
x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
|
||||||
if (!VAR_P (x)
|
if (!VAR_P (x)
|
||||||
|
Loading…
Reference in New Issue
Block a user