re PR ipa/71633 ([CHKP] internal compiler error: in inline_call)
authorIlya Enkovich <ilya.enkovich@intel.com>
Wed, 13 Jul 2016 11:02:15 +0000 (11:02 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Wed, 13 Jul 2016 11:02:15 +0000 (11:02 +0000)
gcc/

PR ipa/71633
* ipa-inline-transform.c (inline_call): Support
instrumented thunks.

gcc/testsuite/

PR ipa/71633
* g++.dg/pr71633.C: New test.

From-SVN: r238290

gcc/ChangeLog
gcc/ipa-inline-transform.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr71633.C [new file with mode: 0644]

index f05d2b1924612bf01d43ecdb7a328db3e303a834..03dac3322bdf280f5a255c2f215cb5a82bb8e750 100644 (file)
@@ -1,3 +1,9 @@
+2016-07-13  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR ipa/71633
+       * ipa-inline-transform.c (inline_call): Support
+       instrumented thunks.
+
 2016-07-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * config/arm/arm.h (TARGET_HAVE_CBZ): Define.
index 9ac1efc91920d66d64f5ddd4898fa048836a7bc4..98c7f96fbb69e4f8d401062493284f20ad1dc43e 100644 (file)
@@ -319,10 +319,14 @@ inline_call (struct cgraph_edge *e, bool update_original,
     to = to->global.inlined_to;
   if (to->thunk.thunk_p)
     {
+      struct cgraph_node *target = to->callees->callee;
       if (in_lto_p)
        to->get_untransformed_body ();
       to->expand_thunk (false, true);
-      e = to->callees;
+      /* When thunk is instrumented we may have multiple callees.  */
+      for (e = to->callees; e && e->callee != target; e = e->next_callee)
+       ;
+      gcc_assert (e);
     }
 
 
index 239d55e7458c9d01653b54441c27e81810b92b62..c21469b6b94688be0bcd0d3d2998540fa4ad9213 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-13  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR ipa/71633
+       * g++.dg/pr71633.C: New test.
+
 2016-07-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * lib/target-supports.exp (check_effective_target_arm_thumb1_cbz_ok):
diff --git a/gcc/testsuite/g++.dg/pr71633.C b/gcc/testsuite/g++.dg/pr71633.C
new file mode 100644 (file)
index 0000000..bb69bbb
--- /dev/null
@@ -0,0 +1,28 @@
+/* PR71633 */
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
+
+class c1
+{
+  virtual void fn1 ();
+};
+
+class c2
+{
+  virtual int *fn2 () const;
+};
+
+class c3 : c1, c2
+{
+  int *fn2 () const;
+  int *fn3 (int) const;
+};
+
+int *c3::fn2 () const
+{
+}
+
+int *c3::fn3 (int p) const
+{
+  return fn3 (p);
+}