diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-01-16 12:12:53 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-01-16 12:12:53 +0100 |
commit | 90dda0e9563ec83ddbf59bc8fce9f1c1c9d1a55b (patch) | |
tree | 51a01f146db9cdfa99ce7cd9516901ce6c7b78ba | |
parent | 12e3ff92d4c1fbcfc3150895be2567e4e97806f0 (diff) | |
download | gcc-90dda0e9563ec83ddbf59bc8fce9f1c1c9d1a55b.zip gcc-90dda0e9563ec83ddbf59bc8fce9f1c1c9d1a55b.tar.gz gcc-90dda0e9563ec83ddbf59bc8fce9f1c1c9d1a55b.tar.bz2 |
re PR tree-optimization/51865 (ICE in insert_vi_for_tree, at tree-ssa-structalias.c:2642)
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.
From-SVN: r183207
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr51865.c | 25 | ||||
-rw-r--r-- | gcc/tree-inline.c | 8 |
4 files changed, 40 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67c69aa..de68959 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-01-16 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/51865 + * tree-inline.c (tree_function_versioning): Call remap_decl + on DECL_RESULT whenever it has VOID_TYPE_P type. + 2012-01-15 Richard Sandiford <rdsandiford@googlemail.com> * config/mips/mips.c (mips16_build_call_stub): Don't use a stub diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b5d9828..07e452c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-01-16 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/51865 + * gcc.dg/pr51865.c: New test. + 2012-01-15 Richard Sandiford <rdsandiford@googlemail.com> * gcc.dg/tree-ssa/ssa-dom-thread-4.c: Expect 4 threaded edges for MIPS. diff --git a/gcc/testsuite/gcc.dg/pr51865.c b/gcc/testsuite/gcc.dg/pr51865.c new file mode 100644 index 0000000..9b4595c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr51865.c @@ -0,0 +1,25 @@ +/* PR tree-optimization/51865 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fipa-pta" } */ + +void fn (const char *, const char *) __attribute__ ((__noreturn__)); +int var; + +inline void +foo (void) +{ + if (__builtin_expect (var != 0, 0)) + fn ("a", "b"); +}; + +void +bar (void) +{ + foo (); +}; + +void +baz (void) +{ + foo (); +}; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index a039890..ae773f6 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)), |