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