From: Richard Guenther Date: Mon, 10 May 2010 08:55:32 +0000 (+0000) Subject: re PR tree-optimization/44050 (Wrong code is produced with -fipa-pta -fno-tree-pta) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1755aad0945c2f55a23ae98f5f2e19bdce3ed4e7;p=gcc.git re PR tree-optimization/44050 (Wrong code is produced with -fipa-pta -fno-tree-pta) 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. From-SVN: r159214 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76e6ea6931e..07c5dd790bd 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 5ee636f4b6e..3fc716486c9 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 00000000000..931eff6ff2c --- /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 383cc86f243..8e7d1d67614 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. */