aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2016-03-29 14:40:02 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-03-29 14:40:02 -0400
commite0bffbbb5936be8b6a35d868db4226ca1b2365fa (patch)
tree4b759a379b55a6ac060ab50cf266013f5d5b5c1d /gcc/tree-inline.c
parent3336c6e09385fa50daaa6b7b1bb68908f9a4298f (diff)
downloadgcc-e0bffbbb5936be8b6a35d868db4226ca1b2365fa.zip
gcc-e0bffbbb5936be8b6a35d868db4226ca1b2365fa.tar.gz
gcc-e0bffbbb5936be8b6a35d868db4226ca1b2365fa.tar.bz2
re PR c++/70353 (ICE on __PRETTY_FUNCTION__ in a constexpr function)
PR c++/70353 gcc/ * tree-inline.c (remap_decls): Don't add_local_decl if cfun is null. gcc/cp/ * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics in constexpr functions. From-SVN: r234530
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 9d4f8f7..5206d20 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -616,7 +616,8 @@ remap_decls (tree decls, vec<tree, va_gc> **nonlocalized_list,
/* We need to add this variable to the local decls as otherwise
nothing else will do so. */
if (TREE_CODE (old_var) == VAR_DECL
- && ! DECL_EXTERNAL (old_var))
+ && ! DECL_EXTERNAL (old_var)
+ && cfun)
add_local_decl (cfun, old_var);
if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE)
&& !DECL_IGNORED_P (old_var)