diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-11-29 19:53:50 -0500 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-11-29 20:01:08 -0500 |
commit | ab202b659dbdfd3a1f45ffe7a5052f35b5e8fa6d (patch) | |
tree | db705fc38c2a002474fa797b1cb9d7c412c0447d /gcc | |
parent | 87cd82c81d388530f67dbd73478c00846fb99a64 (diff) | |
download | gcc-ab202b659dbdfd3a1f45ffe7a5052f35b5e8fa6d.zip gcc-ab202b659dbdfd3a1f45ffe7a5052f35b5e8fa6d.tar.gz gcc-ab202b659dbdfd3a1f45ffe7a5052f35b5e8fa6d.tar.bz2 |
Don't reuse reference after potential resize.
When a new def chain is requested, any existing reference may no longer
be valid, so just use the object directly.
PR tree-optimization/103467
* gimple-range-gori.cc (range_def_chain::register_dependency): Don't
use an object reference after a potential resize.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple-range-gori.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 911d7ac..0dba34b 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -278,11 +278,12 @@ range_def_chain::register_dependency (tree name, tree dep, basic_block bb) { // Get the def chain for the operand. b = get_def_chain (dep); - // If there was one, copy it into result. + // If there was one, copy it into result. Access def_chain directly + // as the get_def_chain request above could reallocate the vector. if (b) - bitmap_ior_into (src.bm, b); + bitmap_ior_into (m_def_chain[v].bm, b); // And copy the import list. - set_import (src, NULL_TREE, get_imports (dep)); + set_import (m_def_chain[v], NULL_TREE, get_imports (dep)); } else // Originated outside the block, so it is an import. |