Commit 46c5ad27 by Andreas Jaeger Committed by Andreas Jaeger

sbitmap.c: Convert prototypes to ISO C90.

	* sbitmap.c: Convert prototypes to ISO C90.
	* sbitmap.h: Likewise.
	* scan-decls.c: Likewise.
	* scan.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-rgn.c: Likewise.
	* sched-vis.c: Likewise.
	* sibcall.c: Likewise.
	* simplify-rtx.c: Likewise.
	* sreal.c: Likewise.
	* sreal.h: Likewise.
	* ssa-ccp.c: Likewise.
	* ssa-dce.c: Likewise.
	* ssa.c: Likewise.
	* ssa.h: Likewise.
	* stack.h: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* stringpool.c: Likewise.
	* target.h: Likewise.
	* timevar.c: Likewise.
	* timevar.h: Likewise.
	* tlink.c: Likewise.
	* tracer.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.

From-SVN: r69002
parent 6623b2f2
...@@ -67,6 +67,36 @@ ...@@ -67,6 +67,36 @@
* rtl.c: Likewise. * rtl.c: Likewise.
* rtl.h: Likewise. * rtl.h: Likewise.
* rtlanal.c: Likewise. * rtlanal.c: Likewise.
* sbitmap.c: Likewise.
* sbitmap.h: Likewise.
* scan-decls.c: Likewise.
* scan.c: Likewise.
* sched-deps.c: Likewise.
* sched-ebb.c: Likewise.
* sched-int.h: Likewise.
* sched-rgn.c: Likewise.
* sched-vis.c: Likewise.
* sibcall.c: Likewise.
* simplify-rtx.c: Likewise.
* sreal.c: Likewise.
* sreal.h: Likewise.
* ssa-ccp.c: Likewise.
* ssa-dce.c: Likewise.
* ssa.c: Likewise.
* ssa.h: Likewise.
* stack.h: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* stringpool.c: Likewise.
* target.h: Likewise.
* timevar.c: Likewise.
* timevar.h: Likewise.
* tlink.c: Likewise.
* tracer.c: Likewise.
* tree-inline.c: Likewise.
* tree-inline.h: Likewise.
* tree.c: Likewise.
* tree.h: Likewise.
2003-07-05 Kazu Hirata <kazu@cs.umass.edu> 2003-07-05 Kazu Hirata <kazu@cs.umass.edu>
......
...@@ -32,8 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -32,8 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Allocate a simple bitmap of N_ELMS bits. */ /* Allocate a simple bitmap of N_ELMS bits. */
sbitmap sbitmap
sbitmap_alloc (n_elms) sbitmap_alloc (unsigned int n_elms)
unsigned int n_elms;
{ {
unsigned int bytes, size, amt; unsigned int bytes, size, amt;
sbitmap bmap; sbitmap bmap;
...@@ -54,10 +53,7 @@ sbitmap_alloc (n_elms) ...@@ -54,10 +53,7 @@ sbitmap_alloc (n_elms)
is zero, and set them to one otherwise. */ is zero, and set them to one otherwise. */
sbitmap sbitmap
sbitmap_resize (bmap, n_elms, def) sbitmap_resize (sbitmap bmap, unsigned int n_elms, int def)
sbitmap bmap;
unsigned int n_elms;
int def;
{ {
unsigned int bytes, size, amt; unsigned int bytes, size, amt;
unsigned int last_bit; unsigned int last_bit;
...@@ -110,8 +106,7 @@ sbitmap_resize (bmap, n_elms, def) ...@@ -110,8 +106,7 @@ sbitmap_resize (bmap, n_elms, def)
/* Allocate a vector of N_VECS bitmaps of N_ELMS bits. */ /* Allocate a vector of N_VECS bitmaps of N_ELMS bits. */
sbitmap * sbitmap *
sbitmap_vector_alloc (n_vecs, n_elms) sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms)
unsigned int n_vecs, n_elms;
{ {
unsigned int i, bytes, offset, elm_bytes, size, amt, vector_bytes; unsigned int i, bytes, offset, elm_bytes, size, amt, vector_bytes;
sbitmap *bitmap_vector; sbitmap *bitmap_vector;
...@@ -153,16 +148,14 @@ sbitmap_vector_alloc (n_vecs, n_elms) ...@@ -153,16 +148,14 @@ sbitmap_vector_alloc (n_vecs, n_elms)
/* Copy sbitmap SRC to DST. */ /* Copy sbitmap SRC to DST. */
void void
sbitmap_copy (dst, src) sbitmap_copy (sbitmap dst, sbitmap src)
sbitmap dst, src;
{ {
memcpy (dst->elms, src->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size); memcpy (dst->elms, src->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
} }
/* Determine if a == b. */ /* Determine if a == b. */
int int
sbitmap_equal (a, b) sbitmap_equal (sbitmap a, sbitmap b)
sbitmap a, b;
{ {
return !memcmp (a->elms, b->elms, sizeof (SBITMAP_ELT_TYPE) * a->size); return !memcmp (a->elms, b->elms, sizeof (SBITMAP_ELT_TYPE) * a->size);
} }
...@@ -170,8 +163,7 @@ sbitmap_equal (a, b) ...@@ -170,8 +163,7 @@ sbitmap_equal (a, b)
/* Zero all elements in a bitmap. */ /* Zero all elements in a bitmap. */
void void
sbitmap_zero (bmap) sbitmap_zero (sbitmap bmap)
sbitmap bmap;
{ {
memset (bmap->elms, 0, bmap->bytes); memset (bmap->elms, 0, bmap->bytes);
} }
...@@ -179,8 +171,7 @@ sbitmap_zero (bmap) ...@@ -179,8 +171,7 @@ sbitmap_zero (bmap)
/* Set all elements in a bitmap to ones. */ /* Set all elements in a bitmap to ones. */
void void
sbitmap_ones (bmap) sbitmap_ones (sbitmap bmap)
sbitmap bmap;
{ {
unsigned int last_bit; unsigned int last_bit;
...@@ -195,9 +186,7 @@ sbitmap_ones (bmap) ...@@ -195,9 +186,7 @@ sbitmap_ones (bmap)
/* Zero a vector of N_VECS bitmaps. */ /* Zero a vector of N_VECS bitmaps. */
void void
sbitmap_vector_zero (bmap, n_vecs) sbitmap_vector_zero (sbitmap *bmap, unsigned int n_vecs)
sbitmap *bmap;
unsigned int n_vecs;
{ {
unsigned int i; unsigned int i;
...@@ -208,9 +197,7 @@ sbitmap_vector_zero (bmap, n_vecs) ...@@ -208,9 +197,7 @@ sbitmap_vector_zero (bmap, n_vecs)
/* Set a vector of N_VECS bitmaps to ones. */ /* Set a vector of N_VECS bitmaps to ones. */
void void
sbitmap_vector_ones (bmap, n_vecs) sbitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
sbitmap *bmap;
unsigned int n_vecs;
{ {
unsigned int i; unsigned int i;
...@@ -223,8 +210,7 @@ sbitmap_vector_ones (bmap, n_vecs) ...@@ -223,8 +210,7 @@ sbitmap_vector_ones (bmap, n_vecs)
Returns true if any change is made. */ Returns true if any change is made. */
bool bool
sbitmap_union_of_diff_cg (dst, a, b, c) sbitmap_union_of_diff_cg (sbitmap dst, sbitmap a, sbitmap b, sbitmap c)
sbitmap dst, a, b, c;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -244,8 +230,7 @@ sbitmap_union_of_diff_cg (dst, a, b, c) ...@@ -244,8 +230,7 @@ sbitmap_union_of_diff_cg (dst, a, b, c)
} }
void void
sbitmap_union_of_diff (dst, a, b, c) sbitmap_union_of_diff (sbitmap dst, sbitmap a, sbitmap b, sbitmap c)
sbitmap dst, a, b, c;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -260,8 +245,7 @@ sbitmap_union_of_diff (dst, a, b, c) ...@@ -260,8 +245,7 @@ sbitmap_union_of_diff (dst, a, b, c)
/* Set bitmap DST to the bitwise negation of the bitmap SRC. */ /* Set bitmap DST to the bitwise negation of the bitmap SRC. */
void void
sbitmap_not (dst, src) sbitmap_not (sbitmap dst, sbitmap src)
sbitmap dst, src;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -275,15 +259,14 @@ sbitmap_not (dst, src) ...@@ -275,15 +259,14 @@ sbitmap_not (dst, src)
in A and the bits in B. i.e. dst = a & (~b). */ in A and the bits in B. i.e. dst = a & (~b). */
void void
sbitmap_difference (dst, a, b) sbitmap_difference (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, dst_size = dst->size; unsigned int i, dst_size = dst->size;
unsigned int min_size = dst->size; unsigned int min_size = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
sbitmap_ptr ap = a->elms; sbitmap_ptr ap = a->elms;
sbitmap_ptr bp = b->elms; sbitmap_ptr bp = b->elms;
/* A should be at least as large as DEST, to have a defined source. */ /* A should be at least as large as DEST, to have a defined source. */
if (a->size < dst_size) if (a->size < dst_size)
abort (); abort ();
...@@ -304,8 +287,7 @@ sbitmap_difference (dst, a, b) ...@@ -304,8 +287,7 @@ sbitmap_difference (dst, a, b)
Return nonzero if any change is made. */ Return nonzero if any change is made. */
bool bool
sbitmap_a_and_b_cg (dst, a, b) sbitmap_a_and_b_cg (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -324,8 +306,7 @@ sbitmap_a_and_b_cg (dst, a, b) ...@@ -324,8 +306,7 @@ sbitmap_a_and_b_cg (dst, a, b)
} }
void void
sbitmap_a_and_b (dst, a, b) sbitmap_a_and_b (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -340,8 +321,7 @@ sbitmap_a_and_b (dst, a, b) ...@@ -340,8 +321,7 @@ sbitmap_a_and_b (dst, a, b)
Return nonzero if any change is made. */ Return nonzero if any change is made. */
bool bool
sbitmap_a_xor_b_cg (dst, a, b) sbitmap_a_xor_b_cg (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -360,8 +340,7 @@ sbitmap_a_xor_b_cg (dst, a, b) ...@@ -360,8 +340,7 @@ sbitmap_a_xor_b_cg (dst, a, b)
} }
void void
sbitmap_a_xor_b (dst, a, b) sbitmap_a_xor_b (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -376,8 +355,7 @@ sbitmap_a_xor_b (dst, a, b) ...@@ -376,8 +355,7 @@ sbitmap_a_xor_b (dst, a, b)
Return nonzero if any change is made. */ Return nonzero if any change is made. */
bool bool
sbitmap_a_or_b_cg (dst, a, b) sbitmap_a_or_b_cg (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -396,8 +374,7 @@ sbitmap_a_or_b_cg (dst, a, b) ...@@ -396,8 +374,7 @@ sbitmap_a_or_b_cg (dst, a, b)
} }
void void
sbitmap_a_or_b (dst, a, b) sbitmap_a_or_b (sbitmap dst, sbitmap a, sbitmap b)
sbitmap dst, a, b;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -411,8 +388,7 @@ sbitmap_a_or_b (dst, a, b) ...@@ -411,8 +388,7 @@ sbitmap_a_or_b (dst, a, b)
/* Return nonzero if A is a subset of B. */ /* Return nonzero if A is a subset of B. */
bool bool
sbitmap_a_subset_b_p (a, b) sbitmap_a_subset_b_p (sbitmap a, sbitmap b)
sbitmap a, b;
{ {
unsigned int i, n = a->size; unsigned int i, n = a->size;
sbitmap_ptr ap, bp; sbitmap_ptr ap, bp;
...@@ -428,8 +404,7 @@ sbitmap_a_subset_b_p (a, b) ...@@ -428,8 +404,7 @@ sbitmap_a_subset_b_p (a, b)
Return nonzero if any change is made. */ Return nonzero if any change is made. */
bool bool
sbitmap_a_or_b_and_c_cg (dst, a, b, c) sbitmap_a_or_b_and_c_cg (sbitmap dst, sbitmap a, sbitmap b, sbitmap c)
sbitmap dst, a, b, c;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -449,8 +424,7 @@ sbitmap_a_or_b_and_c_cg (dst, a, b, c) ...@@ -449,8 +424,7 @@ sbitmap_a_or_b_and_c_cg (dst, a, b, c)
} }
void void
sbitmap_a_or_b_and_c (dst, a, b, c) sbitmap_a_or_b_and_c (sbitmap dst, sbitmap a, sbitmap b, sbitmap c)
sbitmap dst, a, b, c;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -466,8 +440,7 @@ sbitmap_a_or_b_and_c (dst, a, b, c) ...@@ -466,8 +440,7 @@ sbitmap_a_or_b_and_c (dst, a, b, c)
Return nonzero if any change is made. */ Return nonzero if any change is made. */
bool bool
sbitmap_a_and_b_or_c_cg (dst, a, b, c) sbitmap_a_and_b_or_c_cg (sbitmap dst, sbitmap a, sbitmap b, sbitmap c)
sbitmap dst, a, b, c;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -487,8 +460,7 @@ sbitmap_a_and_b_or_c_cg (dst, a, b, c) ...@@ -487,8 +460,7 @@ sbitmap_a_and_b_or_c_cg (dst, a, b, c)
} }
void void
sbitmap_a_and_b_or_c (dst, a, b, c) sbitmap_a_and_b_or_c (sbitmap dst, sbitmap a, sbitmap b, sbitmap c)
sbitmap dst, a, b, c;
{ {
unsigned int i, n = dst->size; unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms; sbitmap_ptr dstp = dst->elms;
...@@ -505,10 +477,7 @@ sbitmap_a_and_b_or_c (dst, a, b, c) ...@@ -505,10 +477,7 @@ sbitmap_a_and_b_or_c (dst, a, b, c)
block number BB, using the new flow graph structures. */ block number BB, using the new flow graph structures. */
void void
sbitmap_intersection_of_succs (dst, src, bb) sbitmap_intersection_of_succs (sbitmap dst, sbitmap *src, int bb)
sbitmap dst;
sbitmap *src;
int bb;
{ {
basic_block b = BASIC_BLOCK (bb); basic_block b = BASIC_BLOCK (bb);
unsigned int set_size = dst->size; unsigned int set_size = dst->size;
...@@ -545,10 +514,7 @@ sbitmap_intersection_of_succs (dst, src, bb) ...@@ -545,10 +514,7 @@ sbitmap_intersection_of_succs (dst, src, bb)
block number BB, using the new flow graph structures. */ block number BB, using the new flow graph structures. */
void void
sbitmap_intersection_of_preds (dst, src, bb) sbitmap_intersection_of_preds (sbitmap dst, sbitmap *src, int bb)
sbitmap dst;
sbitmap *src;
int bb;
{ {
basic_block b = BASIC_BLOCK (bb); basic_block b = BASIC_BLOCK (bb);
unsigned int set_size = dst->size; unsigned int set_size = dst->size;
...@@ -585,10 +551,7 @@ sbitmap_intersection_of_preds (dst, src, bb) ...@@ -585,10 +551,7 @@ sbitmap_intersection_of_preds (dst, src, bb)
block number BB, using the new flow graph structures. */ block number BB, using the new flow graph structures. */
void void
sbitmap_union_of_succs (dst, src, bb) sbitmap_union_of_succs (sbitmap dst, sbitmap *src, int bb)
sbitmap dst;
sbitmap *src;
int bb;
{ {
basic_block b = BASIC_BLOCK (bb); basic_block b = BASIC_BLOCK (bb);
unsigned int set_size = dst->size; unsigned int set_size = dst->size;
...@@ -625,10 +588,7 @@ sbitmap_union_of_succs (dst, src, bb) ...@@ -625,10 +588,7 @@ sbitmap_union_of_succs (dst, src, bb)
block number BB, using the new flow graph structures. */ block number BB, using the new flow graph structures. */
void void
sbitmap_union_of_preds (dst, src, bb) sbitmap_union_of_preds (sbitmap dst, sbitmap *src, int bb)
sbitmap dst;
sbitmap *src;
int bb;
{ {
basic_block b = BASIC_BLOCK (bb); basic_block b = BASIC_BLOCK (bb);
unsigned int set_size = dst->size; unsigned int set_size = dst->size;
...@@ -665,8 +625,7 @@ sbitmap_union_of_preds (dst, src, bb) ...@@ -665,8 +625,7 @@ sbitmap_union_of_preds (dst, src, bb)
/* Return number of first bit set in the bitmap, -1 if none. */ /* Return number of first bit set in the bitmap, -1 if none. */
int int
sbitmap_first_set_bit (bmap) sbitmap_first_set_bit (sbitmap bmap)
sbitmap bmap;
{ {
unsigned int n; unsigned int n;
...@@ -677,8 +636,7 @@ sbitmap_first_set_bit (bmap) ...@@ -677,8 +636,7 @@ sbitmap_first_set_bit (bmap)
/* Return number of last bit set in the bitmap, -1 if none. */ /* Return number of last bit set in the bitmap, -1 if none. */
int int
sbitmap_last_set_bit (bmap) sbitmap_last_set_bit (sbitmap bmap)
sbitmap bmap;
{ {
int i; int i;
SBITMAP_ELT_TYPE *ptr = bmap->elms; SBITMAP_ELT_TYPE *ptr = bmap->elms;
...@@ -708,9 +666,7 @@ sbitmap_last_set_bit (bmap) ...@@ -708,9 +666,7 @@ sbitmap_last_set_bit (bmap)
} }
void void
dump_sbitmap (file, bmap) dump_sbitmap (FILE *file, sbitmap bmap)
FILE *file;
sbitmap bmap;
{ {
unsigned int i, n, j; unsigned int i, n, j;
unsigned int set_size = bmap->size; unsigned int set_size = bmap->size;
...@@ -731,9 +687,7 @@ dump_sbitmap (file, bmap) ...@@ -731,9 +687,7 @@ dump_sbitmap (file, bmap)
} }
void void
dump_sbitmap_file (file, bmap) dump_sbitmap_file (FILE *file, sbitmap bmap)
FILE *file;
sbitmap bmap;
{ {
unsigned int i, pos; unsigned int i, pos;
...@@ -756,18 +710,14 @@ dump_sbitmap_file (file, bmap) ...@@ -756,18 +710,14 @@ dump_sbitmap_file (file, bmap)
} }
void void
debug_sbitmap (bmap) debug_sbitmap (sbitmap bmap)
sbitmap bmap;
{ {
dump_sbitmap_file (stderr, bmap); dump_sbitmap_file (stderr, bmap);
} }
void void
dump_sbitmap_vector (file, title, subtitle, bmaps, n_maps) dump_sbitmap_vector (FILE *file, const char *title, const char *subtitle,
FILE *file; sbitmap *bmaps, int n_maps)
const char *title, *subtitle;
sbitmap *bmaps;
int n_maps;
{ {
int bb; int bb;
......
...@@ -19,7 +19,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -19,7 +19,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 02111-1307, USA. */
#ifndef GCC_SBITMAP_H #ifndef GCC_SBITMAP_H
#define GCC_SBITMAP_H #define GCC_SBITMAP_H
/* It's not clear yet whether using bitmap.[ch] will be a win. /* It's not clear yet whether using bitmap.[ch] will be a win.
It should be straightforward to convert so for now we keep things simple It should be straightforward to convert so for now we keep things simple
...@@ -118,63 +118,56 @@ do { \ ...@@ -118,63 +118,56 @@ do { \
struct int_list; struct int_list;
extern void dump_sbitmap PARAMS ((FILE *, sbitmap)); extern void dump_sbitmap (FILE *, sbitmap);
extern void dump_sbitmap_file PARAMS ((FILE *, sbitmap)); extern void dump_sbitmap_file (FILE *, sbitmap);
extern void dump_sbitmap_vector PARAMS ((FILE *, const char *, extern void dump_sbitmap_vector (FILE *, const char *, const char *, sbitmap *,
const char *, sbitmap *, int);
int)); extern sbitmap sbitmap_alloc (unsigned int);
extern sbitmap sbitmap_alloc PARAMS ((unsigned int)); extern sbitmap *sbitmap_vector_alloc (unsigned int, unsigned int);
extern sbitmap *sbitmap_vector_alloc PARAMS ((unsigned int, unsigned int)); extern sbitmap sbitmap_resize (sbitmap, unsigned int, int);
extern sbitmap sbitmap_resize PARAMS ((sbitmap, unsigned int, int)); extern void sbitmap_copy (sbitmap, sbitmap);
extern void sbitmap_copy PARAMS ((sbitmap, sbitmap)); extern int sbitmap_equal (sbitmap, sbitmap);
extern int sbitmap_equal PARAMS ((sbitmap, sbitmap)); extern void sbitmap_zero (sbitmap);
extern void sbitmap_zero PARAMS ((sbitmap)); extern void sbitmap_ones (sbitmap);
extern void sbitmap_ones PARAMS ((sbitmap)); extern void sbitmap_vector_zero (sbitmap *, unsigned int);
extern void sbitmap_vector_zero PARAMS ((sbitmap *, unsigned int)); extern void sbitmap_vector_ones (sbitmap *, unsigned int);
extern void sbitmap_vector_ones PARAMS ((sbitmap *, unsigned int));
extern void sbitmap_union_of_diff (sbitmap, sbitmap, sbitmap, sbitmap);
extern void sbitmap_union_of_diff PARAMS ((sbitmap, sbitmap, sbitmap, extern bool sbitmap_union_of_diff_cg (sbitmap, sbitmap, sbitmap, sbitmap);
sbitmap)); extern void sbitmap_difference (sbitmap, sbitmap, sbitmap);
extern bool sbitmap_union_of_diff_cg PARAMS ((sbitmap, sbitmap, sbitmap, extern void sbitmap_not (sbitmap, sbitmap);
sbitmap)); extern void sbitmap_a_or_b_and_c (sbitmap, sbitmap, sbitmap, sbitmap);
extern void sbitmap_difference PARAMS ((sbitmap, sbitmap, sbitmap)); extern bool sbitmap_a_or_b_and_c_cg (sbitmap, sbitmap, sbitmap, sbitmap);
extern void sbitmap_not PARAMS ((sbitmap, sbitmap)); extern void sbitmap_a_and_b_or_c (sbitmap, sbitmap, sbitmap, sbitmap);
extern void sbitmap_a_or_b_and_c PARAMS ((sbitmap, sbitmap, sbitmap, extern bool sbitmap_a_and_b_or_c_cg (sbitmap, sbitmap, sbitmap, sbitmap);
sbitmap)); extern void sbitmap_a_and_b (sbitmap, sbitmap, sbitmap);
extern bool sbitmap_a_or_b_and_c_cg PARAMS ((sbitmap, sbitmap, sbitmap, extern bool sbitmap_a_and_b_cg (sbitmap, sbitmap, sbitmap);
sbitmap)); extern void sbitmap_a_or_b (sbitmap, sbitmap, sbitmap);
extern void sbitmap_a_and_b_or_c PARAMS ((sbitmap, sbitmap, sbitmap, extern bool sbitmap_a_or_b_cg (sbitmap, sbitmap, sbitmap);
sbitmap)); extern void sbitmap_a_xor_b (sbitmap, sbitmap, sbitmap);
extern bool sbitmap_a_and_b_or_c_cg PARAMS ((sbitmap, sbitmap, sbitmap, extern bool sbitmap_a_xor_b_cg (sbitmap, sbitmap, sbitmap);
sbitmap)); extern bool sbitmap_a_subset_b_p (sbitmap, sbitmap);
extern void sbitmap_a_and_b PARAMS ((sbitmap, sbitmap, sbitmap));
extern bool sbitmap_a_and_b_cg PARAMS ((sbitmap, sbitmap, sbitmap)); extern int sbitmap_first_set_bit (sbitmap);
extern void sbitmap_a_or_b PARAMS ((sbitmap, sbitmap, sbitmap)); extern int sbitmap_last_set_bit (sbitmap);
extern bool sbitmap_a_or_b_cg PARAMS ((sbitmap, sbitmap, sbitmap));
extern void sbitmap_a_xor_b PARAMS ((sbitmap, sbitmap, sbitmap)); extern void sbitmap_intersect_of_predsucc (sbitmap, sbitmap *, int,
extern bool sbitmap_a_xor_b_cg PARAMS ((sbitmap, sbitmap, sbitmap)); struct int_list **);
extern bool sbitmap_a_subset_b_p PARAMS ((sbitmap, sbitmap));
extern int sbitmap_first_set_bit PARAMS ((sbitmap));
extern int sbitmap_last_set_bit PARAMS ((sbitmap));
extern void sbitmap_intersect_of_predsucc PARAMS ((sbitmap, sbitmap *,
int, struct int_list **));
#define sbitmap_intersect_of_predecessors sbitmap_intersect_of_predsucc #define sbitmap_intersect_of_predecessors sbitmap_intersect_of_predsucc
#define sbitmap_intersect_of_successors sbitmap_intersect_of_predsucc #define sbitmap_intersect_of_successors sbitmap_intersect_of_predsucc
extern void sbitmap_union_of_predsucc PARAMS ((sbitmap, sbitmap *, int, extern void sbitmap_union_of_predsucc (sbitmap, sbitmap *, int,
struct int_list **)); struct int_list **);
#define sbitmap_union_of_predecessors sbitmap_union_of_predsucc #define sbitmap_union_of_predecessors sbitmap_union_of_predsucc
#define sbitmap_union_of_successors sbitmap_union_of_predsucc #define sbitmap_union_of_successors sbitmap_union_of_predsucc
/* Intersection and Union of preds/succs using the new flow graph /* Intersection and Union of preds/succs using the new flow graph
structure instead of the pred/succ arrays. */ structure instead of the pred/succ arrays. */
extern void sbitmap_intersection_of_succs PARAMS ((sbitmap, sbitmap *, int)); extern void sbitmap_intersection_of_succs (sbitmap, sbitmap *, int);
extern void sbitmap_intersection_of_preds PARAMS ((sbitmap, sbitmap *, int)); extern void sbitmap_intersection_of_preds (sbitmap, sbitmap *, int);
extern void sbitmap_union_of_succs PARAMS ((sbitmap, sbitmap *, int)); extern void sbitmap_union_of_succs (sbitmap, sbitmap *, int);
extern void sbitmap_union_of_preds PARAMS ((sbitmap, sbitmap *, int)); extern void sbitmap_union_of_preds (sbitmap, sbitmap *, int);
extern void debug_sbitmap PARAMS ((sbitmap)); extern void debug_sbitmap (sbitmap);
#endif /* ! GCC_SBITMAP_H */ #endif /* ! GCC_SBITMAP_H */
/* scan-decls.c - Extracts declarations from cpp output. /* scan-decls.c - Extracts declarations from cpp output.
Copyright (C) 1993, 1995, 1997, 1998, Copyright (C) 1993, 1995, 1997, 1998,
1999, 2000 Free Software Foundation, Inc. 1999, 2000, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -25,8 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -25,8 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpplib.h" #include "cpplib.h"
#include "scan.h" #include "scan.h"
static void skip_to_closing_brace PARAMS ((cpp_reader *)); static void skip_to_closing_brace (cpp_reader *);
static const cpp_token *get_a_token PARAMS ((cpp_reader *)); static const cpp_token *get_a_token (cpp_reader *);
int brace_nesting = 0; int brace_nesting = 0;
...@@ -43,8 +43,7 @@ int current_extern_C = 0; ...@@ -43,8 +43,7 @@ int current_extern_C = 0;
/* Get a token but skip padding. */ /* Get a token but skip padding. */
static const cpp_token * static const cpp_token *
get_a_token (pfile) get_a_token (cpp_reader *pfile)
cpp_reader *pfile;
{ {
for (;;) for (;;)
{ {
...@@ -55,8 +54,7 @@ get_a_token (pfile) ...@@ -55,8 +54,7 @@ get_a_token (pfile)
} }
static void static void
skip_to_closing_brace (pfile) skip_to_closing_brace (cpp_reader *pfile)
cpp_reader *pfile;
{ {
int nesting = 1; int nesting = 1;
for (;;) for (;;)
...@@ -95,10 +93,8 @@ Here dname is the actual name being declared. ...@@ -95,10 +93,8 @@ Here dname is the actual name being declared.
*/ */
int int
scan_decls (pfile, argc, argv) scan_decls (cpp_reader *pfile, int argc ATTRIBUTE_UNUSED,
cpp_reader *pfile; char **argv ATTRIBUTE_UNUSED)
int argc ATTRIBUTE_UNUSED;
char **argv ATTRIBUTE_UNUSED;
{ {
int saw_extern, saw_inline; int saw_extern, saw_inline;
cpp_token prev_id; cpp_token prev_id;
......
/* Utility functions for scan-decls and fix-header programs. /* Utility functions for scan-decls and fix-header programs.
Copyright (C) 1993, 1994, 1998, 2002 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1998, 2002, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -26,9 +26,7 @@ int source_lineno = 1; ...@@ -26,9 +26,7 @@ int source_lineno = 1;
sstring source_filename; sstring source_filename;
void void
make_sstring_space (str, count) make_sstring_space (sstring *str, int count)
sstring *str;
int count;
{ {
int cur_pos = str->ptr - str->base; int cur_pos = str->ptr - str->base;
int cur_size = str->limit - str->base; int cur_size = str->limit - str->base;
...@@ -43,9 +41,7 @@ make_sstring_space (str, count) ...@@ -43,9 +41,7 @@ make_sstring_space (str, count)
} }
void void
sstring_append (dst, src) sstring_append (sstring *dst, sstring *src)
sstring *dst;
sstring *src;
{ {
char *d, *s; char *d, *s;
int count = SSTRING_LENGTH (src); int count = SSTRING_LENGTH (src);
...@@ -59,10 +55,7 @@ sstring_append (dst, src) ...@@ -59,10 +55,7 @@ sstring_append (dst, src)
} }
int int
scan_ident (fp, s, c) scan_ident (FILE *fp, sstring *s, int c)
FILE *fp;
sstring *s;
int c;
{ {
s->ptr = s->base; s->ptr = s->base;
if (ISIDST (c)) if (ISIDST (c))
...@@ -81,10 +74,7 @@ scan_ident (fp, s, c) ...@@ -81,10 +74,7 @@ scan_ident (fp, s, c)
} }
int int
scan_string (fp, s, init) scan_string (FILE *fp, sstring *s, int init)
FILE *fp;
sstring *s;
int init;
{ {
int c; int c;
...@@ -116,9 +106,7 @@ scan_string (fp, s, init) ...@@ -116,9 +106,7 @@ scan_string (fp, s, init)
/* Skip horizontal white spaces (spaces, tabs, and C-style comments). */ /* Skip horizontal white spaces (spaces, tabs, and C-style comments). */
int int
skip_spaces (fp, c) skip_spaces (FILE *fp, int c)
FILE *fp;
int c;
{ {
for (;;) for (;;)
{ {
...@@ -154,10 +142,7 @@ skip_spaces (fp, c) ...@@ -154,10 +142,7 @@ skip_spaces (fp, c)
} }
int int
read_upto (fp, str, delim) read_upto (FILE *fp, sstring *str, int delim)
FILE *fp;
sstring *str;
int delim;
{ {
int ch; int ch;
...@@ -174,9 +159,7 @@ read_upto (fp, str, delim) ...@@ -174,9 +159,7 @@ read_upto (fp, str, delim)
} }
int int
get_token (fp, s) get_token (FILE *fp, sstring *s)
FILE *fp;
sstring *s;
{ {
int c; int c;
...@@ -244,9 +227,7 @@ get_token (fp, s) ...@@ -244,9 +227,7 @@ get_token (fp, s)
} }
unsigned int unsigned int
hashstr (str, len) hashstr (const char *str, unsigned int len)
const char *str;
unsigned int len;
{ {
unsigned int n = len; unsigned int n = len;
unsigned int r = 0; unsigned int r = 0;
......
/* Instruction scheduling pass. /* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc. 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by, Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com) and currently maintained by, Jim Wilson (wilson@cygnus.com)
...@@ -48,25 +48,25 @@ static int target_n_insns; ...@@ -48,25 +48,25 @@ static int target_n_insns;
static int sched_n_insns; static int sched_n_insns;
/* Implementations of the sched_info functions for region scheduling. */ /* Implementations of the sched_info functions for region scheduling. */
static void init_ready_list PARAMS ((struct ready_list *)); static void init_ready_list (struct ready_list *);
static int can_schedule_ready_p PARAMS ((rtx)); static int can_schedule_ready_p (rtx);
static int new_ready PARAMS ((rtx)); static int new_ready (rtx);
static int schedule_more_p PARAMS ((void)); static int schedule_more_p (void);
static const char *ebb_print_insn PARAMS ((rtx, int)); static const char *ebb_print_insn (rtx, int);
static int rank PARAMS ((rtx, rtx)); static int rank (rtx, rtx);
static int contributes_to_priority PARAMS ((rtx, rtx)); static int contributes_to_priority (rtx, rtx);
static void compute_jump_reg_dependencies PARAMS ((rtx, regset)); static void compute_jump_reg_dependencies (rtx, regset);
static basic_block earliest_block_with_similiar_load PARAMS ((basic_block, static basic_block earliest_block_with_similiar_load (basic_block, rtx);
rtx)); static void add_deps_for_risky_insns (rtx, rtx);
static void add_deps_for_risky_insns PARAMS ((rtx, rtx)); static basic_block schedule_ebb (rtx, rtx);
static basic_block schedule_ebb PARAMS ((rtx, rtx)); static basic_block fix_basic_block_boundaries (basic_block, basic_block, rtx,
static basic_block fix_basic_block_boundaries PARAMS ((basic_block, basic_block, rtx, rtx)); rtx);
static void add_missing_bbs PARAMS ((rtx, basic_block, basic_block)); static void add_missing_bbs (rtx, basic_block, basic_block);
/* Return nonzero if there are more insns that should be scheduled. */ /* Return nonzero if there are more insns that should be scheduled. */
static int static int
schedule_more_p () schedule_more_p (void)
{ {
return sched_n_insns < target_n_insns; return sched_n_insns < target_n_insns;
} }
...@@ -75,8 +75,7 @@ schedule_more_p () ...@@ -75,8 +75,7 @@ schedule_more_p ()
once before scheduling a set of insns. */ once before scheduling a set of insns. */
static void static void
init_ready_list (ready) init_ready_list (struct ready_list *ready)
struct ready_list *ready;
{ {
rtx prev_head = current_sched_info->prev_head; rtx prev_head = current_sched_info->prev_head;
rtx next_tail = current_sched_info->next_tail; rtx next_tail = current_sched_info->next_tail;
...@@ -105,8 +104,7 @@ init_ready_list (ready) ...@@ -105,8 +104,7 @@ init_ready_list (ready)
insn can be scheduled, nonzero if we should silently discard it. */ insn can be scheduled, nonzero if we should silently discard it. */
static int static int
can_schedule_ready_p (insn) can_schedule_ready_p (rtx insn ATTRIBUTE_UNUSED)
rtx insn ATTRIBUTE_UNUSED;
{ {
sched_n_insns++; sched_n_insns++;
return 1; return 1;
...@@ -116,8 +114,7 @@ can_schedule_ready_p (insn) ...@@ -116,8 +114,7 @@ can_schedule_ready_p (insn)
if it should be moved to the ready list or the queue, or zero if we if it should be moved to the ready list or the queue, or zero if we
should silently discard it. */ should silently discard it. */
static int static int
new_ready (next) new_ready (rtx next ATTRIBUTE_UNUSED)
rtx next ATTRIBUTE_UNUSED;
{ {
return 1; return 1;
} }
...@@ -128,9 +125,7 @@ new_ready (next) ...@@ -128,9 +125,7 @@ new_ready (next)
to be formatted so that multiple output lines will line up nicely. */ to be formatted so that multiple output lines will line up nicely. */
static const char * static const char *
ebb_print_insn (insn, aligned) ebb_print_insn (rtx insn, int aligned ATTRIBUTE_UNUSED)
rtx insn;
int aligned ATTRIBUTE_UNUSED;
{ {
static char tmp[80]; static char tmp[80];
...@@ -143,8 +138,7 @@ ebb_print_insn (insn, aligned) ...@@ -143,8 +138,7 @@ ebb_print_insn (insn, aligned)
is to be preferred. Zero if they are equally good. */ is to be preferred. Zero if they are equally good. */
static int static int
rank (insn1, insn2) rank (rtx insn1, rtx insn2)
rtx insn1, insn2;
{ {
basic_block bb1 = BLOCK_FOR_INSN (insn1); basic_block bb1 = BLOCK_FOR_INSN (insn1);
basic_block bb2 = BLOCK_FOR_INSN (insn2); basic_block bb2 = BLOCK_FOR_INSN (insn2);
...@@ -163,8 +157,8 @@ rank (insn1, insn2) ...@@ -163,8 +157,8 @@ rank (insn1, insn2)
calculations. */ calculations. */
static int static int
contributes_to_priority (next, insn) contributes_to_priority (rtx next ATTRIBUTE_UNUSED,
rtx next ATTRIBUTE_UNUSED, insn ATTRIBUTE_UNUSED; rtx insn ATTRIBUTE_UNUSED)
{ {
return 1; return 1;
} }
...@@ -173,9 +167,7 @@ contributes_to_priority (next, insn) ...@@ -173,9 +167,7 @@ contributes_to_priority (next, insn)
to be set by this jump in SET. */ to be set by this jump in SET. */
static void static void
compute_jump_reg_dependencies (insn, set) compute_jump_reg_dependencies (rtx insn, regset set)
rtx insn;
regset set;
{ {
basic_block b = BLOCK_FOR_INSN (insn); basic_block b = BLOCK_FOR_INSN (insn);
edge e; edge e;
...@@ -210,9 +202,7 @@ static struct sched_info ebb_sched_info = ...@@ -210,9 +202,7 @@ static struct sched_info ebb_sched_info =
Place blocks from FIRST to LAST before BEFORE. */ Place blocks from FIRST to LAST before BEFORE. */
static void static void
add_missing_bbs (before, first, last) add_missing_bbs (rtx before, basic_block first, basic_block last)
rtx before;
basic_block first, last;
{ {
for (; last != first->prev_bb; last = last->prev_bb) for (; last != first->prev_bb; last = last->prev_bb)
{ {
...@@ -229,9 +219,8 @@ add_missing_bbs (before, first, last) ...@@ -229,9 +219,8 @@ add_missing_bbs (before, first, last)
structures between BB and LAST. */ structures between BB and LAST. */
static basic_block static basic_block
fix_basic_block_boundaries (bb, last, head, tail) fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head,
basic_block bb, last; rtx tail)
rtx head, tail;
{ {
rtx insn = head; rtx insn = head;
rtx last_inside = bb->head; rtx last_inside = bb->head;
...@@ -288,7 +277,7 @@ fix_basic_block_boundaries (bb, last, head, tail) ...@@ -288,7 +277,7 @@ fix_basic_block_boundaries (bb, last, head, tail)
In this case we can create new basic block. It is In this case we can create new basic block. It is
always exactly one basic block last in the sequence. Handle always exactly one basic block last in the sequence. Handle
it by splitting the edge and repositioning the block. it by splitting the edge and repositioning the block.
This is somewhat hackish, but at least avoid cut&paste This is somewhat hackish, but at least avoid cut&paste
A safer solution can be to bring the code into sequence, A safer solution can be to bring the code into sequence,
do the split and re-emit it back in case this will ever do the split and re-emit it back in case this will ever
...@@ -359,9 +348,7 @@ fix_basic_block_boundaries (bb, last, head, tail) ...@@ -359,9 +348,7 @@ fix_basic_block_boundaries (bb, last, head, tail)
blocks in EBB. The list is formed in `add_deps_for_risky_insns'. */ blocks in EBB. The list is formed in `add_deps_for_risky_insns'. */
static basic_block static basic_block
earliest_block_with_similiar_load (last_block, load_insn) earliest_block_with_similiar_load (basic_block last_block, rtx load_insn)
basic_block last_block;
rtx load_insn;
{ {
rtx back_link; rtx back_link;
basic_block bb, earliest_block = NULL; basic_block bb, earliest_block = NULL;
...@@ -394,7 +381,7 @@ earliest_block_with_similiar_load (last_block, load_insn) ...@@ -394,7 +381,7 @@ earliest_block_with_similiar_load (last_block, load_insn)
if (haifa_classify_insn (insn2) != PFREE_CANDIDATE) if (haifa_classify_insn (insn2) != PFREE_CANDIDATE)
/* insn2 not guaranteed to be a 1 base reg load. */ /* insn2 not guaranteed to be a 1 base reg load. */
continue; continue;
for (bb = last_block; bb; bb = bb->aux) for (bb = last_block; bb; bb = bb->aux)
if (insn2_block == bb) if (insn2_block == bb)
break; break;
...@@ -414,15 +401,14 @@ earliest_block_with_similiar_load (last_block, load_insn) ...@@ -414,15 +401,14 @@ earliest_block_with_similiar_load (last_block, load_insn)
insns in given ebb. */ insns in given ebb. */
static void static void
add_deps_for_risky_insns (head, tail) add_deps_for_risky_insns (rtx head, rtx tail)
rtx head, tail;
{ {
rtx insn, prev; rtx insn, prev;
int class; int class;
rtx last_jump = NULL_RTX; rtx last_jump = NULL_RTX;
rtx next_tail = NEXT_INSN (tail); rtx next_tail = NEXT_INSN (tail);
basic_block last_block = NULL, bb; basic_block last_block = NULL, bb;
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn)) for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == JUMP_INSN) if (GET_CODE (insn) == JUMP_INSN)
{ {
...@@ -461,7 +447,7 @@ add_deps_for_risky_insns (head, tail) ...@@ -461,7 +447,7 @@ add_deps_for_risky_insns (head, tail)
if (add_dependence (insn, prev, REG_DEP_ANTI)) if (add_dependence (insn, prev, REG_DEP_ANTI))
add_forward_dependence (prev, insn, REG_DEP_ANTI); add_forward_dependence (prev, insn, REG_DEP_ANTI);
break; break;
default: default:
break; break;
} }
...@@ -479,8 +465,7 @@ add_deps_for_risky_insns (head, tail) ...@@ -479,8 +465,7 @@ add_deps_for_risky_insns (head, tail)
and TAIL. */ and TAIL. */
static basic_block static basic_block
schedule_ebb (head, tail) schedule_ebb (rtx head, rtx tail)
rtx head, tail;
{ {
int n_insns; int n_insns;
basic_block b; basic_block b;
...@@ -564,8 +549,7 @@ schedule_ebb (head, tail) ...@@ -564,8 +549,7 @@ schedule_ebb (head, tail)
this pass. */ this pass. */
void void
schedule_ebbs (dump_file) schedule_ebbs (FILE *dump_file)
FILE *dump_file;
{ {
basic_block bb; basic_block bb;
......
/* Instruction scheduling pass. This file contains definitions used /* Instruction scheduling pass. This file contains definitions used
internally in the scheduler. internally in the scheduler.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001 Free Software Foundation, Inc. 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -123,7 +123,7 @@ struct sched_info ...@@ -123,7 +123,7 @@ struct sched_info
{ {
/* Add all insns that are initially ready to the ready list. Called once /* Add all insns that are initially ready to the ready list. Called once
before scheduling a set of insns. */ before scheduling a set of insns. */
void (*init_ready_list) PARAMS ((struct ready_list *)); void (*init_ready_list) (struct ready_list *);
/* Called after taking an insn from the ready list. Returns nonzero if /* Called after taking an insn from the ready list. Returns nonzero if
this insn can be scheduled, nonzero if we should silently discard it. */ this insn can be scheduled, nonzero if we should silently discard it. */
int (*can_schedule_ready_p) PARAMS ((rtx)); int (*can_schedule_ready_p) PARAMS ((rtx));
...@@ -337,56 +337,55 @@ enum INSN_TRAP_CLASS ...@@ -337,56 +337,55 @@ enum INSN_TRAP_CLASS
#endif #endif
/* Functions in sched-vis.c. */ /* Functions in sched-vis.c. */
extern void init_target_units PARAMS ((void)); extern void init_target_units (void);
extern void insn_print_units PARAMS ((rtx)); extern void insn_print_units (rtx);
extern void init_block_visualization PARAMS ((void)); extern void init_block_visualization (void);
extern void print_block_visualization PARAMS ((const char *)); extern void print_block_visualization (const char *);
extern void visualize_scheduled_insns PARAMS ((int)); extern void visualize_scheduled_insns (int);
extern void visualize_no_unit PARAMS ((rtx)); extern void visualize_no_unit (rtx);
extern void visualize_stall_cycles PARAMS ((int)); extern void visualize_stall_cycles (int);
extern void visualize_alloc PARAMS ((void)); extern void visualize_alloc (void);
extern void visualize_free PARAMS ((void)); extern void visualize_free (void);
/* Functions in sched-deps.c. */ /* Functions in sched-deps.c. */
extern int add_dependence PARAMS ((rtx, rtx, enum reg_note)); extern int add_dependence (rtx, rtx, enum reg_note);
extern void add_insn_mem_dependence PARAMS ((struct deps *, rtx *, rtx *, rtx, extern void add_insn_mem_dependence (struct deps *, rtx *, rtx *, rtx, rtx);
rtx)); extern void sched_analyze (struct deps *, rtx, rtx);
extern void sched_analyze PARAMS ((struct deps *, rtx, rtx)); extern void init_deps (struct deps *);
extern void init_deps PARAMS ((struct deps *)); extern void free_deps (struct deps *);
extern void free_deps PARAMS ((struct deps *)); extern void init_deps_global (void);
extern void init_deps_global PARAMS ((void)); extern void finish_deps_global (void);
extern void finish_deps_global PARAMS ((void)); extern void add_forward_dependence (rtx, rtx, enum reg_note);
extern void add_forward_dependence PARAMS ((rtx, rtx, enum reg_note)); extern void compute_forward_dependences (rtx, rtx);
extern void compute_forward_dependences PARAMS ((rtx, rtx)); extern rtx find_insn_list (rtx, rtx);
extern rtx find_insn_list PARAMS ((rtx, rtx)); extern void init_dependency_caches (int);
extern void init_dependency_caches PARAMS ((int)); extern void free_dependency_caches (void);
extern void free_dependency_caches PARAMS ((void));
/* Functions in haifa-sched.c. */ /* Functions in haifa-sched.c. */
extern int haifa_classify_insn PARAMS ((rtx)); extern int haifa_classify_insn (rtx);
extern void get_block_head_tail PARAMS ((int, rtx *, rtx *)); extern void get_block_head_tail (int, rtx *, rtx *);
extern int no_real_insns_p PARAMS ((rtx, rtx)); extern int no_real_insns_p (rtx, rtx);
extern void rm_line_notes PARAMS ((rtx, rtx)); extern void rm_line_notes (rtx, rtx);
extern void save_line_notes PARAMS ((int, rtx, rtx)); extern void save_line_notes (int, rtx, rtx);
extern void restore_line_notes PARAMS ((rtx, rtx)); extern void restore_line_notes (rtx, rtx);
extern void rm_redundant_line_notes PARAMS ((void)); extern void rm_redundant_line_notes (void);
extern void rm_other_notes PARAMS ((rtx, rtx)); extern void rm_other_notes (rtx, rtx);
extern int insn_issue_delay PARAMS ((rtx)); extern int insn_issue_delay (rtx);
extern int set_priorities PARAMS ((rtx, rtx)); extern int set_priorities (rtx, rtx);
extern rtx sched_emit_insn PARAMS ((rtx)); extern rtx sched_emit_insn (rtx);
extern void schedule_block PARAMS ((int, int)); extern void schedule_block (int, int);
extern void sched_init PARAMS ((FILE *)); extern void sched_init (FILE *);
extern void sched_finish PARAMS ((void)); extern void sched_finish (void);
extern void ready_add PARAMS ((struct ready_list *, rtx)); extern void ready_add (struct ready_list *, rtx);
/* The following are exported for the benefit of debugging functions. It /* The following are exported for the benefit of debugging functions. It
would be nicer to keep them private to haifa-sched.c. */ would be nicer to keep them private to haifa-sched.c. */
extern int insn_unit PARAMS ((rtx)); extern int insn_unit (rtx);
extern int insn_cost PARAMS ((rtx, rtx, rtx)); extern int insn_cost (rtx, rtx, rtx);
extern rtx get_unit_last_insn PARAMS ((int)); extern rtx get_unit_last_insn (int);
extern int actual_hazard_this_instance PARAMS ((int, int, rtx, int, int)); extern int actual_hazard_this_instance (int, int, rtx, int, int);
extern void print_insn PARAMS ((char *, rtx, int)); extern void print_insn (char *, rtx, int);
/* Instruction scheduling pass. /* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2002 Free Software Foundation, Inc. 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by, Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com) and currently maintained by, Jim Wilson (wilson@cygnus.com)
...@@ -47,17 +47,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -47,17 +47,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static int target_units = 0; static int target_units = 0;
static char *safe_concat PARAMS ((char *, char *, const char *)); static char *safe_concat (char *, char *, const char *);
static int get_visual_tbl_length PARAMS ((void)); static int get_visual_tbl_length (void);
static void print_exp PARAMS ((char *, rtx, int)); static void print_exp (char *, rtx, int);
static void print_value PARAMS ((char *, rtx, int)); static void print_value (char *, rtx, int);
static void print_pattern PARAMS ((char *, rtx, int)); static void print_pattern (char *, rtx, int);
/* Print names of units on which insn can/should execute, for debugging. */ /* Print names of units on which insn can/should execute, for debugging. */
void void
insn_print_units (insn) insn_print_units (rtx insn)
rtx insn;
{ {
int i; int i;
int unit = insn_unit (insn); int unit = insn_unit (insn);
...@@ -98,7 +97,7 @@ rtx vis_no_unit[MAX_VISUAL_NO_UNIT]; ...@@ -98,7 +97,7 @@ rtx vis_no_unit[MAX_VISUAL_NO_UNIT];
for visualization. */ for visualization. */
void void
init_target_units () init_target_units (void)
{ {
rtx insn; rtx insn;
int unit; int unit;
...@@ -120,7 +119,7 @@ init_target_units () ...@@ -120,7 +119,7 @@ init_target_units ()
/* Return the length of the visualization table. */ /* Return the length of the visualization table. */
static int static int
get_visual_tbl_length () get_visual_tbl_length (void)
{ {
int unit, i; int unit, i;
int n, n1; int n, n1;
...@@ -158,7 +157,7 @@ get_visual_tbl_length () ...@@ -158,7 +157,7 @@ get_visual_tbl_length ()
/* Init block visualization debugging info. */ /* Init block visualization debugging info. */
void void
init_block_visualization () init_block_visualization (void)
{ {
strcpy (visual_tbl, ""); strcpy (visual_tbl, "");
n_visual_lines = 0; n_visual_lines = 0;
...@@ -168,10 +167,7 @@ init_block_visualization () ...@@ -168,10 +167,7 @@ init_block_visualization ()
#define BUF_LEN 2048 #define BUF_LEN 2048
static char * static char *
safe_concat (buf, cur, str) safe_concat (char *buf, char *cur, const char *str)
char *buf;
char *cur;
const char *str;
{ {
char *end = buf + BUF_LEN - 2; /* Leave room for null. */ char *end = buf + BUF_LEN - 2; /* Leave room for null. */
int c; int c;
...@@ -194,10 +190,7 @@ safe_concat (buf, cur, str) ...@@ -194,10 +190,7 @@ safe_concat (buf, cur, str)
may be stored in objects representing values. */ may be stored in objects representing values. */
static void static void
print_exp (buf, x, verbose) print_exp (char *buf, rtx x, int verbose)
char *buf;
rtx x;
int verbose;
{ {
char tmp[BUF_LEN]; char tmp[BUF_LEN];
const char *st[4]; const char *st[4];
...@@ -548,10 +541,7 @@ print_exp (buf, x, verbose) ...@@ -548,10 +541,7 @@ print_exp (buf, x, verbose)
registers, labels, symbols and memory accesses. */ registers, labels, symbols and memory accesses. */
static void static void
print_value (buf, x, verbose) print_value (char *buf, rtx x, int verbose)
char *buf;
rtx x;
int verbose;
{ {
char t[BUF_LEN]; char t[BUF_LEN];
char *cur = buf; char *cur = buf;
...@@ -641,10 +631,7 @@ print_value (buf, x, verbose) ...@@ -641,10 +631,7 @@ print_value (buf, x, verbose)
/* The next step in insn detalization, its pattern recognition. */ /* The next step in insn detalization, its pattern recognition. */
static void static void
print_pattern (buf, x, verbose) print_pattern (char *buf, rtx x, int verbose)
char *buf;
rtx x;
int verbose;
{ {
char t1[BUF_LEN], t2[BUF_LEN], t3[BUF_LEN]; char t1[BUF_LEN], t2[BUF_LEN], t3[BUF_LEN];
...@@ -755,10 +742,7 @@ print_pattern (buf, x, verbose) ...@@ -755,10 +742,7 @@ print_pattern (buf, x, verbose)
depends now on sched.c inner variables ...) */ depends now on sched.c inner variables ...) */
void void
print_insn (buf, x, verbose) print_insn (char *buf, rtx x, int verbose)
char *buf;
rtx x;
int verbose;
{ {
char t[BUF_LEN]; char t[BUF_LEN];
rtx insn = x; rtx insn = x;
...@@ -824,8 +808,7 @@ print_insn (buf, x, verbose) ...@@ -824,8 +808,7 @@ print_insn (buf, x, verbose)
description should never use the following function. */ description should never use the following function. */
void void
print_block_visualization (s) print_block_visualization (const char *s)
const char *s;
{ {
int unit, i; int unit, i;
...@@ -854,8 +837,7 @@ print_block_visualization (s) ...@@ -854,8 +837,7 @@ print_block_visualization (s)
/* Print insns in the 'no_unit' column of visualization. */ /* Print insns in the 'no_unit' column of visualization. */
void void
visualize_no_unit (insn) visualize_no_unit (rtx insn)
rtx insn;
{ {
if (n_vis_no_unit < MAX_VISUAL_NO_UNIT) if (n_vis_no_unit < MAX_VISUAL_NO_UNIT)
{ {
...@@ -867,8 +849,7 @@ visualize_no_unit (insn) ...@@ -867,8 +849,7 @@ visualize_no_unit (insn)
/* Print insns scheduled in clock, for visualization. */ /* Print insns scheduled in clock, for visualization. */
void void
visualize_scheduled_insns (clock) visualize_scheduled_insns (int clock)
int clock;
{ {
int i, unit; int i, unit;
...@@ -914,8 +895,7 @@ visualize_scheduled_insns (clock) ...@@ -914,8 +895,7 @@ visualize_scheduled_insns (clock)
/* Print stalled cycles. */ /* Print stalled cycles. */
void void
visualize_stall_cycles (stalls) visualize_stall_cycles (int stalls)
int stalls;
{ {
static const char *const prefix = ";; "; static const char *const prefix = ";; ";
const char *suffix = "\n"; const char *suffix = "\n";
...@@ -950,7 +930,7 @@ visualize_stall_cycles (stalls) ...@@ -950,7 +930,7 @@ visualize_stall_cycles (stalls)
/* Allocate data used for visualization during scheduling. */ /* Allocate data used for visualization during scheduling. */
void void
visualize_alloc () visualize_alloc (void)
{ {
visual_tbl = xmalloc (get_visual_tbl_length ()); visual_tbl = xmalloc (get_visual_tbl_length ());
} }
...@@ -958,7 +938,7 @@ visualize_alloc () ...@@ -958,7 +938,7 @@ visualize_alloc ()
/* Free data used for visualization. */ /* Free data used for visualization. */
void void
visualize_free () visualize_free (void)
{ {
free (visual_tbl); free (visual_tbl);
} }
......
/* Generic sibling call optimization support /* Generic sibling call optimization support
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -40,18 +41,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -40,18 +41,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
return in the sibcall sequence. */ return in the sibcall sequence. */
static rtx return_value_pseudo; static rtx return_value_pseudo;
static int identify_call_return_value PARAMS ((rtx, rtx *, rtx *)); static int identify_call_return_value (rtx, rtx *, rtx *);
static rtx skip_copy_to_return_value PARAMS ((rtx)); static rtx skip_copy_to_return_value (rtx);
static rtx skip_use_of_return_value PARAMS ((rtx, enum rtx_code)); static rtx skip_use_of_return_value (rtx, enum rtx_code);
static rtx skip_stack_adjustment PARAMS ((rtx)); static rtx skip_stack_adjustment (rtx);
static rtx skip_pic_restore PARAMS ((rtx)); static rtx skip_pic_restore (rtx);
static rtx skip_jump_insn PARAMS ((rtx)); static rtx skip_jump_insn (rtx);
static int call_ends_block_p PARAMS ((rtx, rtx)); static int call_ends_block_p (rtx, rtx);
static int uses_addressof PARAMS ((rtx)); static int uses_addressof (rtx);
static int sequence_uses_addressof PARAMS ((rtx)); static int sequence_uses_addressof (rtx);
static void purge_reg_equiv_notes PARAMS ((void)); static void purge_reg_equiv_notes (void);
static void purge_mem_unchanging_flag PARAMS ((rtx)); static void purge_mem_unchanging_flag (rtx);
static rtx skip_unreturned_value PARAMS ((rtx)); static rtx skip_unreturned_value (rtx);
/* Examine a CALL_PLACEHOLDER pattern and determine where the call's /* Examine a CALL_PLACEHOLDER pattern and determine where the call's
return value is located. P_HARD_RETURN receives the hard register return value is located. P_HARD_RETURN receives the hard register
...@@ -59,9 +60,7 @@ static rtx skip_unreturned_value PARAMS ((rtx)); ...@@ -59,9 +60,7 @@ static rtx skip_unreturned_value PARAMS ((rtx));
that the sequence used. Return nonzero if the values were located. */ that the sequence used. Return nonzero if the values were located. */
static int static int
identify_call_return_value (cp, p_hard_return, p_soft_return) identify_call_return_value (rtx cp, rtx *p_hard_return, rtx *p_soft_return)
rtx cp;
rtx *p_hard_return, *p_soft_return;
{ {
rtx insn, set, hard, soft; rtx insn, set, hard, soft;
...@@ -142,8 +141,7 @@ identify_call_return_value (cp, p_hard_return, p_soft_return) ...@@ -142,8 +141,7 @@ identify_call_return_value (cp, p_hard_return, p_soft_return)
copy. Otherwise return ORIG_INSN. */ copy. Otherwise return ORIG_INSN. */
static rtx static rtx
skip_copy_to_return_value (orig_insn) skip_copy_to_return_value (rtx orig_insn)
rtx orig_insn;
{ {
rtx insn, set = NULL_RTX; rtx insn, set = NULL_RTX;
rtx hardret, softret; rtx hardret, softret;
...@@ -219,9 +217,7 @@ skip_copy_to_return_value (orig_insn) ...@@ -219,9 +217,7 @@ skip_copy_to_return_value (orig_insn)
value, return insn. Otherwise return ORIG_INSN. */ value, return insn. Otherwise return ORIG_INSN. */
static rtx static rtx
skip_use_of_return_value (orig_insn, code) skip_use_of_return_value (rtx orig_insn, enum rtx_code code)
rtx orig_insn;
enum rtx_code code;
{ {
rtx insn; rtx insn;
...@@ -240,8 +236,7 @@ skip_use_of_return_value (orig_insn, code) ...@@ -240,8 +236,7 @@ skip_use_of_return_value (orig_insn, code)
/* In case function does not return value, we get clobber of pseudo followed /* In case function does not return value, we get clobber of pseudo followed
by set to hard return value. */ by set to hard return value. */
static rtx static rtx
skip_unreturned_value (orig_insn) skip_unreturned_value (rtx orig_insn)
rtx orig_insn;
{ {
rtx insn = next_nonnote_insn (orig_insn); rtx insn = next_nonnote_insn (orig_insn);
...@@ -271,8 +266,7 @@ skip_unreturned_value (orig_insn) ...@@ -271,8 +266,7 @@ skip_unreturned_value (orig_insn)
Otherwise return ORIG_INSN. */ Otherwise return ORIG_INSN. */
static rtx static rtx
skip_stack_adjustment (orig_insn) skip_stack_adjustment (rtx orig_insn)
rtx orig_insn;
{ {
rtx insn, set = NULL_RTX; rtx insn, set = NULL_RTX;
...@@ -296,8 +290,7 @@ skip_stack_adjustment (orig_insn) ...@@ -296,8 +290,7 @@ skip_stack_adjustment (orig_insn)
return it. Otherwise return ORIG_INSN. */ return it. Otherwise return ORIG_INSN. */
static rtx static rtx
skip_pic_restore (orig_insn) skip_pic_restore (rtx orig_insn)
rtx orig_insn;
{ {
rtx insn, set = NULL_RTX; rtx insn, set = NULL_RTX;
...@@ -316,8 +309,7 @@ skip_pic_restore (orig_insn) ...@@ -316,8 +309,7 @@ skip_pic_restore (orig_insn)
Otherwise return ORIG_INSN. */ Otherwise return ORIG_INSN. */
static rtx static rtx
skip_jump_insn (orig_insn) skip_jump_insn (rtx orig_insn)
rtx orig_insn;
{ {
rtx insn; rtx insn;
...@@ -335,9 +327,7 @@ skip_jump_insn (orig_insn) ...@@ -335,9 +327,7 @@ skip_jump_insn (orig_insn)
goes all the way to END, the end of a basic block. Return 1 if so. */ goes all the way to END, the end of a basic block. Return 1 if so. */
static int static int
call_ends_block_p (insn, end) call_ends_block_p (rtx insn, rtx end)
rtx insn;
rtx end;
{ {
rtx new_insn; rtx new_insn;
/* END might be a note, so get the last nonnote insn of the block. */ /* END might be a note, so get the last nonnote insn of the block. */
...@@ -394,8 +384,7 @@ call_ends_block_p (insn, end) ...@@ -394,8 +384,7 @@ call_ends_block_p (insn, end)
is found outside of some MEM expression, else return zero. */ is found outside of some MEM expression, else return zero. */
static int static int
uses_addressof (x) uses_addressof (rtx x)
rtx x;
{ {
RTX_CODE code; RTX_CODE code;
int i, j; int i, j;
...@@ -441,8 +430,7 @@ uses_addressof (x) ...@@ -441,8 +430,7 @@ uses_addressof (x)
of insns. */ of insns. */
static int static int
sequence_uses_addressof (seq) sequence_uses_addressof (rtx seq)
rtx seq;
{ {
rtx insn; rtx insn;
...@@ -474,7 +462,7 @@ sequence_uses_addressof (seq) ...@@ -474,7 +462,7 @@ sequence_uses_addressof (seq)
/* Remove all REG_EQUIV notes found in the insn chain. */ /* Remove all REG_EQUIV notes found in the insn chain. */
static void static void
purge_reg_equiv_notes () purge_reg_equiv_notes (void)
{ {
rtx insn; rtx insn;
...@@ -498,8 +486,7 @@ purge_reg_equiv_notes () ...@@ -498,8 +486,7 @@ purge_reg_equiv_notes ()
/* Clear RTX_UNCHANGING_P flag of incoming argument MEMs. */ /* Clear RTX_UNCHANGING_P flag of incoming argument MEMs. */
static void static void
purge_mem_unchanging_flag (x) purge_mem_unchanging_flag (rtx x)
rtx x;
{ {
RTX_CODE code; RTX_CODE code;
int i, j; int i, j;
...@@ -538,9 +525,7 @@ purge_mem_unchanging_flag (x) ...@@ -538,9 +525,7 @@ purge_mem_unchanging_flag (x)
the CALL_PLACEHOLDER insn; USE tells which child to use. */ the CALL_PLACEHOLDER insn; USE tells which child to use. */
void void
replace_call_placeholder (insn, use) replace_call_placeholder (rtx insn, sibcall_use_t use)
rtx insn;
sibcall_use_t use;
{ {
if (use == sibcall_use_tail_recursion) if (use == sibcall_use_tail_recursion)
emit_insn_before (XEXP (PATTERN (insn), 2), insn); emit_insn_before (XEXP (PATTERN (insn), 2), insn);
...@@ -571,7 +556,7 @@ replace_call_placeholder (insn, use) ...@@ -571,7 +556,7 @@ replace_call_placeholder (insn, use)
Replace the CALL_PLACEHOLDER with an appropriate insn chain. */ Replace the CALL_PLACEHOLDER with an appropriate insn chain. */
void void
optimize_sibling_and_tail_recursive_calls () optimize_sibling_and_tail_recursive_calls (void)
{ {
rtx insn, insns; rtx insn, insns;
basic_block alternate_exit = EXIT_BLOCK_PTR; basic_block alternate_exit = EXIT_BLOCK_PTR;
......
...@@ -49,19 +49,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -49,19 +49,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define HWI_SIGN_EXTEND(low) \ #define HWI_SIGN_EXTEND(low) \
((((HOST_WIDE_INT) low) < 0) ? ((HOST_WIDE_INT) -1) : ((HOST_WIDE_INT) 0)) ((((HOST_WIDE_INT) low) < 0) ? ((HOST_WIDE_INT) -1) : ((HOST_WIDE_INT) 0))
static rtx neg_const_int PARAMS ((enum machine_mode, rtx)); static rtx neg_const_int (enum machine_mode, rtx);
static int simplify_plus_minus_op_data_cmp PARAMS ((const void *, static int simplify_plus_minus_op_data_cmp (const void *, const void *);
const void *)); static rtx simplify_plus_minus (enum rtx_code, enum machine_mode, rtx,
static rtx simplify_plus_minus PARAMS ((enum rtx_code, rtx, int);
enum machine_mode, rtx,
rtx, int));
/* Negate a CONST_INT rtx, truncating (because a conversion from a /* Negate a CONST_INT rtx, truncating (because a conversion from a
maximally negative number can overflow). */ maximally negative number can overflow). */
static rtx static rtx
neg_const_int (mode, i) neg_const_int (enum machine_mode mode, rtx i)
enum machine_mode mode;
rtx i;
{ {
return gen_int_mode (- INTVAL (i), mode); return gen_int_mode (- INTVAL (i), mode);
} }
...@@ -71,10 +67,8 @@ neg_const_int (mode, i) ...@@ -71,10 +67,8 @@ neg_const_int (mode, i)
seeing if the expression folds. */ seeing if the expression folds. */
rtx rtx
simplify_gen_binary (code, mode, op0, op1) simplify_gen_binary (enum rtx_code code, enum machine_mode mode, rtx op0,
enum rtx_code code; rtx op1)
enum machine_mode mode;
rtx op0, op1;
{ {
rtx tem; rtx tem;
...@@ -104,8 +98,7 @@ simplify_gen_binary (code, mode, op0, op1) ...@@ -104,8 +98,7 @@ simplify_gen_binary (code, mode, op0, op1)
/* If X is a MEM referencing the constant pool, return the real value. /* If X is a MEM referencing the constant pool, return the real value.
Otherwise return X. */ Otherwise return X. */
rtx rtx
avoid_constant_pool_reference (x) avoid_constant_pool_reference (rtx x)
rtx x;
{ {
rtx c, tmp, addr; rtx c, tmp, addr;
enum machine_mode cmode; enum machine_mode cmode;
...@@ -163,11 +156,8 @@ avoid_constant_pool_reference (x) ...@@ -163,11 +156,8 @@ avoid_constant_pool_reference (x)
the specified operation. */ the specified operation. */
rtx rtx
simplify_gen_unary (code, mode, op, op_mode) simplify_gen_unary (enum rtx_code code, enum machine_mode mode, rtx op,
enum rtx_code code; enum machine_mode op_mode)
enum machine_mode mode;
rtx op;
enum machine_mode op_mode;
{ {
rtx tem; rtx tem;
...@@ -181,10 +171,8 @@ simplify_gen_unary (code, mode, op, op_mode) ...@@ -181,10 +171,8 @@ simplify_gen_unary (code, mode, op, op_mode)
/* Likewise for ternary operations. */ /* Likewise for ternary operations. */
rtx rtx
simplify_gen_ternary (code, mode, op0_mode, op0, op1, op2) simplify_gen_ternary (enum rtx_code code, enum machine_mode mode,
enum rtx_code code; enum machine_mode op0_mode, rtx op0, rtx op1, rtx op2)
enum machine_mode mode, op0_mode;
rtx op0, op1, op2;
{ {
rtx tem; rtx tem;
...@@ -201,11 +189,8 @@ simplify_gen_ternary (code, mode, op0_mode, op0, op1, op2) ...@@ -201,11 +189,8 @@ simplify_gen_ternary (code, mode, op0_mode, op0, op1, op2)
*/ */
rtx rtx
simplify_gen_relational (code, mode, cmp_mode, op0, op1) simplify_gen_relational (enum rtx_code code, enum machine_mode mode,
enum rtx_code code; enum machine_mode cmp_mode, rtx op0, rtx op1)
enum machine_mode mode;
enum machine_mode cmp_mode;
rtx op0, op1;
{ {
rtx tem; rtx tem;
...@@ -248,10 +233,7 @@ simplify_gen_relational (code, mode, cmp_mode, op0, op1) ...@@ -248,10 +233,7 @@ simplify_gen_relational (code, mode, cmp_mode, op0, op1)
resulting RTX. Return a new RTX which is as simplified as possible. */ resulting RTX. Return a new RTX which is as simplified as possible. */
rtx rtx
simplify_replace_rtx (x, old, new) simplify_replace_rtx (rtx x, rtx old, rtx new)
rtx x;
rtx old;
rtx new;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
...@@ -321,7 +303,7 @@ simplify_replace_rtx (x, old, new) ...@@ -321,7 +303,7 @@ simplify_replace_rtx (x, old, new)
rtx exp; rtx exp;
exp = simplify_gen_subreg (GET_MODE (x), exp = simplify_gen_subreg (GET_MODE (x),
simplify_replace_rtx (SUBREG_REG (x), simplify_replace_rtx (SUBREG_REG (x),
old, new), old, new),
GET_MODE (SUBREG_REG (x)), GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x)); SUBREG_BYTE (x));
if (exp) if (exp)
...@@ -363,11 +345,8 @@ simplify_replace_rtx (x, old, new) ...@@ -363,11 +345,8 @@ simplify_replace_rtx (x, old, new)
MODE with input operand OP whose mode was originally OP_MODE. MODE with input operand OP whose mode was originally OP_MODE.
Return zero if no simplification can be made. */ Return zero if no simplification can be made. */
rtx rtx
simplify_unary_operation (code, mode, op, op_mode) simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
enum rtx_code code; rtx op, enum machine_mode op_mode)
enum machine_mode mode;
rtx op;
enum machine_mode op_mode;
{ {
unsigned int width = GET_MODE_BITSIZE (mode); unsigned int width = GET_MODE_BITSIZE (mode);
rtx trueop = avoid_constant_pool_reference (op); rtx trueop = avoid_constant_pool_reference (op);
...@@ -872,10 +851,8 @@ simplify_unary_operation (code, mode, op, op_mode) ...@@ -872,10 +851,8 @@ simplify_unary_operation (code, mode, op, op_mode)
Don't use this for relational operations such as EQ or LT. Don't use this for relational operations such as EQ or LT.
Use simplify_relational_operation instead. */ Use simplify_relational_operation instead. */
rtx rtx
simplify_binary_operation (code, mode, op0, op1) simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
enum rtx_code code; rtx op0, rtx op1)
enum machine_mode mode;
rtx op0, op1;
{ {
HOST_WIDE_INT arg0, arg1, arg0s, arg1s; HOST_WIDE_INT arg0, arg1, arg0s, arg1s;
HOST_WIDE_INT val; HOST_WIDE_INT val;
...@@ -1898,9 +1875,7 @@ struct simplify_plus_minus_op_data ...@@ -1898,9 +1875,7 @@ struct simplify_plus_minus_op_data
}; };
static int static int
simplify_plus_minus_op_data_cmp (p1, p2) simplify_plus_minus_op_data_cmp (const void *p1, const void *p2)
const void *p1;
const void *p2;
{ {
const struct simplify_plus_minus_op_data *d1 = p1; const struct simplify_plus_minus_op_data *d1 = p1;
const struct simplify_plus_minus_op_data *d2 = p2; const struct simplify_plus_minus_op_data *d2 = p2;
...@@ -1910,11 +1885,8 @@ simplify_plus_minus_op_data_cmp (p1, p2) ...@@ -1910,11 +1885,8 @@ simplify_plus_minus_op_data_cmp (p1, p2)
} }
static rtx static rtx
simplify_plus_minus (code, mode, op0, op1, force) simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
enum rtx_code code; rtx op1, int force)
enum machine_mode mode;
rtx op0, op1;
int force;
{ {
struct simplify_plus_minus_op_data ops[8]; struct simplify_plus_minus_op_data ops[8];
rtx result, tem; rtx result, tem;
...@@ -2160,10 +2132,8 @@ simplify_plus_minus (code, mode, op0, op1, force) ...@@ -2160,10 +2132,8 @@ simplify_plus_minus (code, mode, op0, op1, force)
it returns either const_true_rtx or const0_rtx. */ it returns either const_true_rtx or const0_rtx. */
rtx rtx
simplify_relational_operation (code, mode, op0, op1) simplify_relational_operation (enum rtx_code code, enum machine_mode mode,
enum rtx_code code; rtx op0, rtx op1)
enum machine_mode mode;
rtx op0, op1;
{ {
int equal, op0lt, op0ltu, op1lt, op1ltu; int equal, op0lt, op0ltu, op1lt, op1ltu;
rtx tem; rtx tem;
...@@ -2397,7 +2367,7 @@ simplify_relational_operation (code, mode, op0, op1) ...@@ -2397,7 +2367,7 @@ simplify_relational_operation (code, mode, op0, op1)
return const_true_rtx; return const_true_rtx;
} }
break; break;
default: default:
break; break;
} }
...@@ -2449,10 +2419,9 @@ simplify_relational_operation (code, mode, op0, op1) ...@@ -2449,10 +2419,9 @@ simplify_relational_operation (code, mode, op0, op1)
a constant. Return 0 if no simplifications is possible. */ a constant. Return 0 if no simplifications is possible. */
rtx rtx
simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) simplify_ternary_operation (enum rtx_code code, enum machine_mode mode,
enum rtx_code code; enum machine_mode op0_mode, rtx op0, rtx op1,
enum machine_mode mode, op0_mode; rtx op2)
rtx op0, op1, op2;
{ {
unsigned int width = GET_MODE_BITSIZE (mode); unsigned int width = GET_MODE_BITSIZE (mode);
...@@ -2603,10 +2572,8 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) ...@@ -2603,10 +2572,8 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)
/* Simplify SUBREG:OUTERMODE(OP:INNERMODE, BYTE) /* Simplify SUBREG:OUTERMODE(OP:INNERMODE, BYTE)
Return 0 if no simplifications is possible. */ Return 0 if no simplifications is possible. */
rtx rtx
simplify_subreg (outermode, op, innermode, byte) simplify_subreg (enum machine_mode outermode, rtx op,
rtx op; enum machine_mode innermode, unsigned int byte)
unsigned int byte;
enum machine_mode outermode, innermode;
{ {
/* Little bit of sanity checking. */ /* Little bit of sanity checking. */
if (innermode == VOIDmode || outermode == VOIDmode if (innermode == VOIDmode || outermode == VOIDmode
...@@ -2989,10 +2956,8 @@ simplify_subreg (outermode, op, innermode, byte) ...@@ -2989,10 +2956,8 @@ simplify_subreg (outermode, op, innermode, byte)
/* Make a SUBREG operation or equivalent if it folds. */ /* Make a SUBREG operation or equivalent if it folds. */
rtx rtx
simplify_gen_subreg (outermode, op, innermode, byte) simplify_gen_subreg (enum machine_mode outermode, rtx op,
rtx op; enum machine_mode innermode, unsigned int byte)
unsigned int byte;
enum machine_mode outermode, innermode;
{ {
rtx new; rtx new;
/* Little bit of sanity checking. */ /* Little bit of sanity checking. */
...@@ -3061,8 +3026,7 @@ simplify_gen_subreg (outermode, op, innermode, byte) ...@@ -3061,8 +3026,7 @@ simplify_gen_subreg (outermode, op, innermode, byte)
simplification and 1 for tree simplification. */ simplification and 1 for tree simplification. */
rtx rtx
simplify_rtx (x) simplify_rtx (rtx x)
rtx x;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
......
...@@ -24,7 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -24,7 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
Value of sreal is Value of sreal is
x = sig * 2 ^ exp x = sig * 2 ^ exp
where where
sig = significant sig = significant
(for < 64-bit machines sig = sig_lo + sig_hi * 2 ^ SREAL_PART_BITS) (for < 64-bit machines sig = sig_lo + sig_hi * 2 ^ SREAL_PART_BITS)
exp = exponent exp = exponent
...@@ -35,13 +35,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -35,13 +35,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
Only a half of significant bits is used (in normalized sreals) so that we do Only a half of significant bits is used (in normalized sreals) so that we do
not have problems with overflow, for example when c->sig = a->sig * b->sig. not have problems with overflow, for example when c->sig = a->sig * b->sig.
So the precision for 64-bit and 32-bit machines is 32-bit. So the precision for 64-bit and 32-bit machines is 32-bit.
Invariant: The numbers are normalized before and after each call of sreal_*. Invariant: The numbers are normalized before and after each call of sreal_*.
Normalized sreals: Normalized sreals:
All numbers (except zero) meet following conditions: All numbers (except zero) meet following conditions:
SREAL_MIN_SIG <= sig && sig <= SREAL_MAX_SIG SREAL_MIN_SIG <= sig && sig <= SREAL_MAX_SIG
-SREAL_MAX_EXP <= exp && exp <= SREAL_MAX_EXP -SREAL_MAX_EXP <= exp && exp <= SREAL_MAX_EXP
If the number would be too large, it is set to upper bounds of these If the number would be too large, it is set to upper bounds of these
conditions. conditions.
...@@ -56,16 +56,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -56,16 +56,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h" #include "tm.h"
#include "sreal.h" #include "sreal.h"
static inline void copy PARAMS ((sreal *, sreal *)); static inline void copy (sreal *, sreal *);
static inline void shift_right PARAMS ((sreal *, int)); static inline void shift_right (sreal *, int);
static void normalize PARAMS ((sreal *)); static void normalize (sreal *);
/* Print the content of struct sreal. */ /* Print the content of struct sreal. */
void void
dump_sreal (file, x) dump_sreal (FILE *file, sreal *x)
FILE *file;
sreal *x;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
fprintf (file, "((" HOST_WIDE_INT_PRINT_UNSIGNED " * 2^16 + " fprintf (file, "((" HOST_WIDE_INT_PRINT_UNSIGNED " * 2^16 + "
...@@ -79,9 +77,7 @@ dump_sreal (file, x) ...@@ -79,9 +77,7 @@ dump_sreal (file, x)
/* Copy the sreal number. */ /* Copy the sreal number. */
static inline void static inline void
copy (r, a) copy (sreal *r, sreal *a)
sreal *r;
sreal *a;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
r->sig_lo = a->sig_lo; r->sig_lo = a->sig_lo;
...@@ -96,9 +92,7 @@ copy (r, a) ...@@ -96,9 +92,7 @@ copy (r, a)
When the most significant bit shifted out is 1, add 1 to X (rounding). */ When the most significant bit shifted out is 1, add 1 to X (rounding). */
static inline void static inline void
shift_right (x, s) shift_right (sreal *x, int s)
sreal *x;
int s;
{ {
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
if (s <= 0 || s > SREAL_BITS) if (s <= 0 || s > SREAL_BITS)
...@@ -143,13 +137,12 @@ shift_right (x, s) ...@@ -143,13 +137,12 @@ shift_right (x, s)
/* Normalize *X. */ /* Normalize *X. */
static void static void
normalize (x) normalize (sreal *x)
sreal *x;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
int shift; int shift;
HOST_WIDE_INT mask; HOST_WIDE_INT mask;
if (x->sig_lo == 0 && x->sig_hi == 0) if (x->sig_lo == 0 && x->sig_hi == 0)
{ {
x->exp = -SREAL_MAX_EXP; x->exp = -SREAL_MAX_EXP;
...@@ -280,10 +273,7 @@ normalize (x) ...@@ -280,10 +273,7 @@ normalize (x)
/* Set *R to SIG * 2 ^ EXP. Return R. */ /* Set *R to SIG * 2 ^ EXP. Return R. */
sreal * sreal *
sreal_init (r, sig, exp) sreal_init (sreal *r, unsigned HOST_WIDE_INT sig, signed int exp)
sreal *r;
unsigned HOST_WIDE_INT sig;
signed int exp;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
r->sig_lo = 0; r->sig_lo = 0;
...@@ -300,8 +290,7 @@ sreal_init (r, sig, exp) ...@@ -300,8 +290,7 @@ sreal_init (r, sig, exp)
/* Return integer value of *R. */ /* Return integer value of *R. */
HOST_WIDE_INT HOST_WIDE_INT
sreal_to_int (r) sreal_to_int (sreal *r)
sreal *r;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
if (r->exp <= -SREAL_BITS) if (r->exp <= -SREAL_BITS)
...@@ -325,9 +314,7 @@ sreal_to_int (r) ...@@ -325,9 +314,7 @@ sreal_to_int (r)
/* Compare *A and *B. Return -1 if *A < *B, 1 if *A > *B and 0 if *A == *B. */ /* Compare *A and *B. Return -1 if *A < *B, 1 if *A > *B and 0 if *A == *B. */
int int
sreal_compare (a, b) sreal_compare (sreal *a, sreal *b)
sreal *a;
sreal *b;
{ {
if (a->exp > b->exp) if (a->exp > b->exp)
return 1; return 1;
...@@ -354,10 +341,7 @@ sreal_compare (a, b) ...@@ -354,10 +341,7 @@ sreal_compare (a, b)
/* *R = *A + *B. Return R. */ /* *R = *A + *B. Return R. */
sreal * sreal *
sreal_add (r, a, b) sreal_add (sreal *r, sreal *a, sreal *b)
sreal *r;
sreal *a;
sreal *b;
{ {
int dexp; int dexp;
sreal tmp; sreal tmp;
...@@ -411,10 +395,7 @@ sreal_add (r, a, b) ...@@ -411,10 +395,7 @@ sreal_add (r, a, b)
/* *R = *A - *B. Return R. */ /* *R = *A - *B. Return R. */
sreal * sreal *
sreal_sub (r, a, b) sreal_sub (sreal *r, sreal *a, sreal *b)
sreal *r;
sreal *a;
sreal *b;
{ {
int dexp; int dexp;
sreal tmp; sreal tmp;
...@@ -467,10 +448,7 @@ sreal_sub (r, a, b) ...@@ -467,10 +448,7 @@ sreal_sub (r, a, b)
/* *R = *A * *B. Return R. */ /* *R = *A * *B. Return R. */
sreal * sreal *
sreal_mul (r, a, b) sreal_mul (sreal *r, sreal *a, sreal *b)
sreal *r;
sreal *a;
sreal *b;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
if (a->sig_hi < SREAL_MIN_SIG || b->sig_hi < SREAL_MIN_SIG) if (a->sig_hi < SREAL_MIN_SIG || b->sig_hi < SREAL_MIN_SIG)
...@@ -526,10 +504,7 @@ sreal_mul (r, a, b) ...@@ -526,10 +504,7 @@ sreal_mul (r, a, b)
/* *R = *A / *B. Return R. */ /* *R = *A / *B. Return R. */
sreal * sreal *
sreal_div (r, a, b) sreal_div (sreal *r, sreal *a, sreal *b)
sreal *r;
sreal *a;
sreal *b;
{ {
#if SREAL_PART_BITS < 32 #if SREAL_PART_BITS < 32
unsigned HOST_WIDE_INT tmp, tmp1, tmp2; unsigned HOST_WIDE_INT tmp, tmp1, tmp2;
......
/* Definitions for simple data type for positive real numbers. /* Definitions for simple data type for positive real numbers.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -53,15 +53,13 @@ typedef struct sreal ...@@ -53,15 +53,13 @@ typedef struct sreal
signed int exp; /* Exponent. */ signed int exp; /* Exponent. */
} sreal; } sreal;
extern void dump_sreal PARAMS ((FILE *, sreal *)); extern void dump_sreal (FILE *, sreal *);
extern sreal *sreal_init PARAMS ((sreal *, extern sreal *sreal_init (sreal *, unsigned HOST_WIDE_INT, signed int);
unsigned HOST_WIDE_INT, extern HOST_WIDE_INT sreal_to_int (sreal *);
signed int)); extern int sreal_compare (sreal *, sreal *);
extern HOST_WIDE_INT sreal_to_int PARAMS ((sreal *)); extern sreal *sreal_add (sreal *, sreal *, sreal *);
extern int sreal_compare PARAMS ((sreal *, sreal *)); extern sreal *sreal_sub (sreal *, sreal *, sreal *);
extern sreal *sreal_add PARAMS ((sreal *, sreal *, sreal *)); extern sreal *sreal_mul (sreal *, sreal *, sreal *);
extern sreal *sreal_sub PARAMS ((sreal *, sreal *, sreal *)); extern sreal *sreal_div (sreal *, sreal *, sreal *);
extern sreal *sreal_mul PARAMS ((sreal *, sreal *, sreal *));
extern sreal *sreal_div PARAMS ((sreal *, sreal *, sreal *));
#endif #endif
/* Conditional constant propagation pass for the GNU compiler. /* Conditional constant propagation pass for the GNU compiler.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Original framework by Daniel Berlin <dan@cgsoftware.com> Original framework by Daniel Berlin <dan@cgsoftware.com>
Fleshed out and major cleanups by Jeff Law <law@redhat.com> Fleshed out and major cleanups by Jeff Law <law@redhat.com>
...@@ -124,24 +124,22 @@ static sbitmap ssa_edges; ...@@ -124,24 +124,22 @@ static sbitmap ssa_edges;
#define SSA_NAME(x) REGNO (SET_DEST (x)) #define SSA_NAME(x) REGNO (SET_DEST (x))
#define EIE(x,y) EDGE_INDEX (edges, x, y) #define EIE(x,y) EDGE_INDEX (edges, x, y)
static void visit_phi_node PARAMS ((rtx, basic_block)); static void visit_phi_node (rtx, basic_block);
static void visit_expression PARAMS ((rtx, basic_block)); static void visit_expression (rtx, basic_block);
static void defs_to_undefined PARAMS ((rtx)); static void defs_to_undefined (rtx);
static void defs_to_varying PARAMS ((rtx)); static void defs_to_varying (rtx);
static void examine_flow_edges PARAMS ((void)); static void examine_flow_edges (void);
static int mark_references PARAMS ((rtx *, void *)); static int mark_references (rtx *, void *);
static void follow_def_use_chains PARAMS ((void)); static void follow_def_use_chains (void);
static void optimize_unexecutable_edges PARAMS ((struct edge_list *, sbitmap)); static void optimize_unexecutable_edges (struct edge_list *, sbitmap);
static void ssa_ccp_substitute_constants PARAMS ((void)); static void ssa_ccp_substitute_constants (void);
static void ssa_ccp_df_delete_unreachable_insns PARAMS ((void)); static void ssa_ccp_df_delete_unreachable_insns (void);
static void ssa_fast_dce PARAMS ((struct df *)); static void ssa_fast_dce (struct df *);
/* Loop through the PHI_NODE's parameters for BLOCK and compare their /* Loop through the PHI_NODE's parameters for BLOCK and compare their
lattice values to determine PHI_NODE's lattice value. */ lattice values to determine PHI_NODE's lattice value. */
static void static void
visit_phi_node (phi_node, block) visit_phi_node (rtx phi_node, basic_block block)
rtx phi_node;
basic_block block;
{ {
unsigned int i; unsigned int i;
rtx phi_node_expr = NULL; rtx phi_node_expr = NULL;
...@@ -210,8 +208,7 @@ visit_phi_node (phi_node, block) ...@@ -210,8 +208,7 @@ visit_phi_node (phi_node, block)
/* Sets all defs in an insn to UNDEFINED. */ /* Sets all defs in an insn to UNDEFINED. */
static void static void
defs_to_undefined (insn) defs_to_undefined (rtx insn)
rtx insn;
{ {
struct df_link *currdef; struct df_link *currdef;
for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef;
...@@ -225,8 +222,7 @@ defs_to_undefined (insn) ...@@ -225,8 +222,7 @@ defs_to_undefined (insn)
/* Sets all defs in an insn to VARYING. */ /* Sets all defs in an insn to VARYING. */
static void static void
defs_to_varying (insn) defs_to_varying (rtx insn)
rtx insn;
{ {
struct df_link *currdef; struct df_link *currdef;
for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef;
...@@ -241,9 +237,7 @@ defs_to_varying (insn) ...@@ -241,9 +237,7 @@ defs_to_varying (insn)
/* Go through the expression, call the appropriate evaluation routines /* Go through the expression, call the appropriate evaluation routines
to attempt cprop */ to attempt cprop */
static void static void
visit_expression (insn, block) visit_expression (rtx insn, basic_block block)
rtx insn;
basic_block block;
{ {
rtx src, dest, set; rtx src, dest, set;
...@@ -625,7 +619,7 @@ visit_expression (insn, block) ...@@ -625,7 +619,7 @@ visit_expression (insn, block)
/* Iterate over the FLOW_EDGES work list. Simulate the target block /* Iterate over the FLOW_EDGES work list. Simulate the target block
for each edge. */ for each edge. */
static void static void
examine_flow_edges () examine_flow_edges (void)
{ {
while (flow_edges != NULL) while (flow_edges != NULL)
{ {
...@@ -693,7 +687,7 @@ examine_flow_edges () ...@@ -693,7 +687,7 @@ examine_flow_edges ()
simulate the uses of the definition. */ simulate the uses of the definition. */
static void static void
follow_def_use_chains () follow_def_use_chains (void)
{ {
/* Iterate over all the entries on the SSA_EDGES worklist. */ /* Iterate over all the entries on the SSA_EDGES worklist. */
while (sbitmap_first_set_bit (ssa_edges) >= 0) while (sbitmap_first_set_bit (ssa_edges) >= 0)
...@@ -736,9 +730,8 @@ follow_def_use_chains () ...@@ -736,9 +730,8 @@ follow_def_use_chains ()
the edge from the CFG. Note we do not delete unreachable blocks the edge from the CFG. Note we do not delete unreachable blocks
yet as the DF analyzer can not deal with that yet. */ yet as the DF analyzer can not deal with that yet. */
static void static void
optimize_unexecutable_edges (edges, executable_edges) optimize_unexecutable_edges (struct edge_list *edges,
struct edge_list *edges; sbitmap executable_edges)
sbitmap executable_edges;
{ {
int i; int i;
basic_block bb; basic_block bb;
...@@ -849,7 +842,7 @@ optimize_unexecutable_edges (edges, executable_edges) ...@@ -849,7 +842,7 @@ optimize_unexecutable_edges (edges, executable_edges)
replace uses with the known constant value. */ replace uses with the known constant value. */
static void static void
ssa_ccp_substitute_constants () ssa_ccp_substitute_constants (void)
{ {
unsigned int i; unsigned int i;
...@@ -928,7 +921,7 @@ ssa_ccp_substitute_constants () ...@@ -928,7 +921,7 @@ ssa_ccp_substitute_constants ()
updates for the DF analyzer. */ updates for the DF analyzer. */
static void static void
ssa_ccp_df_delete_unreachable_insns () ssa_ccp_df_delete_unreachable_insns (void)
{ {
basic_block b; basic_block b;
...@@ -975,7 +968,7 @@ ssa_ccp_df_delete_unreachable_insns () ...@@ -975,7 +968,7 @@ ssa_ccp_df_delete_unreachable_insns ()
operate on so that it can be called for sub-graphs. */ operate on so that it can be called for sub-graphs. */
void void
ssa_const_prop () ssa_const_prop (void)
{ {
unsigned int i; unsigned int i;
edge curredge; edge curredge;
...@@ -1088,9 +1081,7 @@ ssa_const_prop () ...@@ -1088,9 +1081,7 @@ ssa_const_prop ()
} }
static int static int
mark_references (current_rtx, data) mark_references (rtx *current_rtx, void *data)
rtx *current_rtx;
void *data;
{ {
rtx x = *current_rtx; rtx x = *current_rtx;
sbitmap worklist = (sbitmap) data; sbitmap worklist = (sbitmap) data;
...@@ -1141,8 +1132,7 @@ mark_references (current_rtx, data) ...@@ -1141,8 +1132,7 @@ mark_references (current_rtx, data)
} }
static void static void
ssa_fast_dce (df) ssa_fast_dce (struct df *df)
struct df *df;
{ {
sbitmap worklist = sbitmap_alloc (VARRAY_SIZE (ssa_definition)); sbitmap worklist = sbitmap_alloc (VARRAY_SIZE (ssa_definition));
sbitmap_ones (worklist); sbitmap_ones (worklist);
......
/* Dead-code elimination pass for the GNU compiler. /* Dead-code elimination pass for the GNU compiler.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Jeffrey D. Oldham <oldham@codesourcery.com>. Written by Jeffrey D. Oldham <oldham@codesourcery.com>.
This file is part of GCC. This file is part of GCC.
...@@ -93,30 +93,23 @@ typedef struct { ...@@ -93,30 +93,23 @@ typedef struct {
/* Local function prototypes. */ /* Local function prototypes. */
static control_dependent_block_to_edge_map control_dependent_block_to_edge_map_create static control_dependent_block_to_edge_map control_dependent_block_to_edge_map_create
PARAMS((size_t num_basic_blocks)); (size_t num_basic_blocks);
static void set_control_dependent_block_to_edge_map_bit static void set_control_dependent_block_to_edge_map_bit
PARAMS ((control_dependent_block_to_edge_map c, basic_block bb, (control_dependent_block_to_edge_map c, basic_block bb, int edge_index);
int edge_index));
static void control_dependent_block_to_edge_map_free static void control_dependent_block_to_edge_map_free
PARAMS ((control_dependent_block_to_edge_map c)); (control_dependent_block_to_edge_map c);
static void find_all_control_dependences static void find_all_control_dependences
PARAMS ((struct edge_list *el, dominance_info pdom, (struct edge_list *el, dominance_info pdom,
control_dependent_block_to_edge_map cdbte)); control_dependent_block_to_edge_map cdbte);
static void find_control_dependence static void find_control_dependence
PARAMS ((struct edge_list *el, int edge_index, dominance_info pdom, (struct edge_list *el, int edge_index, dominance_info pdom,
control_dependent_block_to_edge_map cdbte)); control_dependent_block_to_edge_map cdbte);
static basic_block find_pdom static basic_block find_pdom (dominance_info pdom, basic_block block);
PARAMS ((dominance_info pdom, basic_block block)); static int inherently_necessary_register_1 (rtx *current_rtx, void *data);
static int inherently_necessary_register_1 static int inherently_necessary_register (rtx current_rtx);
PARAMS ((rtx *current_rtx, void *data)); static int find_inherently_necessary (rtx current_rtx);
static int inherently_necessary_register static int propagate_necessity_through_operand (rtx *current_rtx, void *data);
PARAMS ((rtx current_rtx)); static void note_inherently_necessary_set (rtx, rtx, void *);
static int find_inherently_necessary
PARAMS ((rtx current_rtx));
static int propagate_necessity_through_operand
PARAMS ((rtx *current_rtx, void *data));
static void note_inherently_necessary_set
PARAMS ((rtx, rtx, void *));
/* Unnecessary insns are indicated using insns' in_struct bit. */ /* Unnecessary insns are indicated using insns' in_struct bit. */
...@@ -126,8 +119,7 @@ static void note_inherently_necessary_set ...@@ -126,8 +119,7 @@ static void note_inherently_necessary_set
#define RESURRECT_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 0 #define RESURRECT_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 0
/* Return nonzero if INSN is unnecessary. */ /* Return nonzero if INSN is unnecessary. */
#define UNNECESSARY_P(INSN) INSN_DEAD_CODE_P(INSN) #define UNNECESSARY_P(INSN) INSN_DEAD_CODE_P(INSN)
static void mark_all_insn_unnecessary static void mark_all_insn_unnecessary (void);
PARAMS ((void));
/* Execute CODE with free variable INSN for all unnecessary insns in /* Execute CODE with free variable INSN for all unnecessary insns in
an unspecified order, producing no output. */ an unspecified order, producing no output. */
#define EXECUTE_IF_UNNECESSARY(INSN, CODE) \ #define EXECUTE_IF_UNNECESSARY(INSN, CODE) \
...@@ -142,11 +134,9 @@ static void mark_all_insn_unnecessary ...@@ -142,11 +134,9 @@ static void mark_all_insn_unnecessary
} }
/* Find the label beginning block BB. */ /* Find the label beginning block BB. */
static rtx find_block_label static rtx find_block_label (basic_block bb);
PARAMS ((basic_block bb));
/* Remove INSN, updating its basic block structure. */ /* Remove INSN, updating its basic block structure. */
static void delete_insn_bb static void delete_insn_bb (rtx insn);
PARAMS ((rtx insn));
/* Recording which blocks are control dependent on which edges. We /* Recording which blocks are control dependent on which edges. We
expect each block to be control dependent on very few edges so we expect each block to be control dependent on very few edges so we
...@@ -161,8 +151,7 @@ static void delete_insn_bb ...@@ -161,8 +151,7 @@ static void delete_insn_bb
control_dependent_block_to_edge_map_free (). */ control_dependent_block_to_edge_map_free (). */
static control_dependent_block_to_edge_map static control_dependent_block_to_edge_map
control_dependent_block_to_edge_map_create (num_basic_blocks) control_dependent_block_to_edge_map_create (size_t num_basic_blocks)
size_t num_basic_blocks;
{ {
int i; int i;
control_dependent_block_to_edge_map c control_dependent_block_to_edge_map c
...@@ -180,10 +169,8 @@ control_dependent_block_to_edge_map_create (num_basic_blocks) ...@@ -180,10 +169,8 @@ control_dependent_block_to_edge_map_create (num_basic_blocks)
control-dependent. */ control-dependent. */
static void static void
set_control_dependent_block_to_edge_map_bit (c, bb, edge_index) set_control_dependent_block_to_edge_map_bit (control_dependent_block_to_edge_map c,
control_dependent_block_to_edge_map c; basic_block bb, int edge_index)
basic_block bb;
int edge_index;
{ {
if (bb->index - (INVALID_BLOCK+1) >= c->length) if (bb->index - (INVALID_BLOCK+1) >= c->length)
abort (); abort ();
...@@ -205,8 +192,7 @@ set_control_dependent_block_to_edge_map_bit (c, bb, edge_index) ...@@ -205,8 +192,7 @@ set_control_dependent_block_to_edge_map_bit (c, bb, edge_index)
/* Destroy a control_dependent_block_to_edge_map C. */ /* Destroy a control_dependent_block_to_edge_map C. */
static void static void
control_dependent_block_to_edge_map_free (c) control_dependent_block_to_edge_map_free (control_dependent_block_to_edge_map c)
control_dependent_block_to_edge_map c;
{ {
int i; int i;
for (i = 0; i < c->length; ++i) for (i = 0; i < c->length; ++i)
...@@ -220,10 +206,8 @@ control_dependent_block_to_edge_map_free (c) ...@@ -220,10 +206,8 @@ control_dependent_block_to_edge_map_free (c)
which should be empty. */ which should be empty. */
static void static void
find_all_control_dependences (el, pdom, cdbte) find_all_control_dependences (struct edge_list *el, dominance_info pdom,
struct edge_list *el; control_dependent_block_to_edge_map cdbte)
dominance_info pdom;
control_dependent_block_to_edge_map cdbte;
{ {
int i; int i;
...@@ -238,11 +222,9 @@ find_all_control_dependences (el, pdom, cdbte) ...@@ -238,11 +222,9 @@ find_all_control_dependences (el, pdom, cdbte)
with zeros in each (block b', edge) position. */ with zeros in each (block b', edge) position. */
static void static void
find_control_dependence (el, edge_index, pdom, cdbte) find_control_dependence (struct edge_list *el, int edge_index,
struct edge_list *el; dominance_info pdom,
int edge_index; control_dependent_block_to_edge_map cdbte)
dominance_info pdom;
control_dependent_block_to_edge_map cdbte;
{ {
basic_block current_block; basic_block current_block;
basic_block ending_block; basic_block ending_block;
...@@ -269,9 +251,7 @@ find_control_dependence (el, edge_index, pdom, cdbte) ...@@ -269,9 +251,7 @@ find_control_dependence (el, edge_index, pdom, cdbte)
negative numbers. */ negative numbers. */
static basic_block static basic_block
find_pdom (pdom, block) find_pdom (dominance_info pdom, basic_block block)
dominance_info pdom;
basic_block block;
{ {
if (!block) if (!block)
abort (); abort ();
...@@ -300,9 +280,8 @@ find_pdom (pdom, block) ...@@ -300,9 +280,8 @@ find_pdom (pdom, block)
particular PC values. */ particular PC values. */
static int static int
inherently_necessary_register_1 (current_rtx, data) inherently_necessary_register_1 (rtx *current_rtx,
rtx *current_rtx; void *data ATTRIBUTE_UNUSED)
void *data ATTRIBUTE_UNUSED;
{ {
rtx x = *current_rtx; rtx x = *current_rtx;
...@@ -332,8 +311,7 @@ inherently_necessary_register_1 (current_rtx, data) ...@@ -332,8 +311,7 @@ inherently_necessary_register_1 (current_rtx, data)
/* Return nonzero if the insn CURRENT_RTX is inherently necessary. */ /* Return nonzero if the insn CURRENT_RTX is inherently necessary. */
static int static int
inherently_necessary_register (current_rtx) inherently_necessary_register (rtx current_rtx)
rtx current_rtx;
{ {
return for_each_rtx (&current_rtx, return for_each_rtx (&current_rtx,
&inherently_necessary_register_1, NULL); &inherently_necessary_register_1, NULL);
...@@ -345,10 +323,7 @@ inherently_necessary_register (current_rtx) ...@@ -345,10 +323,7 @@ inherently_necessary_register (current_rtx)
nonzero value in inherently_necessary_p if such a store is found. */ nonzero value in inherently_necessary_p if such a store is found. */
static void static void
note_inherently_necessary_set (dest, set, data) note_inherently_necessary_set (rtx dest, rtx set ATTRIBUTE_UNUSED, void *data)
rtx set ATTRIBUTE_UNUSED;
rtx dest;
void *data;
{ {
int *inherently_necessary_set_p = (int *) data; int *inherently_necessary_set_p = (int *) data;
...@@ -370,8 +345,7 @@ note_inherently_necessary_set (dest, set, data) ...@@ -370,8 +345,7 @@ note_inherently_necessary_set (dest, set, data)
Return nonzero iff inherently necessary. */ Return nonzero iff inherently necessary. */
static int static int
find_inherently_necessary (x) find_inherently_necessary (rtx x)
rtx x;
{ {
if (x == NULL_RTX) if (x == NULL_RTX)
return 0; return 0;
...@@ -416,9 +390,7 @@ find_inherently_necessary (x) ...@@ -416,9 +390,7 @@ find_inherently_necessary (x)
instructions. */ instructions. */
static int static int
propagate_necessity_through_operand (current_rtx, data) propagate_necessity_through_operand (rtx *current_rtx, void *data)
rtx *current_rtx;
void *data;
{ {
rtx x = *current_rtx; rtx x = *current_rtx;
varray_type *unprocessed_instructions = (varray_type *) data; varray_type *unprocessed_instructions = (varray_type *) data;
...@@ -447,21 +419,20 @@ propagate_necessity_through_operand (current_rtx, data) ...@@ -447,21 +419,20 @@ propagate_necessity_through_operand (current_rtx, data)
/* Indicate all insns initially assumed to be unnecessary. */ /* Indicate all insns initially assumed to be unnecessary. */
static void static void
mark_all_insn_unnecessary () mark_all_insn_unnecessary (void)
{ {
rtx insn; rtx insn;
for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) { for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) {
if (INSN_P (insn)) if (INSN_P (insn))
KILL_INSN (insn); KILL_INSN (insn);
} }
} }
/* Find the label beginning block BB, adding one if necessary. */ /* Find the label beginning block BB, adding one if necessary. */
static rtx static rtx
find_block_label (bb) find_block_label (basic_block bb)
basic_block bb;
{ {
rtx insn = bb->head; rtx insn = bb->head;
if (LABEL_P (insn)) if (LABEL_P (insn))
...@@ -478,8 +449,7 @@ find_block_label (bb) ...@@ -478,8 +449,7 @@ find_block_label (bb)
/* Remove INSN, updating its basic block structure. */ /* Remove INSN, updating its basic block structure. */
static void static void
delete_insn_bb (insn) delete_insn_bb (rtx insn)
rtx insn;
{ {
if (!insn) if (!insn)
abort (); abort ();
...@@ -498,7 +468,7 @@ delete_insn_bb (insn) ...@@ -498,7 +468,7 @@ delete_insn_bb (insn)
/* Perform the dead-code elimination. */ /* Perform the dead-code elimination. */
void void
ssa_eliminate_dead_code () ssa_eliminate_dead_code (void)
{ {
rtx insn; rtx insn;
basic_block bb; basic_block bb;
...@@ -734,7 +704,7 @@ ssa_eliminate_dead_code () ...@@ -734,7 +704,7 @@ ssa_eliminate_dead_code ()
if (INSN_P (insn)) if (INSN_P (insn))
RESURRECT_INSN (insn); RESURRECT_INSN (insn);
} }
if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0) if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0)
abort (); abort ();
control_dependent_block_to_edge_map_free (cdbte); control_dependent_block_to_edge_map_free (cdbte);
......
/* Static Single Assignment (SSA) definitions for GCC /* Static Single Assignment (SSA) definitions for GCC
Copyright (C) 2000, 2001 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
Written by Jeffrey D. Oldham <oldham@codesourcery.com>. Written by Jeffrey D. Oldham <oldham@codesourcery.com>.
This file is part of GCC. This file is part of GCC.
...@@ -21,23 +21,21 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -21,23 +21,21 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Main SSA routines. */ /* Main SSA routines. */
extern void convert_to_ssa PARAMS ((void)); extern void convert_to_ssa (void);
extern void convert_from_ssa PARAMS ((void)); extern void convert_from_ssa (void);
typedef int (*successor_phi_fn) PARAMS ((rtx, int, int, void *)); typedef int (*successor_phi_fn) (rtx, int, int, void *);
extern int for_each_successor_phi PARAMS ((basic_block bb, extern int for_each_successor_phi (basic_block bb, successor_phi_fn,
successor_phi_fn, void *);
void *)); void compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom);
void compute_dominance_frontiers PARAMS ((sbitmap *frontiers, extern int remove_phi_alternative (rtx, basic_block);
dominance_info idom));
extern int remove_phi_alternative PARAMS ((rtx, basic_block));
/* Optimizations. */ /* Optimizations. */
/* In ssa-dce.c */ /* In ssa-dce.c */
extern void ssa_eliminate_dead_code PARAMS ((void)); extern void ssa_eliminate_dead_code (void);
/* In ssa-ccp.c */ /* In ssa-ccp.c */
extern void ssa_const_prop PARAMS ((void)); extern void ssa_const_prop (void);
/* SSA definitions and uses. */ /* SSA definitions and uses. */
......
/* stack.h - structed access to object stacks /* stack.h - structed access to object stacks
Copyright (C) 1988, 2000 Free Software Foundation, Inc. Copyright (C) 1988, 2000, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com). Contributed by Michael Tiemann (tiemann@cygnus.com).
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
...@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
on top of obstacks for GNU C++. */ on top of obstacks for GNU C++. */
/* Stack of data placed on obstacks. */ /* Stack of data placed on obstacks. */
struct stack_level struct stack_level
{ {
/* Pointer back to previous such level. */ /* Pointer back to previous such level. */
...@@ -38,5 +38,5 @@ struct stack_level ...@@ -38,5 +38,5 @@ struct stack_level
int limit; int limit;
}; };
struct stack_level *push_stack_level PARAMS ((struct obstack *, char *, int)); struct stack_level *push_stack_level (struct obstack *, char *, int);
struct stack_level *pop_stack_level PARAMS ((struct stack_level *)); struct stack_level *pop_stack_level (struct stack_level *);
/* String pool for GCC. /* String pool for GCC.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -49,13 +49,13 @@ const char digit_vector[] = { ...@@ -49,13 +49,13 @@ const char digit_vector[] = {
struct ht *ident_hash; struct ht *ident_hash;
static struct obstack string_stack; static struct obstack string_stack;
static hashnode alloc_node PARAMS ((hash_table *)); static hashnode alloc_node (hash_table *);
static int mark_ident PARAMS ((struct cpp_reader *, hashnode, const void *)); static int mark_ident (struct cpp_reader *, hashnode, const void *);
static int ht_copy_and_clear PARAMS ((struct cpp_reader *, hashnode, const void *)); static int ht_copy_and_clear (struct cpp_reader *, hashnode, const void *);
/* Initialize the string pool. */ /* Initialize the string pool. */
void void
init_stringpool () init_stringpool (void)
{ {
/* Create with 16K (2^14) entries. */ /* Create with 16K (2^14) entries. */
ident_hash = ht_create (14); ident_hash = ht_create (14);
...@@ -65,8 +65,7 @@ init_stringpool () ...@@ -65,8 +65,7 @@ init_stringpool ()
/* Allocate a hash node. */ /* Allocate a hash node. */
static hashnode static hashnode
alloc_node (table) alloc_node (hash_table *table ATTRIBUTE_UNUSED)
hash_table *table ATTRIBUTE_UNUSED;
{ {
return GCC_IDENT_TO_HT_IDENT (make_node (IDENTIFIER_NODE)); return GCC_IDENT_TO_HT_IDENT (make_node (IDENTIFIER_NODE));
} }
...@@ -78,9 +77,7 @@ alloc_node (table) ...@@ -78,9 +77,7 @@ alloc_node (table)
returned this time too. */ returned this time too. */
const char * const char *
ggc_alloc_string (contents, length) ggc_alloc_string (const char *contents, int length)
const char *contents;
int length;
{ {
if (length == -1) if (length == -1)
length = strlen (contents); length = strlen (contents);
...@@ -99,8 +96,7 @@ ggc_alloc_string (contents, length) ...@@ -99,8 +96,7 @@ ggc_alloc_string (contents, length)
the same node is returned this time. */ the same node is returned this time. */
tree tree
get_identifier (text) get_identifier (const char *text)
const char *text;
{ {
hashnode ht_node = ht_lookup (ident_hash, hashnode ht_node = ht_lookup (ident_hash,
(const unsigned char *) text, (const unsigned char *) text,
...@@ -114,9 +110,7 @@ get_identifier (text) ...@@ -114,9 +110,7 @@ get_identifier (text)
known. */ known. */
tree tree
get_identifier_with_length (text, length) get_identifier_with_length (const char *text, unsigned int length)
const char *text;
unsigned int length;
{ {
hashnode ht_node = ht_lookup (ident_hash, hashnode ht_node = ht_lookup (ident_hash,
(const unsigned char *) text, (const unsigned char *) text,
...@@ -131,8 +125,7 @@ get_identifier_with_length (text, length) ...@@ -131,8 +125,7 @@ get_identifier_with_length (text, length)
NULL_TREE. */ NULL_TREE. */
tree tree
maybe_get_identifier (text) maybe_get_identifier (const char *text)
const char *text;
{ {
hashnode ht_node; hashnode ht_node;
...@@ -147,7 +140,7 @@ maybe_get_identifier (text) ...@@ -147,7 +140,7 @@ maybe_get_identifier (text)
/* Report some basic statistics about the string pool. */ /* Report some basic statistics about the string pool. */
void void
stringpool_statistics () stringpool_statistics (void)
{ {
ht_dump_statistics (ident_hash); ht_dump_statistics (ident_hash);
} }
...@@ -155,10 +148,8 @@ stringpool_statistics () ...@@ -155,10 +148,8 @@ stringpool_statistics ()
/* Mark an identifier for GC. */ /* Mark an identifier for GC. */
static int static int
mark_ident (pfile, h, v) mark_ident (struct cpp_reader *pfile ATTRIBUTE_UNUSED, hashnode h,
struct cpp_reader *pfile ATTRIBUTE_UNUSED; const void *v ATTRIBUTE_UNUSED)
hashnode h;
const void *v ATTRIBUTE_UNUSED;
{ {
gt_ggc_m_9tree_node (HT_IDENT_TO_GCC_IDENT (h)); gt_ggc_m_9tree_node (HT_IDENT_TO_GCC_IDENT (h));
return 1; return 1;
...@@ -169,7 +160,7 @@ mark_ident (pfile, h, v) ...@@ -169,7 +160,7 @@ mark_ident (pfile, h, v)
treatment for strings. */ treatment for strings. */
void void
ggc_mark_stringpool () ggc_mark_stringpool (void)
{ {
ht_forall (ident_hash, mark_ident, NULL); ht_forall (ident_hash, mark_ident, NULL);
} }
...@@ -179,8 +170,7 @@ ggc_mark_stringpool () ...@@ -179,8 +170,7 @@ ggc_mark_stringpool ()
to strings. */ to strings. */
void void
gt_ggc_m_S (x) gt_ggc_m_S (void *x ATTRIBUTE_UNUSED)
void *x ATTRIBUTE_UNUSED;
{ {
} }
...@@ -188,19 +178,16 @@ gt_ggc_m_S (x) ...@@ -188,19 +178,16 @@ gt_ggc_m_S (x)
strings don't contain pointers). */ strings don't contain pointers). */
void void
gt_pch_p_S (obj, x, op, cookie) gt_pch_p_S (void *obj ATTRIBUTE_UNUSED, void *x ATTRIBUTE_UNUSED,
void *obj ATTRIBUTE_UNUSED; gt_pointer_operator op ATTRIBUTE_UNUSED,
void *x ATTRIBUTE_UNUSED; void *cookie ATTRIBUTE_UNUSED)
gt_pointer_operator op ATTRIBUTE_UNUSED;
void *cookie ATTRIBUTE_UNUSED;
{ {
} }
/* PCH pointer-walking routine for strings. */ /* PCH pointer-walking routine for strings. */
void void
gt_pch_n_S (x) gt_pch_n_S (const void *x)
const void *x;
{ {
gt_pch_note_object ((void *)x, (void *)x, &gt_pch_p_S); gt_pch_note_object ((void *)x, (void *)x, &gt_pch_p_S);
} }
...@@ -216,11 +203,8 @@ struct string_pool_data GTY(()) ...@@ -216,11 +203,8 @@ struct string_pool_data GTY(())
static GTY(()) struct string_pool_data * spd; static GTY(()) struct string_pool_data * spd;
static int static int
ht_copy_and_clear (r, hp, ht2_p) ht_copy_and_clear (cpp_reader *r ATTRIBUTE_UNUSED, hashnode hp, const void *ht2_p)
cpp_reader *r ATTRIBUTE_UNUSED;
hashnode hp;
const void *ht2_p;
{ {
cpp_hashnode *h = CPP_HASHNODE (hp); cpp_hashnode *h = CPP_HASHNODE (hp);
struct ht *ht2 = (struct ht *) ht2_p; struct ht *ht2 = (struct ht *) ht2_p;
...@@ -244,10 +228,10 @@ ht_copy_and_clear (r, hp, ht2_p) ...@@ -244,10 +228,10 @@ ht_copy_and_clear (r, hp, ht2_p)
static struct ht *saved_ident_hash; static struct ht *saved_ident_hash;
void void
gt_pch_save_stringpool () gt_pch_save_stringpool (void)
{ {
unsigned int i; unsigned int i;
spd = ggc_alloc (sizeof (*spd)); spd = ggc_alloc (sizeof (*spd));
spd->nslots = ident_hash->nslots; spd->nslots = ident_hash->nslots;
spd->nelements = ident_hash->nelements; spd->nelements = ident_hash->nelements;
...@@ -264,7 +248,7 @@ gt_pch_save_stringpool () ...@@ -264,7 +248,7 @@ gt_pch_save_stringpool ()
} }
void void
gt_pch_fixup_stringpool () gt_pch_fixup_stringpool (void)
{ {
ht_forall (saved_ident_hash, ht_copy_and_clear, ident_hash); ht_forall (saved_ident_hash, ht_copy_and_clear, ident_hash);
ht_destroy (saved_ident_hash); ht_destroy (saved_ident_hash);
...@@ -272,10 +256,10 @@ gt_pch_fixup_stringpool () ...@@ -272,10 +256,10 @@ gt_pch_fixup_stringpool ()
} }
void void
gt_pch_restore_stringpool () gt_pch_restore_stringpool (void)
{ {
unsigned int i; unsigned int i;
ident_hash->nslots = spd->nslots; ident_hash->nslots = spd->nslots;
ident_hash->nelements = spd->nelements; ident_hash->nelements = spd->nelements;
ident_hash->entries = xrealloc (ident_hash->entries, ident_hash->entries = xrealloc (ident_hash->entries,
......
...@@ -71,7 +71,7 @@ struct tms ...@@ -71,7 +71,7 @@ struct tms
information). */ information). */
#ifdef HAVE_TIMES #ifdef HAVE_TIMES
# if defined HAVE_DECL_TIMES && !HAVE_DECL_TIMES # if defined HAVE_DECL_TIMES && !HAVE_DECL_TIMES
extern clock_t times PARAMS ((struct tms *)); extern clock_t times (struct tms *);
# endif # endif
# define USE_TIMES # define USE_TIMES
# define HAVE_USER_TIME # define HAVE_USER_TIME
...@@ -168,19 +168,17 @@ static struct timevar_stack_def *unused_stack_instances; ...@@ -168,19 +168,17 @@ static struct timevar_stack_def *unused_stack_instances;
element. */ element. */
static struct timevar_time_def start_time; static struct timevar_time_def start_time;
static void get_time static void get_time (struct timevar_time_def *);
PARAMS ((struct timevar_time_def *)); static void timevar_accumulate (struct timevar_time_def *,
static void timevar_accumulate struct timevar_time_def *,
PARAMS ((struct timevar_time_def *, struct timevar_time_def *, struct timevar_time_def *);
struct timevar_time_def *));
/* Fill the current times into TIME. The definition of this function /* Fill the current times into TIME. The definition of this function
also defines any or all of the HAVE_USER_TIME, HAVE_SYS_TIME, and also defines any or all of the HAVE_USER_TIME, HAVE_SYS_TIME, and
HAVE_WALL_TIME macros. */ HAVE_WALL_TIME macros. */
static void static void
get_time (now) get_time (struct timevar_time_def *now)
struct timevar_time_def *now;
{ {
now->user = 0; now->user = 0;
now->sys = 0; now->sys = 0;
...@@ -211,10 +209,9 @@ get_time (now) ...@@ -211,10 +209,9 @@ get_time (now)
/* Add the difference between STOP_TIME and START_TIME to TIMER. */ /* Add the difference between STOP_TIME and START_TIME to TIMER. */
static void static void
timevar_accumulate (timer, start_time, stop_time) timevar_accumulate (struct timevar_time_def *timer,
struct timevar_time_def *timer; struct timevar_time_def *start_time,
struct timevar_time_def *start_time; struct timevar_time_def *stop_time)
struct timevar_time_def *stop_time;
{ {
timer->user += stop_time->user - start_time->user; timer->user += stop_time->user - start_time->user;
timer->sys += stop_time->sys - start_time->sys; timer->sys += stop_time->sys - start_time->sys;
...@@ -224,7 +221,7 @@ timevar_accumulate (timer, start_time, stop_time) ...@@ -224,7 +221,7 @@ timevar_accumulate (timer, start_time, stop_time)
/* Initialize timing variables. */ /* Initialize timing variables. */
void void
timevar_init () timevar_init (void)
{ {
timevar_enable = true; timevar_enable = true;
...@@ -253,8 +250,7 @@ timevar_init () ...@@ -253,8 +250,7 @@ timevar_init ()
TIMEVAR cannot be running as a standalone timer. */ TIMEVAR cannot be running as a standalone timer. */
void void
timevar_push (timevar) timevar_push (timevar_id_t timevar)
timevar_id_t timevar;
{ {
struct timevar_def *tv = &timevars[timevar]; struct timevar_def *tv = &timevars[timevar];
struct timevar_stack_def *context; struct timevar_stack_def *context;
...@@ -306,8 +302,7 @@ timevar_push (timevar) ...@@ -306,8 +302,7 @@ timevar_push (timevar)
timing variable. */ timing variable. */
void void
timevar_pop (timevar) timevar_pop (timevar_id_t timevar)
timevar_id_t timevar;
{ {
struct timevar_time_def now; struct timevar_time_def now;
struct timevar_stack_def *popped = stack; struct timevar_stack_def *popped = stack;
...@@ -346,8 +341,7 @@ timevar_pop (timevar) ...@@ -346,8 +341,7 @@ timevar_pop (timevar)
attributed to TIMEVAR. */ attributed to TIMEVAR. */
void void
timevar_start (timevar) timevar_start (timevar_id_t timevar)
timevar_id_t timevar;
{ {
struct timevar_def *tv = &timevars[timevar]; struct timevar_def *tv = &timevars[timevar];
...@@ -370,8 +364,7 @@ timevar_start (timevar) ...@@ -370,8 +364,7 @@ timevar_start (timevar)
is attributed to it. */ is attributed to it. */
void void
timevar_stop (timevar) timevar_stop (timevar_id_t timevar)
timevar_id_t timevar;
{ {
struct timevar_def *tv = &timevars[timevar]; struct timevar_def *tv = &timevars[timevar];
struct timevar_time_def now; struct timevar_time_def now;
...@@ -391,9 +384,7 @@ timevar_stop (timevar) ...@@ -391,9 +384,7 @@ timevar_stop (timevar)
update-to-date information even if TIMEVAR is currently running. */ update-to-date information even if TIMEVAR is currently running. */
void void
timevar_get (timevar, elapsed) timevar_get (timevar_id_t timevar, struct timevar_time_def *elapsed)
timevar_id_t timevar;
struct timevar_time_def *elapsed;
{ {
struct timevar_def *tv = &timevars[timevar]; struct timevar_def *tv = &timevars[timevar];
struct timevar_time_def now; struct timevar_time_def now;
...@@ -419,8 +410,7 @@ timevar_get (timevar, elapsed) ...@@ -419,8 +410,7 @@ timevar_get (timevar, elapsed)
for normalizing the others, and is displayed last. */ for normalizing the others, and is displayed last. */
void void
timevar_print (fp) timevar_print (FILE *fp)
FILE *fp;
{ {
/* Only print stuff if we have some sort of time information. */ /* Only print stuff if we have some sort of time information. */
#if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME) #if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME)
...@@ -517,9 +507,7 @@ timevar_print (fp) ...@@ -517,9 +507,7 @@ timevar_print (fp)
TOTAL (given in microseconds). */ TOTAL (given in microseconds). */
void void
print_time (str, total) print_time (const char *str, long total)
const char *str;
long total;
{ {
long all_time = get_run_time (); long all_time = get_run_time ();
fprintf (stderr, fprintf (stderr,
......
...@@ -79,15 +79,15 @@ timevar_id_t; ...@@ -79,15 +79,15 @@ timevar_id_t;
/* Execute the sequence: timevar_pop (TV), return (E); */ /* Execute the sequence: timevar_pop (TV), return (E); */
#define POP_TIMEVAR_AND_RETURN(TV, E) return (timevar_pop (TV), (E)) #define POP_TIMEVAR_AND_RETURN(TV, E) return (timevar_pop (TV), (E))
extern void timevar_init PARAMS ((void)); extern void timevar_init (void);
extern void timevar_push PARAMS ((timevar_id_t)); extern void timevar_push (timevar_id_t);
extern void timevar_pop PARAMS ((timevar_id_t)); extern void timevar_pop (timevar_id_t);
extern void timevar_start PARAMS ((timevar_id_t)); extern void timevar_start (timevar_id_t);
extern void timevar_stop PARAMS ((timevar_id_t)); extern void timevar_stop (timevar_id_t);
extern void timevar_get PARAMS ((timevar_id_t, struct timevar_time_def *)); extern void timevar_get (timevar_id_t, struct timevar_time_def *);
extern void timevar_print PARAMS ((FILE *)); extern void timevar_print (FILE *);
/* Provided for backward compatibility. */ /* Provided for backward compatibility. */
extern void print_time PARAMS ((const char *, long)); extern void print_time (const char *, long);
#endif /* ! GCC_TIMEVAR_H */ #endif /* ! GCC_TIMEVAR_H */
/* Scan linker error messages for missing template instantiations and provide /* Scan linker error messages for missing template instantiations and provide
them. them.
Copyright (C) 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com). Contributed by Jason Merrill (jason@cygnus.com).
This file is part of GCC. This file is part of GCC.
...@@ -67,13 +68,11 @@ typedef struct demangled_hash_entry ...@@ -67,13 +68,11 @@ typedef struct demangled_hash_entry
/* Hash and comparison functions for these hash tables. */ /* Hash and comparison functions for these hash tables. */
static int hash_string_eq PARAMS ((const void *, const void *)); static int hash_string_eq (const void *, const void *);
static hashval_t hash_string_hash PARAMS ((const void *)); static hashval_t hash_string_hash (const void *);
static int static int
hash_string_eq (s1_p, s2_p) hash_string_eq (const void *s1_p, const void *s2_p)
const void *s1_p;
const void *s2_p;
{ {
const char *const *s1 = (const char *const *) s1_p; const char *const *s1 = (const char *const *) s1_p;
const char *s2 = (const char *) s2_p; const char *s2 = (const char *) s2_p;
...@@ -81,8 +80,7 @@ hash_string_eq (s1_p, s2_p) ...@@ -81,8 +80,7 @@ hash_string_eq (s1_p, s2_p)
} }
static hashval_t static hashval_t
hash_string_hash (s_p) hash_string_hash (const void *s_p)
const void *s_p;
{ {
const char *const *s = (const char *const *) s_p; const char *const *s = (const char *const *) s_p;
return (*htab_hash_string) (*s); return (*htab_hash_string) (*s);
...@@ -90,35 +88,31 @@ hash_string_hash (s_p) ...@@ -90,35 +88,31 @@ hash_string_hash (s_p)
static htab_t symbol_table; static htab_t symbol_table;
static struct symbol_hash_entry * symbol_hash_lookup PARAMS ((const char *, static struct symbol_hash_entry * symbol_hash_lookup (const char *, int);
int)); static struct file_hash_entry * file_hash_lookup (const char *);
static struct file_hash_entry * file_hash_lookup PARAMS ((const char *)); static struct demangled_hash_entry *demangled_hash_lookup (const char *, int);
static struct demangled_hash_entry * static void symbol_push (symbol *);
demangled_hash_lookup PARAMS ((const char *, int)); static symbol * symbol_pop (void);
static void symbol_push PARAMS ((symbol *)); static void file_push (file *);
static symbol * symbol_pop PARAMS ((void)); static file * file_pop (void);
static void file_push PARAMS ((file *)); static void tlink_init (void);
static file * file_pop PARAMS ((void)); static int tlink_execute (const char *, char **, const char *);
static void tlink_init PARAMS ((void)); static char * frob_extension (const char *, const char *);
static int tlink_execute PARAMS ((const char *, char **, const char *)); static char * obstack_fgets (FILE *, struct obstack *);
static char * frob_extension PARAMS ((const char *, const char *)); static char * tfgets (FILE *);
static char * obstack_fgets PARAMS ((FILE *, struct obstack *)); static char * pfgets (FILE *);
static char * tfgets PARAMS ((FILE *)); static void freadsym (FILE *, file *, int);
static char * pfgets PARAMS ((FILE *)); static void read_repo_file (file *);
static void freadsym PARAMS ((FILE *, file *, int)); static void maybe_tweak (char *, file *);
static void read_repo_file PARAMS ((file *)); static int recompile_files (void);
static void maybe_tweak PARAMS ((char *, file *)); static int read_repo_files (char **);
static int recompile_files PARAMS ((void)); static void demangle_new_symbols (void);
static int read_repo_files PARAMS ((char **)); static int scan_linker_output (const char *);
static void demangle_new_symbols PARAMS ((void));
static int scan_linker_output PARAMS ((const char *));
/* Look up an entry in the symbol hash table. */ /* Look up an entry in the symbol hash table. */
static struct symbol_hash_entry * static struct symbol_hash_entry *
symbol_hash_lookup (string, create) symbol_hash_lookup (const char *string, int create)
const char *string;
int create;
{ {
void **e; void **e;
e = htab_find_slot_with_hash (symbol_table, string, e = htab_find_slot_with_hash (symbol_table, string,
...@@ -140,8 +134,7 @@ static htab_t file_table; ...@@ -140,8 +134,7 @@ static htab_t file_table;
/* Look up an entry in the file hash table. */ /* Look up an entry in the file hash table. */
static struct file_hash_entry * static struct file_hash_entry *
file_hash_lookup (string) file_hash_lookup (const char *string)
const char *string;
{ {
void **e; void **e;
e = htab_find_slot_with_hash (file_table, string, e = htab_find_slot_with_hash (file_table, string,
...@@ -161,9 +154,7 @@ static htab_t demangled_table; ...@@ -161,9 +154,7 @@ static htab_t demangled_table;
/* Look up an entry in the demangled name hash table. */ /* Look up an entry in the demangled name hash table. */
static struct demangled_hash_entry * static struct demangled_hash_entry *
demangled_hash_lookup (string, create) demangled_hash_lookup (const char *string, int create)
const char *string;
int create;
{ {
void **e; void **e;
e = htab_find_slot_with_hash (demangled_table, string, e = htab_find_slot_with_hash (demangled_table, string,
...@@ -199,8 +190,7 @@ struct obstack file_stack_obstack; ...@@ -199,8 +190,7 @@ struct obstack file_stack_obstack;
struct file_stack_entry *file_stack; struct file_stack_entry *file_stack;
static void static void
symbol_push (p) symbol_push (symbol *p)
symbol *p;
{ {
struct symbol_stack_entry *ep = (struct symbol_stack_entry *) obstack_alloc struct symbol_stack_entry *ep = (struct symbol_stack_entry *) obstack_alloc
(&symbol_stack_obstack, sizeof (struct symbol_stack_entry)); (&symbol_stack_obstack, sizeof (struct symbol_stack_entry));
...@@ -210,7 +200,7 @@ symbol_push (p) ...@@ -210,7 +200,7 @@ symbol_push (p)
} }
static symbol * static symbol *
symbol_pop () symbol_pop (void)
{ {
struct symbol_stack_entry *ep = symbol_stack; struct symbol_stack_entry *ep = symbol_stack;
symbol *p; symbol *p;
...@@ -223,8 +213,7 @@ symbol_pop () ...@@ -223,8 +213,7 @@ symbol_pop ()
} }
static void static void
file_push (p) file_push (file *p)
file *p;
{ {
struct file_stack_entry *ep; struct file_stack_entry *ep;
...@@ -240,7 +229,7 @@ file_push (p) ...@@ -240,7 +229,7 @@ file_push (p)
} }
static file * static file *
file_pop () file_pop (void)
{ {
struct file_stack_entry *ep = file_stack; struct file_stack_entry *ep = file_stack;
file *p; file *p;
...@@ -258,7 +247,7 @@ file_pop () ...@@ -258,7 +247,7 @@ file_pop ()
/* Initialize the tlink machinery. Called from do_tlink. */ /* Initialize the tlink machinery. Called from do_tlink. */
static void static void
tlink_init () tlink_init (void)
{ {
const char *p; const char *p;
...@@ -268,7 +257,7 @@ tlink_init () ...@@ -268,7 +257,7 @@ tlink_init ()
NULL); NULL);
demangled_table = htab_create (500, hash_string_hash, hash_string_eq, demangled_table = htab_create (500, hash_string_hash, hash_string_eq,
NULL); NULL);
obstack_begin (&symbol_stack_obstack, 0); obstack_begin (&symbol_stack_obstack, 0);
obstack_begin (&file_stack_obstack, 0); obstack_begin (&file_stack_obstack, 0);
...@@ -286,19 +275,14 @@ tlink_init () ...@@ -286,19 +275,14 @@ tlink_init ()
} }
static int static int
tlink_execute (prog, argv, redir) tlink_execute (const char *prog, char **argv, const char *redir)
const char *prog;
char **argv;
const char *redir;
{ {
collect_execute (prog, argv, redir); collect_execute (prog, argv, redir);
return collect_wait (prog); return collect_wait (prog);
} }
static char * static char *
frob_extension (s, ext) frob_extension (const char *s, const char *ext)
const char *s;
const char *ext;
{ {
const char *p = strrchr (s, '/'); const char *p = strrchr (s, '/');
if (! p) if (! p)
...@@ -312,9 +296,7 @@ frob_extension (s, ext) ...@@ -312,9 +296,7 @@ frob_extension (s, ext)
} }
static char * static char *
obstack_fgets (stream, ob) obstack_fgets (FILE *stream, struct obstack *ob)
FILE *stream;
struct obstack *ob;
{ {
int c; int c;
while ((c = getc (stream)) != EOF && c != '\n') while ((c = getc (stream)) != EOF && c != '\n')
...@@ -326,15 +308,13 @@ obstack_fgets (stream, ob) ...@@ -326,15 +308,13 @@ obstack_fgets (stream, ob)
} }
static char * static char *
tfgets (stream) tfgets (FILE *stream)
FILE *stream;
{ {
return obstack_fgets (stream, &temporary_obstack); return obstack_fgets (stream, &temporary_obstack);
} }
static char * static char *
pfgets (stream) pfgets (FILE *stream)
FILE *stream;
{ {
return xstrdup (tfgets (stream)); return xstrdup (tfgets (stream));
} }
...@@ -348,10 +328,7 @@ pfgets (stream) ...@@ -348,10 +328,7 @@ pfgets (stream)
XXX "provided" is unimplemented, both here and in the compiler. */ XXX "provided" is unimplemented, both here and in the compiler. */
static void static void
freadsym (stream, f, chosen) freadsym (FILE *stream, file *f, int chosen)
FILE *stream;
file *f;
int chosen;
{ {
symbol *sym; symbol *sym;
...@@ -391,8 +368,7 @@ freadsym (stream, f, chosen) ...@@ -391,8 +368,7 @@ freadsym (stream, f, chosen)
/* Read in the repo file denoted by F, and record all its information. */ /* Read in the repo file denoted by F, and record all its information. */
static void static void
read_repo_file (f) read_repo_file (file *f)
file *f;
{ {
char c; char c;
FILE *stream = fopen (f->key, "r"); FILE *stream = fopen (f->key, "r");
...@@ -438,9 +414,7 @@ read_repo_file (f) ...@@ -438,9 +414,7 @@ read_repo_file (f)
this one wants to emit it as well. */ this one wants to emit it as well. */
static void static void
maybe_tweak (line, f) maybe_tweak (char *line, file *f)
char *line;
file *f;
{ {
symbol *sym = symbol_hash_lookup (line + 2, false); symbol *sym = symbol_hash_lookup (line + 2, false);
...@@ -463,7 +437,7 @@ maybe_tweak (line, f) ...@@ -463,7 +437,7 @@ maybe_tweak (line, f)
XXX Should this use collect_execute instead of system? */ XXX Should this use collect_execute instead of system? */
static int static int
recompile_files () recompile_files (void)
{ {
file *f; file *f;
...@@ -519,8 +493,7 @@ recompile_files () ...@@ -519,8 +493,7 @@ recompile_files ()
.rpo files associated with them, and read in the information. */ .rpo files associated with them, and read in the information. */
static int static int
read_repo_files (object_lst) read_repo_files (char **object_lst)
char **object_lst;
{ {
char **object = object_lst; char **object = object_lst;
...@@ -552,7 +525,7 @@ read_repo_files (object_lst) ...@@ -552,7 +525,7 @@ read_repo_files (object_lst)
/* Add the demangled forms of any new symbols to the hash table. */ /* Add the demangled forms of any new symbols to the hash table. */
static void static void
demangle_new_symbols () demangle_new_symbols (void)
{ {
symbol *sym; symbol *sym;
...@@ -573,8 +546,7 @@ demangle_new_symbols () ...@@ -573,8 +546,7 @@ demangle_new_symbols ()
adjust the settings for each symbol encountered. */ adjust the settings for each symbol encountered. */
static int static int
scan_linker_output (fname) scan_linker_output (const char *fname)
const char *fname;
{ {
FILE *stream = fopen (fname, "r"); FILE *stream = fopen (fname, "r");
char *line; char *line;
...@@ -702,8 +674,7 @@ scan_linker_output (fname) ...@@ -702,8 +674,7 @@ scan_linker_output (fname)
to provide missing definitions. Currently ignored. */ to provide missing definitions. Currently ignored. */
void void
do_tlink (ld_argv, object_lst) do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
char **ld_argv, **object_lst ATTRIBUTE_UNUSED;
{ {
int exit = tlink_execute ("ld", ld_argv, ldout); int exit = tlink_execute ("ld", ld_argv, ldout);
......
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
#include "params.h" #include "params.h"
#include "coverage.h" #include "coverage.h"
static int count_insns PARAMS ((basic_block)); static int count_insns (basic_block);
static bool ignore_bb_p PARAMS ((basic_block)); static bool ignore_bb_p (basic_block);
static bool better_p PARAMS ((edge, edge)); static bool better_p (edge, edge);
static edge find_best_successor PARAMS ((basic_block)); static edge find_best_successor (basic_block);
static edge find_best_predecessor PARAMS ((basic_block)); static edge find_best_predecessor (basic_block);
static int find_trace PARAMS ((basic_block, basic_block *)); static int find_trace (basic_block, basic_block *);
static void tail_duplicate PARAMS ((void)); static void tail_duplicate (void);
static void layout_superblocks PARAMS ((void)); static void layout_superblocks (void);
/* Minimal outgoing edge probability considered for superblock formation. */ /* Minimal outgoing edge probability considered for superblock formation. */
static int probability_cutoff; static int probability_cutoff;
...@@ -68,8 +68,7 @@ static int branch_ratio_cutoff; ...@@ -68,8 +68,7 @@ static int branch_ratio_cutoff;
/* Return true if we should ignore the basic block for purposes of tracing. */ /* Return true if we should ignore the basic block for purposes of tracing. */
static bool static bool
ignore_bb_p (bb) ignore_bb_p (basic_block bb)
basic_block bb;
{ {
if (bb->index < 0) if (bb->index < 0)
return true; return true;
...@@ -81,8 +80,7 @@ ignore_bb_p (bb) ...@@ -81,8 +80,7 @@ ignore_bb_p (bb)
/* Return number of instructions in the block. */ /* Return number of instructions in the block. */
static int static int
count_insns (bb) count_insns (basic_block bb)
basic_block bb;
{ {
rtx insn; rtx insn;
int n = 0; int n = 0;
...@@ -95,8 +93,7 @@ count_insns (bb) ...@@ -95,8 +93,7 @@ count_insns (bb)
/* Return true if E1 is more frequent than E2. */ /* Return true if E1 is more frequent than E2. */
static bool static bool
better_p (e1, e2) better_p (edge e1, edge e2)
edge e1, e2;
{ {
if (e1->count != e2->count) if (e1->count != e2->count)
return e1->count > e2->count; return e1->count > e2->count;
...@@ -114,8 +111,7 @@ better_p (e1, e2) ...@@ -114,8 +111,7 @@ better_p (e1, e2)
/* Return most frequent successor of basic block BB. */ /* Return most frequent successor of basic block BB. */
static edge static edge
find_best_successor (bb) find_best_successor (basic_block bb)
basic_block bb;
{ {
edge e; edge e;
edge best = NULL; edge best = NULL;
...@@ -133,8 +129,7 @@ find_best_successor (bb) ...@@ -133,8 +129,7 @@ find_best_successor (bb)
/* Return most frequent predecessor of basic block BB. */ /* Return most frequent predecessor of basic block BB. */
static edge static edge
find_best_predecessor (bb) find_best_predecessor (basic_block bb)
basic_block bb;
{ {
edge e; edge e;
edge best = NULL; edge best = NULL;
...@@ -154,9 +149,7 @@ find_best_predecessor (bb) ...@@ -154,9 +149,7 @@ find_best_predecessor (bb)
Return number of basic blocks recorded. */ Return number of basic blocks recorded. */
static int static int
find_trace (bb, trace) find_trace (basic_block bb, basic_block *trace)
basic_block bb;
basic_block *trace;
{ {
int i = 0; int i = 0;
edge e; edge e;
...@@ -198,7 +191,7 @@ find_trace (bb, trace) ...@@ -198,7 +191,7 @@ find_trace (bb, trace)
if profitable. */ if profitable. */
static void static void
tail_duplicate () tail_duplicate (void)
{ {
fibnode_t *blocks = xcalloc (last_basic_block, sizeof (fibnode_t)); fibnode_t *blocks = xcalloc (last_basic_block, sizeof (fibnode_t));
basic_block *trace = xmalloc (sizeof (basic_block) * n_basic_blocks); basic_block *trace = xmalloc (sizeof (basic_block) * n_basic_blocks);
...@@ -322,7 +315,7 @@ tail_duplicate () ...@@ -322,7 +315,7 @@ tail_duplicate ()
change though. */ change though. */
static void static void
layout_superblocks () layout_superblocks (void)
{ {
basic_block end = ENTRY_BLOCK_PTR->succ->dest; basic_block end = ENTRY_BLOCK_PTR->succ->dest;
basic_block bb = ENTRY_BLOCK_PTR->succ->dest->next_bb; basic_block bb = ENTRY_BLOCK_PTR->succ->dest->next_bb;
...@@ -361,7 +354,7 @@ layout_superblocks () ...@@ -361,7 +354,7 @@ layout_superblocks ()
/* Main entry point to this file. */ /* Main entry point to this file. */
void void
tracer () tracer (void)
{ {
if (n_basic_blocks <= 1) if (n_basic_blocks <= 1)
return; return;
......
/* Tree inlining hooks and declarations. /* Tree inlining hooks and declarations.
Copyright 2001 Free Software Foundation, Inc. Copyright 2001, 2003 Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com> Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GCC. This file is part of GCC.
...@@ -24,13 +24,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -24,13 +24,13 @@ Boston, MA 02111-1307, USA. */
/* Function prototypes. */ /* Function prototypes. */
void optimize_inline_calls PARAMS ((tree)); void optimize_inline_calls (tree);
int tree_inlinable_function_p PARAMS ((tree, int)); int tree_inlinable_function_p (tree, int);
tree walk_tree PARAMS ((tree*, walk_tree_fn, void*, void*)); tree walk_tree (tree*, walk_tree_fn, void*, void*);
tree walk_tree_without_duplicates PARAMS ((tree*, walk_tree_fn, void*)); tree walk_tree_without_duplicates (tree*, walk_tree_fn, void*);
tree copy_tree_r PARAMS ((tree*, int*, void*)); tree copy_tree_r (tree*, int*, void*);
void clone_body PARAMS ((tree, tree, void*)); void clone_body (tree, tree, void*);
void remap_save_expr PARAMS ((tree*, void*, tree, int*)); void remap_save_expr (tree*, void*, tree, int*);
/* 0 if we should not perform inlining. /* 0 if we should not perform inlining.
1 if we should expand functions calls inline at the tree level. 1 if we should expand functions calls inline at the tree level.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment