Commit 227eabce by Ilya Enkovich Committed by Ilya Enkovich

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
parent f9ea9950
2014-12-09 Ilya Enkovich <ilya.enkovich@intel.com>
PR bootstrap/63995
* tree-chkp.c (chkp_make_static_bounds): Share bounds var
between nodes sharing assembler name.
2014-12-08 Michael Meissner <meissner@linux.vnet.ibm.com> 2014-12-08 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/64204 PR target/64204
2014-12-09 Ilya Enkovich <ilya.enkovich@intel.com>
PR bootstrap/63995
* g++.dg/dg.exp: Add mpx-dg.exp.
* g++.dg/pr63995-1.C: New.
2014-12-08 Sandra Loosemore <sandra@codesourcery.com> 2014-12-08 Sandra Loosemore <sandra@codesourcery.com>
* gcc.target/aarch64/bics_4.c: New. * gcc.target/aarch64/bics_4.c: New.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# Load support procs. # Load support procs.
load_lib g++-dg.exp load_lib g++-dg.exp
load_lib mpx-dg.exp
# If a testcase doesn't have special options, use these. # If a testcase doesn't have special options, use these.
global DEFAULT_CXXFLAGS global DEFAULT_CXXFLAGS
......
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-require-effective-target mpx } */
/* { dg-options "-O2 -g -fcheck-pointer-bounds -mmpx" } */
int test1 (int i)
{
extern const int arr[10];
return arr[i];
}
extern const int arr[10];
int test2 (int i)
{
return arr[i];
}
...@@ -2760,9 +2760,23 @@ chkp_make_static_bounds (tree obj) ...@@ -2760,9 +2760,23 @@ chkp_make_static_bounds (tree obj)
/* First check if we already have required var. */ /* First check if we already have required var. */
if (chkp_static_var_bounds) if (chkp_static_var_bounds)
{ {
slot = chkp_static_var_bounds->get (obj); /* For vars we use assembler name as a key in
if (slot) chkp_static_var_bounds map. It allows to
return *slot; 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. */ /* Build decl for bounds var. */
...@@ -2826,7 +2840,13 @@ chkp_make_static_bounds (tree obj) ...@@ -2826,7 +2840,13 @@ chkp_make_static_bounds (tree obj)
if (!chkp_static_var_bounds) if (!chkp_static_var_bounds)
chkp_static_var_bounds = new hash_map<tree, tree>; 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; return bnd_var;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment