From: Ilya Enkovich Date: Thu, 7 Jul 2016 11:45:11 +0000 (+0000) Subject: re PR ipa/71624 ([CHKP] internal compiler error: in duplicate_thunk_for_node) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=275792f2ebb69bc081c4ea764c75ddfd565f640c;p=gcc.git re PR ipa/71624 ([CHKP] internal compiler error: in duplicate_thunk_for_node) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7cfc92cf975..75f39de42c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-07-07 Ilya Enkovich + + 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 * config/arm/arm.h (TARGET_USE_MOVT): Check MOVT/MOVW availability diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 5d6721813d8..da29d2240a4 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -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 (); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 16eebb6bcb7..f5bf6b137b6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-07 Ilya Enkovich + + PR ipa/71624 + * g++.dg/pr71624.C: New test. + 2016-07-07 Thomas Preud'homme * 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 index 00000000000..94a75cd4c41 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr71624.C @@ -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); +} +