re PR ipa/71624 ([CHKP] internal compiler error: in duplicate_thunk_for_node)
authorIlya Enkovich <ilya.enkovich@intel.com>
Thu, 7 Jul 2016 11:45:11 +0000 (11:45 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 7 Jul 2016 11:45:11 +0000 (11:45 +0000)
gcc/

PR ipa/71624
* ipa-inline-analysis.c (compute_inline_parameters): Set
local.can_change_signature to false for intrumentation
thunk callees.

gcc/testsuite/

PR ipa/71624
* g++.dg/pr71624.C: New test.

From-SVN: r238086

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

index 7cfc92cf97525257970e43c171e1e0a9eae9d34d..75f39de42c049b75b04dcef365a31d9cecd1407f 100644 (file)
@@ -1,3 +1,10 @@
+2016-07-07  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR ipa/71624
+       * ipa-inline-analysis.c (compute_inline_parameters): Set
+       local.can_change_signature to false for intrumentation
+       thunk callees.
+
 2016-07-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * config/arm/arm.h (TARGET_USE_MOVT): Check MOVT/MOVW availability
index 5d6721813d8100eec3a6e3d1bbb5dd633db2003d..da29d2240a4f56dc93647b9222abf147b95f7760 100644 (file)
@@ -3017,6 +3017,16 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
               node->local.can_change_signature = !e;
             }
         }
+       /* Functions called by instrumentation thunk can't change signature
+         because instrumentation thunk modification is not supported.  */
+       if (node->local.can_change_signature)
+        for (e = node->callers; e; e = e->next_caller)
+          if (e->caller->thunk.thunk_p
+              && e->caller->thunk.add_pointer_bounds_args)
+            {
+              node->local.can_change_signature = false;
+              break;
+            }
        estimate_function_body_sizes (node, early);
        pop_cfun ();
      }
index 16eebb6bcb78bf2d65b70cb816bbe156493e0815..f5bf6b137b6bc463d71daf6885ec2f997486a3a7 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-07  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR ipa/71624
+       * g++.dg/pr71624.C: New test.
+
 2016-07-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * lib/target-supports.exp: Generate add_options_for_arm_arch_FUNC and
diff --git a/gcc/testsuite/g++.dg/pr71624.C b/gcc/testsuite/g++.dg/pr71624.C
new file mode 100644 (file)
index 0000000..94a75cd
--- /dev/null
@@ -0,0 +1,35 @@
+/* PR71624 */
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
+
+class c1
+{
+public:
+  virtual int fn1 () const;
+  int fn2 (const int *) const;
+};
+
+class c2
+{
+  int fn1 ();
+  c1 obj;
+};
+
+int
+c1::fn1 () const
+{
+  return 0;
+}
+
+int
+c1::fn2 (const int *) const
+{
+  return this->fn1 ();
+}
+
+int
+c2::fn1 ()
+{
+  return obj.fn2 (0);
+}
+