diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-07 05:49:18 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-07 05:49:18 +0000 |
commit | 7014838cdd847f5d22f8b4bff0285ad622b707b5 (patch) | |
tree | f1a67b6ea75a7f0da3f06e0a1c60b213f4403168 /gcc/rtl.c | |
parent | 713829e97b2cabe9369424002f6efb23a7c86aba (diff) | |
download | gcc-7014838cdd847f5d22f8b4bff0285ad622b707b5.tar.gz |
Merge in gcc2-ss-010999
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r-- | gcc/rtl.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c index db28096ac65..1c5bf6db4cb 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -1,5 +1,6 @@ /* Allocate and read RTL for GNU C Compiler. - Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999 + Free Software Foundation, Inc. This file is part of GNU CC. @@ -309,6 +310,41 @@ rtx_alloc (code) return rt; } +/* Like the above, but allocate based only on the length. This is called + by the routines built into genrtl.c. */ + +rtx +obstack_alloc_rtx (length) + int length; +{ + rtx rt; + register struct obstack *ob = rtl_obstack; + + /* This function is called more than any other in GCC, + so we manipulate the obstack directly. + + Even though rtx objects are word aligned, we may be sharing an obstack + with tree nodes, which may have to be double-word aligned. So align + our length to the alignment mask in the obstack. */ + + length = (length + ob->alignment_mask) & ~ ob->alignment_mask; + + if (ob->chunk_limit - ob->next_free < length) + _obstack_newchunk (ob, length); + + rt = (rtx) ob->object_base; + ob->next_free += length; + ob->object_base = ob->next_free; + + /* We want to clear everything up to the FLD array. Normally, + this is one int, but we don't want to assume that and it + isn't very portable anyway; this is. */ + + memset (rt, 0, sizeof (struct rtx_def) - sizeof (rtunion)); + + return rt; +} + /* Free the rtx X and all RTL allocated since X. */ void |