diff options
author | Martin Jambor <mjambor@suse.cz> | 2020-02-14 15:02:35 +0100 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2020-02-14 15:02:35 +0100 |
commit | 515dd04260c6049110d7624eaf1b276929dcd9af (patch) | |
tree | e62aa998fdbd5b7def31b1bcabc6970603962821 /gcc/cp/class.c | |
parent | 5a8754323d67011f7dceb5c8b82c4a5b48f0de4d (diff) | |
download | gcc-515dd04260c6049110d7624eaf1b276929dcd9af.zip gcc-515dd04260c6049110d7624eaf1b276929dcd9af.tar.gz gcc-515dd04260c6049110d7624eaf1b276929dcd9af.tar.bz2 |
sra: Avoid verification failure (PR 93516)
get_ref_base_and_extent can return different sizes for COMPONENT_REFs
and DECLs of the same type, with the latter including (more?) padding.
When in the IL there is an assignment between such a COMPONENT_REF and a
DECL, SRA will try to propagate the access from the former as a child of
the latter, creating an artificial reference that does not match the
access's declared size, which triggers a verifier assert.
Fixed by teaching the propagation functions about this special situation
so that they don't do it. The condition is the same that
build_user_friendly_ref_for_offset uses so the artificial reference
causing the verifier is guaranteed not to be created.
2020-02-14 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/93516
* tree-sra.c (propagate_subaccesses_from_rhs): Do not create
access of the same type as the parent.
(propagate_subaccesses_from_lhs): Likewise.
gcc/testsuite/
* g++.dg/tree-ssa/pr93516.C: New test.
Diffstat (limited to 'gcc/cp/class.c')
0 files changed, 0 insertions, 0 deletions