diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2014-12-09 07:53:17 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2014-12-09 07:53:17 +0000 |
commit | 227eabce47178c49601a13b801cca57d41494b8f (patch) | |
tree | e3864d7dab150c66d4ff4cffb2ce74db44e62027 /gcc/tree-chkp.c | |
parent | f9ea9950e0d2b51c94497d0011aa7718c41fbd2d (diff) | |
download | gcc-227eabce47178c49601a13b801cca57d41494b8f.zip gcc-227eabce47178c49601a13b801cca57d41494b8f.tar.gz gcc-227eabce47178c49601a13b801cca57d41494b8f.tar.bz2 |
re PR bootstrap/63995 (Bootstrap error with -mmpx -fcheck-pointer-bounds)
gcc/
PR bootstrap/63995
* tree-chkp.c (chkp_make_static_bounds): Share bounds var
between nodes sharing assembler name.
gcc/testsuite/
PR bootstrap/63995
* g++.dg/dg.exp: Add mpx-dg.exp.
* g++.dg/pr63995-1.C: New.
From-SVN: r218506
Diffstat (limited to 'gcc/tree-chkp.c')
-rw-r--r-- | gcc/tree-chkp.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index c24aa35..e7b9bbf 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -2760,9 +2760,23 @@ chkp_make_static_bounds (tree obj) /* First check if we already have required var. */ if (chkp_static_var_bounds) { - slot = chkp_static_var_bounds->get (obj); - if (slot) - return *slot; + /* For vars we use assembler name as a key in + chkp_static_var_bounds map. It allows to + avoid duplicating bound vars for decls + sharing assembler name. */ + if (TREE_CODE (obj) == VAR_DECL) + { + tree name = DECL_ASSEMBLER_NAME (obj); + slot = chkp_static_var_bounds->get (name); + if (slot) + return *slot; + } + else + { + slot = chkp_static_var_bounds->get (obj); + if (slot) + return *slot; + } } /* Build decl for bounds var. */ @@ -2826,7 +2840,13 @@ chkp_make_static_bounds (tree obj) if (!chkp_static_var_bounds) chkp_static_var_bounds = new hash_map<tree, tree>; - chkp_static_var_bounds->put (obj, bnd_var); + if (TREE_CODE (obj) == VAR_DECL) + { + tree name = DECL_ASSEMBLER_NAME (obj); + chkp_static_var_bounds->put (name, bnd_var); + } + else + chkp_static_var_bounds->put (obj, bnd_var); return bnd_var; } |