diff options
author | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-07 11:45:11 +0000 |
---|---|---|
committer | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-07 11:45:11 +0000 |
commit | 26716fc717b3965a56b280f6f5f7446153457b0b (patch) | |
tree | ee363588dac70285eea3b1c51b085ed21c71a0a8 | |
parent | 60a48e7d64d1b56c0579d98ebf1072eeaa2c98fc (diff) | |
download | gcc-26716fc717b3965a56b280f6f5f7446153457b0b.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238086 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ipa-inline-analysis.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr71624.C | 35 |
4 files changed, 57 insertions, 0 deletions
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 <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 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 <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 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); +} + |