aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2021-10-25 15:22:06 +0200
committerMartin Jambor <mjambor@suse.cz>2021-10-25 15:26:39 +0200
commitf217e87972a2a207e793101fc05cfc9dd095c678 (patch)
tree3933cabec5e41954faf44aacaaaa95c508c2ea12 /gcc
parent7518e4c2f0758daac5d650d400565cf49ac3c8c5 (diff)
downloadgcc-f217e87972a2a207e793101fc05cfc9dd095c678.zip
gcc-f217e87972a2a207e793101fc05cfc9dd095c678.tar.gz
gcc-f217e87972a2a207e793101fc05cfc9dd095c678.tar.bz2
sra: Fix the fix for PR 102505 (PR 102886)
I was not careful with the fix for PR 102505 and did not craft the check to satisfy the verifier carefully, which lead to PR 102886. (The verifier has the test structured differently and somewhat redundantly, so I could not just copy it). This patch fixes it. I hope it is quite obvious correction of an oversight and so will commit it if survives bootstrap and testing on x86_64-linux and ppc64le-linux. Testcase for this bug is gcc.dg/tree-ssa/sra-18.c (but only on platforms with constant pools). I will backport the two fixes to the release branches squashed. gcc/ChangeLog: 2021-10-22 Martin Jambor <mjambor@suse.cz> PR tree-optimization/102886 * tree-sra.c (totally_scalarize_subtree): Fix the out of access-condition.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-sra.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index f561e1a..76e3aae 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3288,7 +3288,7 @@ totally_scalarize_subtree (struct access *root)
continue;
HOST_WIDE_INT pos = root->offset + int_bit_position (fld);
- if (pos + fsize > root->size)
+ if (pos + fsize > root->offset + root->size)
return false;
enum total_sra_field_state
state = total_should_skip_creating_access (root,