From: rguenth Date: Mon, 10 May 2010 08:55:32 +0000 (+0000) Subject: 2010-05-10 Richard Guenther X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3912327b9151d79abcb95a324185c179f75d93ef;p=thirdparty%2Fgcc.git 2010-05-10 Richard Guenther PR tree-optimization/44050 * tree-inline.c (tree_function_versioning): Clone the ipa-pta flag. * gcc.dg/torture/pr44050.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159214 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76e6ea6931e2..07c5dd790bd6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-05-10 Richard Guenther + + PR tree-optimization/44050 + * tree-inline.c (tree_function_versioning): Clone the ipa-pta + flag. + 2010-05-10 Wei Guozhi PR target/42879 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5ee636f4b6ec..3fc716486c90 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-05-10 Richard Guenther + + PR tree-optimization/44050 + * gcc.dg/torture/pr44050.c: New testcase. + 2010-05-10 Wei Guozhi PR target/42879 diff --git a/gcc/testsuite/gcc.dg/torture/pr44050.c b/gcc/testsuite/gcc.dg/torture/pr44050.c new file mode 100644 index 000000000000..931eff6ff2c2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr44050.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-fno-tree-pta" } */ + +static void __attribute__((noinline)) +foo (int *i, int n) +{ + *i = n; +} + +int +main (void) +{ + int i = 0; + foo (&i, 1); + + if (i != 1) + __builtin_abort (); + + return 0; +} + diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 383cc86f2437..8e7d1d676143 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4924,6 +4924,8 @@ tree_function_versioning (tree old_decl, tree new_decl, (DECL_STRUCT_FUNCTION (old_decl)); initialize_cfun (new_decl, old_decl, old_entry_block->count); + DECL_STRUCT_FUNCTION (new_decl)->gimple_df->ipa_pta + = id.src_cfun->gimple_df->ipa_pta; push_cfun (DECL_STRUCT_FUNCTION (new_decl)); /* Copy the function's static chain. */