diff options
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 10 |
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 |