]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cgraphunit.c
re PR ipa/63587 (ICE : tree check: expected var_decl, have result_decl in add_local_v...
[thirdparty/gcc.git] / gcc / cgraphunit.c
index a86bd1bcd03553babcdaa6ce77a6dbe1709de95c..6f61f5c339ff203fe00c50835c00d96626391b7f 100644 (file)
@@ -1550,7 +1550,9 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
          else if (!is_gimple_reg_type (restype))
            {
              restmp = resdecl;
-             add_local_decl (cfun, restmp);
+
+             if (TREE_CODE (restmp) == VAR_DECL)
+               add_local_decl (cfun, restmp);
              BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
            }
          else