From 1b268210a00e886e5d0fd161a86c661c2918e4dc Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 28 Jun 2010 15:51:25 +0000 Subject: [PATCH] PR tree-optimization/44687 * gcc.c-torture/compile/pr44687.c PR tree-optimization/44687 * ipa-split.c (split_function): Use DECL_RESULT to store return value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161500 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/ipa-split.c | 4 +--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr44687.c | 32 +++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr44687.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b4f2d1..5bf683a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Jan Hubicka + + PR tree-optimization/44687 + * ipa-split.c (split_function): Use DECL_RESULT to store return value. + 2010-06-28 Martin Jambor PR c++/44535 diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index ccc89c4..78895d0 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -928,9 +928,7 @@ split_function (struct split_point *split_point) gimple ret; if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl)))) { - retval - = create_tmp_var (TREE_TYPE (TREE_TYPE (current_function_decl)), - "RET"); + retval = DECL_RESULT (current_function_decl); if (is_gimple_reg (retval)) retval = make_ssa_name (retval, call); gimple_call_set_lhs (call, retval); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3326446..d61073a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Jan Hubicka + + PR tree-optimization/44687 + * gcc.c-torture/compile/pr44687.c + 2010-06-28 Martin Jambor PR c++/44535 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44687.c b/gcc/testsuite/gcc.c-torture/compile/pr44687.c new file mode 100644 index 0000000..f59c2ef --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr44687.c @@ -0,0 +1,32 @@ +typedef int int32_t; +typedef unsigned char uint8_t; +struct S0 +{ + uint8_t f0; +}; +struct S0 *g_18[7][5][1][1] = { +}; + +struct S0 **g_17 = &g_18[0][3][0][0]; +int32_t g_86; +struct S0 func_72 (uint8_t p_73, struct S0 p_74); + +void int326 (struct S0 **p_67, int32_t p_68, int32_t * *const p_69, + struct S0 *p_70) +{ + struct S0 l_95 = { + -1L + }; + func_72 (1L, func_72 (0, l_95)); +} + +struct S0 +func_72 (uint8_t p_73, struct S0 p_74) +{ + int32_t *l_85 = &g_86; + if (*l_85) + lbl_94:*l_85 ^= 0; + if (g_86) + goto lbl_94; + return **g_17; +} -- 2.7.4