diff options
author | Martin Jambor <mjambor@suse.cz> | 2020-02-21 13:38:22 +0100 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2020-02-21 13:40:50 +0100 |
commit | 4d6bf96b583d77336cf6ca643d92d068a88414fa (patch) | |
tree | c8bf9c21ac1ed551e1f2e528899028a17f673130 /gcc/tree-sra.c | |
parent | 3abfd4f3410af27060a11b8adaa9836d5a77eae1 (diff) | |
download | gcc-4d6bf96b583d77336cf6ca643d92d068a88414fa.zip gcc-4d6bf96b583d77336cf6ca643d92d068a88414fa.tar.gz gcc-4d6bf96b583d77336cf6ca643d92d068a88414fa.tar.bz2 |
sra: Only verify sizes of scalar accesses (PR 93845)
the testcase is another example - in addition to recent PR 93516 - where
the SRA access verifier is confused by the fact that get_ref_base_extent
can return different sizes for the same type, depending whether they are
COMPONENT_REF or not. In the previous bug I decided to keep the
verifier check for aggregate type even though it is not really important
and instead avoid easily detectable type-within-the-same-type situation.
This testcase is however a result of a fairly random looking type cast
and so cannot be handled in the same way.
Because the check is not really important for aggregates, this patch
simply disables it for non-register types.
2020-02-21 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/93845
* tree-sra.c (verify_sra_access_forest): Only test access size of
scalar types.
testsuite/
* g++.dg/tree-ssa/pr93845.C: New test.
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 49f9001..5561ea6 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -2355,7 +2355,8 @@ verify_sra_access_forest (struct access *root) gcc_assert (offset == access->offset); gcc_assert (access->grp_unscalarizable_region || size == max_size); - gcc_assert (max_size == access->size); + gcc_assert (!is_gimple_reg_type (access->type) + || max_size == access->size); gcc_assert (reverse == access->reverse); if (access->first_child) |