From: hubicka Date: Fri, 30 Jun 2017 21:09:13 +0000 (+0000) Subject: PR ipa/81261 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47fd39b30bbca1d103bfa5d6f7f5e2c35f76102c;p=thirdparty%2Fgcc.git PR ipa/81261 * tree-inline.c (expand_call_inline): Combine profile statuses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249856 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 73a0555d4327..4da9e3f147fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-06-29 Jan Hubicka + + PR ipa/81261 + * tree-inline.c (expand_call_inline): Combine profile statuses. + 2017-06-30 Andrew Pinski * tree-if-conv.c (predicate_scalar_phi): Update new_stmt if diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0331735cae05..73ef3a0262dc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-06-29 Jan Hubicka + + PR ipa/81261 + * g++.dg/ipa/pr81261.C: New testcase. + 2017-06-30 Andrew Pinski * gcc.dg/torture/pr81245.c: New testcase. diff --git a/gcc/testsuite/g++.dg/ipa/pr81261.C b/gcc/testsuite/g++.dg/ipa/pr81261.C new file mode 100644 index 000000000000..f182eb152cd5 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr81261.C @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fno-guess-branch-probability" } */ + +struct CBase { + virtual void BaseFunc () {} +}; + +struct MMixin { + virtual void * MixinFunc (int, void *) = 0; +}; + +struct CExample: CBase, public MMixin +{ + void *MixinFunc (int arg, void *arg2) + { + if (arg != 1 || arg2) + return 0; + return this; + } +}; + +void *test (MMixin & anExample) +{ + return anExample.MixinFunc (1, 0); +} + +int main () +{ + CExample c; + return (test (c) != &c); +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 9306c3fbdf79..d4e4ef172479 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4650,6 +4650,9 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) else id->dst_simt_vars = NULL; + if (profile_status_for_fn (id->src_cfun) == PROFILE_ABSENT) + profile_status_for_fn (dst_cfun) = PROFILE_ABSENT; + /* If the src function contains an IFN_VA_ARG, then so will the dst function after inlining. Likewise for IFN_GOMP_USE_SIMT. */ prop_mask = PROP_gimple_lva | PROP_gimple_lomp_dev;