aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2021-10-21 14:26:45 +0200
committerMartin Jambor <mjambor@suse.cz>2021-10-21 14:55:14 +0200
commit701ee067807b80957c65bd7ff94b6099a27181de (patch)
treeae76e3e3c9e53974d5a79a43dbad25e08a7d0839 /gcc/toplev.c
parentd6a3c0cfb852dbeee4255e3588e9a1f52e376042 (diff)
downloadgcc-701ee067807b80957c65bd7ff94b6099a27181de.zip
gcc-701ee067807b80957c65bd7ff94b6099a27181de.tar.gz
gcc-701ee067807b80957c65bd7ff94b6099a27181de.tar.bz2
sra: Fix corner case of total scalarization with virtual inheritance (PR 102505)
PR 102505 is a situation where of SRA takes its initial top-level access size from a get_ref_base_and_extent called on a COMPONENT_REF, and thus derived frm the FIELD_DECL, which however does not include a virtual base. Total scalarization then goes on traversing the type, which however has virtual base past the non-virtual bits, tricking SRA to create sub-accesses outside of the supposedly encompassing accesses, which in turn triggers the verifier within the pass. The patch below fixes that by failing total scalarization when this situation is detected. gcc/ChangeLog: 2021-10-20 Martin Jambor <mjambor@suse.cz> PR tree-optimization/102505 * tree-sra.c (totally_scalarize_subtree): Check that the encountered field fits within the acces we would like to put it in. gcc/testsuite/ChangeLog: 2021-10-20 Martin Jambor <mjambor@suse.cz> PR tree-optimization/102505 * g++.dg/torture/pr102505.C: New test.
Diffstat (limited to 'gcc/toplev.c')
0 files changed, 0 insertions, 0 deletions