aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-sra.cc')
-rw-r--r--gcc/tree-sra.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc
index 302b73e..4b6daf7 100644
--- a/gcc/tree-sra.cc
+++ b/gcc/tree-sra.cc
@@ -4205,8 +4205,10 @@ sra_modify_expr (tree *expr, bool write, gimple_stmt_iterator *stmt_gsi,
}
else
{
- gassign *stmt;
+ if (TREE_READONLY (access->base))
+ return false;
+ gassign *stmt;
if (access->grp_partial_lhs)
repl = force_gimple_operand_gsi (stmt_gsi, repl, true,
NULL_TREE, true,