(grokparms): Copy arg type list to savable obstack if nec.
authorRichard Stallman <rms@gnu.org>
Mon, 7 Sep 1992 06:08:44 +0000 (06:08 +0000)
committerRichard Stallman <rms@gnu.org>
Mon, 7 Sep 1992 06:08:44 +0000 (06:08 +0000)
From-SVN: r2071

gcc/c-decl.c

index 936b8eacfb5c393e3ca5022f7af257f0f7c3fa5a..fb925045921b1ef032c1e4672d1f92f395b5bdc6 100644 (file)
@@ -4438,7 +4438,20 @@ grokparms (parms_info, funcdef_flag)
              typelt = TREE_CHAIN (typelt);
            }
 
-      return first_parm;
+      /* Allocate the list of types the way we allocate a type.  */
+      if (allocation_temporary_p ())
+       {
+         /* Construct a copy of the list of types
+            on the saveable obstack.  */
+         tree result = NULL;
+         for (typelt = first_parm; typelt; typelt = TREE_CHAIN (typelt))
+           result = saveable_tree_cons (NULL_TREE, TREE_VALUE (typelt),
+                                        result);
+         return nreverse (result);
+       }
+      else
+       /* The list we have is permanent already.  */
+       return first_parm;
     }
 }