aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-05-19 12:36:19 +0200
committerRichard Biener <rguenther@suse.de>2021-05-19 14:53:50 +0200
commit35a16e4b38eb9faf212de9814f17a5215fa5538a (patch)
tree066e20b1a46a20cc5decd53bed51140dbfac3fa8 /gcc/cfgexpand.c
parent2e6ad1ba532fe684633edac766c598be19ad3b59 (diff)
downloadgcc-35a16e4b38eb9faf212de9814f17a5215fa5538a.zip
gcc-35a16e4b38eb9faf212de9814f17a5215fa5538a.tar.gz
gcc-35a16e4b38eb9faf212de9814f17a5215fa5538a.tar.bz2
Avoid marking TARGET_MEM_REF bases addressable
The following does no longer mark TARGET_MEM_REF bases addressable, mimicing MEM_REFs beahvior here. In contrast to the latter, TARGET_MEM_REF RTL expansion expects to always operate on memory though, so make sure we expand them so. 2021-05-19 Richard Biener <rguenther@suse.de> * cfgexpand.c (discover_nonconstant_array_refs_r): Make sure TARGET_MEM_REF bases are expanded as memory. * tree-ssa-operands.c (operands_scanner::get_tmr_operands): Do not mark TARGET_MEM_REF bases addressable. * tree-ssa.c (non_rewritable_mem_ref_base): Handle TARGET_MEM_REF bases as never rewritable. * gimple-walk.c (walk_stmt_load_store_addr_ops): Do not walk TARGET_MEM_REF bases as address-takens. * tree-ssa-dce.c (ref_may_be_aliased): Handle TARGET_MEM_REF.
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 3e6f7ca..39e5b04 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -6280,10 +6280,12 @@ discover_nonconstant_array_refs_r (tree * tp, int *walk_subtrees,
}
/* References of size POLY_INT_CST to a fixed-size object must go
through memory. It's more efficient to force that here than
- to create temporary slots on the fly. */
- else if ((TREE_CODE (t) == MEM_REF || TREE_CODE (t) == TARGET_MEM_REF)
- && TYPE_SIZE (TREE_TYPE (t))
- && POLY_INT_CST_P (TYPE_SIZE (TREE_TYPE (t))))
+ to create temporary slots on the fly.
+ RTL expansion expectes TARGET_MEM_REF to always address actual memory. */
+ else if (TREE_CODE (t) == TARGET_MEM_REF
+ || (TREE_CODE (t) == MEM_REF
+ && TYPE_SIZE (TREE_TYPE (t))
+ && POLY_INT_CST_P (TYPE_SIZE (TREE_TYPE (t)))))
{
tree base = get_base_address (t);
if (base