diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-16 11:12:53 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-16 11:12:53 +0000 |
commit | 0c41699c6a18397ff6d846319b93682e9bd9ad14 (patch) | |
tree | 51a01f146db9cdfa99ce7cd9516901ce6c7b78ba /gcc/tree-inline.c | |
parent | eaee924e3666c9a74a7e18266d286e6ce43b3753 (diff) | |
download | gcc-0c41699c6a18397ff6d846319b93682e9bd9ad14.tar.gz |
PR tree-optimization/51865
* tree-inline.c (tree_function_versioning): Call remap_decl
on DECL_RESULT whenever it has VOID_TYPE_P type.
* gcc.dg/pr51865.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183207 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index a0398903834..ae773f63b58 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1,6 +1,6 @@ /* Tree inlining. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, + 2012 Free Software Foundation, Inc. Contributed by Alexandre Oliva <aoliva@redhat.com> This file is part of GCC. @@ -5201,9 +5201,9 @@ tree_function_versioning (tree old_decl, tree new_decl, /* Add local vars. */ add_local_variables (DECL_STRUCT_FUNCTION (old_decl), cfun, &id, false); - if (VOID_TYPE_P (TREE_TYPE (DECL_RESULT (old_decl)))) + if (DECL_RESULT (old_decl) == NULL_TREE) ; - else if (skip_return) + else if (skip_return && !VOID_TYPE_P (TREE_TYPE (DECL_RESULT (old_decl)))) { DECL_RESULT (new_decl) = build_decl (DECL_SOURCE_LOCATION (DECL_RESULT (old_decl)), |