diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2015-04-08 13:45:20 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-04-08 13:45:20 +0000 |
commit | 930ee1165d793b5bcfa7284f3b4b69d10f267287 (patch) | |
tree | 018962a41f39c27ff33d256772fc4df8e1fdf43d /gcc | |
parent | 47eec99462546f6555846afec5d3bf15e0469776 (diff) | |
download | gcc-930ee1165d793b5bcfa7284f3b4b69d10f267287.zip gcc-930ee1165d793b5bcfa7284f3b4b69d10f267287.tar.gz gcc-930ee1165d793b5bcfa7284f3b4b69d10f267287.tar.bz2 |
ipa-comdats.c (propagate_comdat_group): Walk through thunks.
gcc/
* ipa-comdats.c (propagate_comdat_group): Walk through thunks.
gcc/testsuite/
* gcc.target/i386/mpx/chkp-thunk-comdat-3.c: New.
From-SVN: r221919
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ipa-comdats.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-3.c | 23 |
4 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a06ed80..08d4342 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-04-08 Ilya Enkovich <ilya.enkovich@intel.com> + + * ipa-comdats.c (propagate_comdat_group): Walk through thunks. + 2015-04-08 Gerald Pfeifer <gerald@pfeifer.com> * doc/install.texi (bootstrap-lto-noplugin): Rewrite. diff --git a/gcc/ipa-comdats.c b/gcc/ipa-comdats.c index e24359c..3e6fc1d0 100644 --- a/gcc/ipa-comdats.c +++ b/gcc/ipa-comdats.c @@ -142,12 +142,14 @@ propagate_comdat_group (struct symtab_node *symbol, { struct symtab_node *symbol2 = edge->caller; - /* If we see inline clone, its comdat group actually - corresponds to the comdat group of the function it is inlined - to. */ - if (cgraph_node * cn = dyn_cast <cgraph_node *> (symbol2)) { + /* Thunks can not call across section boundary. */ + if (cn->thunk.thunk_p) + newgroup = propagate_comdat_group (symbol2, newgroup, map); + /* If we see inline clone, its comdat group actually + corresponds to the comdat group of the function it + is inlined to. */ if (cn->global.inlined_to) symbol2 = cn->global.inlined_to; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c926f3d..f3b61e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2015-04-08 Ilya Enkovich <ilya.enkovich@intel.com> + * gcc.target/i386/mpx/chkp-thunk-comdat-3.c: New. + +2015-04-08 Ilya Enkovich <ilya.enkovich@intel.com> + * gcc/testsuite/gcc.target/i386/thunk-retbnd.c: New. 2015-04-08 Eric Botcazou <ebotcazou@adacore.com> diff --git a/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-3.c b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-3.c new file mode 100644 index 0000000..dd0057e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-3.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -O -fvisibility=hidden" } */ + +int val; + +static int __attribute__((noinline)) +test1 () +{ + return val; +} + +static int __attribute__((bnd_legacy,noinline)) +test2 () +{ + return test1 (); +} + +int +test3 (void) +{ + return test2 (); +} + |