Makefile.in (final.o): Depend on vecprim.h.

* Makefile.in (final.o): Depend on vecprim.h.
	* final.c: Include vecprim.h.
	(insn_addresses_): Change the type to VEC(int,heap)*.
	* insn-addr.h (INSN_ADDRESSES_DEFN): Remove.
	(INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_SIZE,
	INSN_ADDRESSES_NEW): Use VEC instead of VARRAY.

From-SVN: r120177
This commit is contained in:
Kazu Hirata 2006-12-23 22:10:10 +00:00 committed by Kazu Hirata
parent 8aceba8c95
commit 294340bf91
4 changed files with 48 additions and 24 deletions

View File

@ -4,6 +4,13 @@
* doc/invoke.texi (-fforce-mem): Remove.
* opts.c (common_handle_option): Don't handle OPT_fforce_mem.
* Makefile.in (final.o): Depend on vecprim.h.
* final.c: Include vecprim.h.
(insn_addresses_): Change the type to VEC(int,heap)*.
* insn-addr.h (INSN_ADDRESSES_DEFN): Remove.
(INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_SIZE,
INSN_ADDRESSES_NEW): Use VEC instead of VARRAY.
2006-12-23 Marcin Dalecki <martin@dalecki.de>
* cgraphunit.c (cgraph_optimize): Fixed obvious thinko in memory

View File

@ -2593,7 +2593,7 @@ final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \
except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h tree-pass.h \
$(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \
$(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H)
$(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) vecprim.h
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) toplev.h output.h reload.h \

View File

@ -76,6 +76,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "timevar.h"
#include "cgraph.h"
#include "coverage.h"
#include "vecprim.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" /* Needed for external data
@ -320,7 +321,7 @@ dbr_sequence_length (void)
static int *insn_lengths;
varray_type insn_addresses_;
VEC(int,heap) *insn_addresses_;
/* Max uid for which the above arrays are valid. */
static int insn_lengths_max_uid;

View File

@ -19,32 +19,48 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
#ifndef GCC_INSN_ADDR_H
#define GCC_INSN_ADDR_H
#define GCC_INSN_ADDR_H
#include "varray.h"
#include "vecprim.h"
extern GTY(()) varray_type insn_addresses_;
extern VEC(int,heap) *insn_addresses_;
extern int insn_current_address;
#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_
#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id))
#define INSN_ADDRESSES_ALLOC(size) \
VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses")
#define INSN_ADDRESSES_FREE() (insn_addresses_ = 0)
#define INSN_ADDRESSES(id) (*&(VEC_address (int, insn_addresses_) [id]))
#define INSN_ADDRESSES_ALLOC(size) \
do \
{ \
insn_addresses_ = VEC_alloc (int, heap, size); \
VEC_safe_grow (int, heap, insn_addresses_, size); \
memset (VEC_address (int, insn_addresses_), \
0, sizeof (int) * size); \
} \
while (0)
#define INSN_ADDRESSES_FREE() (VEC_free (int, heap, insn_addresses_))
#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
#define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_)
#define INSN_ADDRESSES_NEW(insn, addr) do \
{ \
unsigned insn_uid__ = INSN_UID ((insn)); \
int insn_addr__ = (addr); \
\
if (INSN_ADDRESSES_SET_P ()) \
{ \
if (INSN_ADDRESSES_SIZE () <= insn_uid__) \
VARRAY_GROW (insn_addresses_, insn_uid__ + 1); \
INSN_ADDRESSES (insn_uid__) = insn_addr__; \
} \
} \
while (0)
#define INSN_ADDRESSES_SIZE() (VEC_length (int, insn_addresses_))
static inline void
insn_addresses_new (rtx insn, int insn_addr)
{
unsigned insn_uid = INSN_UID ((insn));
if (INSN_ADDRESSES_SET_P ())
{
size_t size = INSN_ADDRESSES_SIZE ();
if (size <= insn_uid)
{
int *p;
VEC_safe_grow (int, heap, insn_addresses_, insn_uid + 1);
p = VEC_address (int, insn_addresses_);
memset (&p[size],
0, sizeof (int) * (insn_uid + 1 - size));
}
INSN_ADDRESSES (insn_uid) = insn_addr;
}
}
#define INSN_ADDRESSES_NEW(insn, addr) \
(insn_addresses_new (insn, addr))
#endif /* ! GCC_INSN_ADDR_H */