diff options
author | Jason Merrill <jason@redhat.com> | 2013-05-20 17:34:29 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-05-20 17:34:29 -0400 |
commit | 6e5fba0ef6cc1b784f0a11f89e362973e706c602 (patch) | |
tree | 0fd046509989883d5e478782cabdd7021e04f45d /gcc/cp | |
parent | 77f8682b0524f6b534b1da716ee2565757ec7b86 (diff) | |
download | gcc-6e5fba0ef6cc1b784f0a11f89e362973e706c602.zip gcc-6e5fba0ef6cc1b784f0a11f89e362973e706c602.tar.gz gcc-6e5fba0ef6cc1b784f0a11f89e362973e706c602.tar.bz2 |
re PR c++/57102 (ICE: SIGSEGV in fndecl_declared_return_type with -fdump-final-insns=...)
PR c++/57102
* decl.c (fndecl_declared_return_type): Also look in
DECL_SAVED_FUNCTION_DATA.
From-SVN: r199125
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d1e3bb6..27ab94e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-05-20 Jason Merrill <jason@redhat.com> + + PR c++/57102 + * decl.c (fndecl_declared_return_type): Also look in + DECL_SAVED_FUNCTION_DATA. + 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/12288 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a4f686a..c37b4fe 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -14417,10 +14417,15 @@ fndecl_declared_return_type (tree fn) { fn = STRIP_TEMPLATE (fn); if (FNDECL_USED_AUTO (fn)) - return (DECL_STRUCT_FUNCTION (fn)->language - ->x_auto_return_pattern); - else - return TREE_TYPE (TREE_TYPE (fn)); + { + struct language_function *f = NULL; + if (DECL_STRUCT_FUNCTION (fn)) + f = DECL_STRUCT_FUNCTION (fn)->language; + if (f == NULL) + f = DECL_SAVED_FUNCTION_DATA (fn); + return f->x_auto_return_pattern; + } + return TREE_TYPE (TREE_TYPE (fn)); } /* Returns true iff DECL was declared with an auto return type and it has |