+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.
{
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;
}
+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.
--- /dev/null
+/* { 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 ();
+}
+