summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-29 18:40:02 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-29 18:40:02 +0000
commita3af5975b5865891c212606400b264875a834589 (patch)
tree4b759a379b55a6ac060ab50cf266013f5d5b5c1d /gcc/tree-inline.c
parenta3daa269d7329e597c4677e6ee71ae84ced35777 (diff)
downloadgcc-a3af5975b5865891c212606400b264875a834589.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234530 138bc75d-0d04-0410-961f-82ee72b054a4
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 9d4f8f7815d..5206d202bab 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)