ipa-comdats.c (ipa_comdats): Visit all thunks to set proper comdat group.
authorIlya Enkovich <ilya.enkovich@intel.com>
Tue, 7 Apr 2015 14:06:38 +0000 (14:06 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Tue, 7 Apr 2015 14:06:38 +0000 (14:06 +0000)
gcc/

* ipa-comdats.c (ipa_comdats): Visit all thunks
to set proper comdat group.

gcc/testsuite/

* gcc.target/i386/mpx/chkp-thunk-comdat-1.cc: New.
* gcc.target/i386/mpx/chkp-thunk-comdat-2.cc: New.

From-SVN: r221896

gcc/ChangeLog
gcc/ipa-comdats.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc [new file with mode: 0644]

index f65dd4d1e76f245ed7c10df53774090a3f8a46f5..7b977dd8933e23e7d410923abd995d2b20c785ce 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-07  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       * ipa-comdats.c (ipa_comdats): Visit all thunks
+       to set proper comdat group.
+
 2015-04-07  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/65489
index f349f9f087ec61604e0493d45babd34b8e2d8a89..e24359cff19a19217206cd7f2c682f6a79ee331e 100644 (file)
@@ -377,7 +377,7 @@ ipa_comdats (void)
              fprintf (dump_file, "To group: %s\n", IDENTIFIER_POINTER (group));
            }
          if (is_a <cgraph_node *> (symbol))
-          dyn_cast <cgraph_node *>(symbol)->call_for_symbol_and_aliases
+          dyn_cast <cgraph_node *>(symbol)->call_for_symbol_thunks_and_aliases
                  (set_comdat_group_1,
                   *comdat_head_map.get (group),
                   true);
index 7684dbc1b3aef066a13266c3b8c2f402ce481f5b..a51b9c56abb74d34dd5669c0e1bb487c731b7427 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-07  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       * gcc.target/i386/mpx/chkp-thunk-comdat-1.cc: New.
+       * gcc.target/i386/mpx/chkp-thunk-comdat-2.cc: New.
+
 2015-04-07  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.target/arm/pr65647.c: Add option "-mfloat-abi=soft".
diff --git a/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-1.cc
new file mode 100644 (file)
index 0000000..26d3c48
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */
+
+namespace
+{
+  template <int dim>
+  int __attribute__((noinline))
+  f1 ()
+  {
+    return dim;
+  }
+}
+
+int
+test ()
+{
+  return f1<3> ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc b/gcc/testsuite/gcc.target/i386/mpx/chkp-thunk-comdat-2.cc
new file mode 100644 (file)
index 0000000..2b1abe9
--- /dev/null
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */
+
+class c1
+{
+public:
+  virtual int test1 (const char *);
+};
+
+class c2
+{
+public:
+  int test2 (const char *);
+};
+
+int
+c1::test1 (const char *)
+{
+  return 0;
+}
+
+int
+c2::test2 (const char *)
+{
+  return 0;
+}