diff options
author | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-13 12:19:44 +0000 |
---|---|---|
committer | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-13 12:19:44 +0000 |
commit | 821fafedb525c066a5de5ebf6bcd6c4673671b8a (patch) | |
tree | cb28f64df41b68f189d8be913ddb17f073b17afa /gcc | |
parent | 5413299bd4f99060fa7c3210d5430f075ecc3501 (diff) | |
download | gcc-821fafedb525c066a5de5ebf6bcd6c4673671b8a.tar.gz |
gcc/
Backport from mainline r238086.
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.
gcc/testsuite/
Backport from mainline r238086.
2016-07-07 Ilya Enkovich <ilya.enkovich@intel.com>
PR ipa/71624
* g++.dg/pr71624.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@238295 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/ipa-inline-analysis.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr71624.C | 35 |
4 files changed, 65 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80a760bf896..e9124136b58 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-07-13 Ilya Enkovich <ilya.enkovich@intel.com> + + Backport from mainline r238086. + 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-12 Michael Meissner <meissner@linux.vnet.ibm.com> Bill Schmidt <wschmidt@linux.vnet.ibm.com> diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 824e5a99203..04b4549533a 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -2977,6 +2977,18 @@ 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); for (e = node->callees; e; e = e->next_callee) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc011e3bab4..68bafaf9c8f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2016-07-13 Ilya Enkovich <ilya.enkovich@intel.com> + + Backport from mainline r238086. + 2016-07-07 Ilya Enkovich <ilya.enkovich@intel.com> + + PR ipa/71624 + * g++.dg/pr71624.C: New test. + 2016-07-12 Michael Meissner <meissner@linux.vnet.ibm.com> Bill Schmidt <wschmidt@linux.vnet.ibm.com> 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); +} + |