+Sat Dec 20 11:26:47 1997 Kaveh R. Ghazi <ghazi@tragg.rutgers.edu>
+ Jeff Law <law@cygnus.com>
+
+ * bitmap.c (bitmap_clear): Ensure `inline' is at the beginning
+ of the declaration.
+ * c-decl.c (finish_decl): Use parentheses around && within ||.
+ * rtl.c: Include stdlib.h.
+ (read_skip_spaces): Add parentheses around assignments used as
+ truth values.
+ (read_rtx): Initialize list_rtx.
+ * cppexp.c (parse_number): Use || when operands are truth values.
+ * alias.c (find_base_value): Add default case.
+ (memrefs_conflict): Likewise.
+ * combine.c (sets_function_arg_p): Likewise.
+ * genemit.c (gen_exp): Likewise.
+ * local-alloc.c (contains_replace_regs): Likewise.
+ * rtlanal.c (jmp_uses_reg_or_mem): Likewise.
+ * fold-const.c (fold_convert): Use "&&" for truth values.
+ (fold): Add default case.
+ * sdbout.c (sdbout_field_types): Fix typo in declaration.
+ (sdbout_one_type): Add default case.
+ * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS.
+ (some_operand): Add default case.
+ (input_operand): Likewise.
+ (signed_comparison_operator): Likewise.
+ (divmod_operator): Likewise.
+ (alpha_set_memflags_1): Likewise.
+ * reload1.c (reload_cse_simplify_operands): Ensure function
+ always returns a value.
+ * scan-decls.c (scan_decls): Likewise.
+ * c-lex.c (skip_white_space): Fix typo in declaraion.
+ * c-typeck.c (comp_target_types): Add parentheses around assignment
+ used as truth value.
+ (print_spelling): Likewise.
+ (constructor_implicit, constructor_result): Remove unused variables.
+ * collect2.c (scan_library): Protect prototype with
+ #ifdef SCAN_LIBRARIES.
+ * emit-rtl.c (find_line_note): Fix typo in declaration.
+ * final.c (asm_insn_count): Protect prototype with
+ #ifdef HAVE_ATTR_length.
+ * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC.
+ (try_pre_increment_1, try_pre_increment): Likewise.
+ * regclass.c (auto_inc_dec_reg_p): Protect prototype with
+ #ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit.
+ * gcov-io.h (__store_long, __write_long, __read_long): Fix
+ unsigned/signed comparisons.
+ * gcov.c (read_files): Remove unused "first_type" variable.
+ (scan _for_source_files): Initialize s_ptr.
+ (function_summary): Eliminate "%lf" formatting, use %ld for
+ longs.
+ (output_data): Initialize branch_probs and last_line_num.
+ Eliminate "%lf" formatting, use "%ld" for longs.
+
Fri Dec 19 17:31:11 1997 Ian Lance Taylor <ian@cygnus.com>
* mips16.S: New file.
case HIGH:
return find_base_value (XEXP (src, 0));
+
+ default:
+ break;
}
return 0;
c /= INTVAL (x1);
return memrefs_conflict_p (xsize, x0, ysize, y0, c);
}
+
+ default:
+ break;
}
/* Treat an access through an AND (e.g. a subword access on an Alpha)
\f
/* Clear a bitmap by freeing the linked list. */
-void INLINE
+INLINE void
bitmap_clear (head)
bitmap head;
{
declaration into a file scope one. This can be detected
by TREE_ASM_WRITTEN being set. */
(DECL_INITIAL (decl) != 0
- || DECL_CONTEXT (decl) != 0 && ! TREE_ASM_WRITTEN (decl))
+ || (DECL_CONTEXT (decl) != 0 && ! TREE_ASM_WRITTEN (decl)))
:
/* An automatic variable with an incomplete type
is an error. */
static int nextchar = -1;
#endif
-static int skip_which_space PROTO((int));
+static int skip_white_space PROTO((int));
static char *extend_token_buffer PROTO((char *));
static int readescape PROTO((int *));
int check_newline ();
int val;
/* Give maybe_objc_comptypes a crack at letting these types through. */
- if (val = maybe_objc_comptypes (ttl, ttr, 1) >= 0)
+ if ((val = maybe_objc_comptypes (ttl, ttr, 1)) >= 0)
return val;
val = comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (ttl)),
{
if (p->kind == SPELLING_MEMBER)
*d++ = '.';
- for (s = p->u.s; *d = *s++; d++)
+ for (s = p->u.s; (*d = *s++); d++)
;
}
*d++ = '\0';
/* 0 if implicitly pushing constructor levels is allowed. */
int constructor_no_implicit = 0; /* 0 for C; 1 for some other languages. */
-/* 1 if this constructor level was entered implicitly. */
-static int constructor_implicit;
-
static int require_constant_value;
static int require_constant_elements;
/* Nonzero if this is an initializer for a top-level decl. */
static int constructor_top_level;
-/* When we finish reading a constructor expression
- (constructor_decl is 0), the CONSTRUCTOR goes here. */
-static tree constructor_result;
\f
/* This stack has a level for each implicit or explicit level of
structuring in the initializer, including the outermost one. It
static void write_c_file PROTO((FILE *, char *));
static void write_export_file PROTO((FILE *));
static void scan_prog_file PROTO((char *, enum pass));
+#ifdef SCAN_LIBRARIES
static void scan_libraries PROTO((char *));
+#endif
char *xcalloc ();
char *xmalloc ();
return (GET_CODE (inner_dest) == REG
&& REGNO (inner_dest) < FIRST_PSEUDO_REGISTER
&& FUNCTION_ARG_REGNO_P (REGNO (inner_dest)));
+
+ default:
+ break;
}
return 0;
static void add_long_const PROTO((FILE *, HOST_WIDE_INT, int, int, int));
/* Compute the size of the save area in the stack. */
+#if OPEN_VMS
static void alpha_sa_mask PROTO((unsigned long *imaskP,
unsigned long *fmaskP));
+#endif
/* Get the number of args of a function in one of two ways. */
#ifdef OPEN_VMS
#define NUM_ARGS current_function_args_info.num_args
case SUBREG:
return some_operand (SUBREG_REG (op), VOIDmode);
+
+ default:
+ break;
}
return 0;
case CONST_INT:
return mode == QImode || mode == HImode || add_operand (op, mode);
+
+ default:
+ break;
}
return 0;
{
case EQ: case NE: case LE: case LT: case GE: case GT:
return 1;
+
+ default:
+ break;
}
return 0;
{
case DIV: case MOD: case UDIV: case UMOD:
return 1;
+
+ default:
+ break;
}
return 0;
MEM_VOLATILE_P (x) = volatile_p;
RTX_UNCHANGING_P (x) = unchanging_p;
break;
+
+ default:
+ break;
}
}
#include "cpplib.h"
extern char *xmalloc PARAMS ((unsigned));
-extern char *xrealloc PARAMS ((char *, unsigned));
+extern char *xrealloc PARAMS ((void *, unsigned));
#ifdef MULTIBYTE_CHARS
#include <stdlib.h>
#include <locale.h>
#endif
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
#include <stdio.h>
/* This is used for communicating lists of keywords with cccp.c. */
#define SKIP_OPERAND 8
/*#define UNSIGNEDP 16*/
-#ifndef HOST_BITS_PER_WIDE_INT
+/* Find the largest host integer type and set its size and type.
+ Watch out: on some crazy hosts `long' is shorter than `int'. */
+
+#ifndef HOST_WIDE_INT
+# if HAVE_INTTYPES_H
+# include <inttypes.h>
+# define HOST_WIDE_INT intmax_t
+# else
+# if (HOST_BITS_PER_LONG <= HOST_BITS_PER_INT \
+ && HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_INT)
+# define HOST_WIDE_INT int
+# else
+# if (HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_LONG \
+ || ! (defined LONG_LONG_MAX || defined LLONG_MAX))
+# define HOST_WIDE_INT long
+# else
+# define HOST_WIDE_INT long long
+# endif
+# endif
+# endif
+#endif
-#if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
-#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
-#define HOST_WIDE_INT long
-#else
-#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
-#define HOST_WIDE_INT int
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
#endif
+#ifndef HOST_BITS_PER_WIDE_INT
+#define HOST_BITS_PER_WIDE_INT (CHAR_BIT * sizeof (HOST_WIDE_INT))
#endif
struct operation {
if (largest_digit < digit)
largest_digit = digit;
nd = n * base + digit;
- overflow |= ULONG_MAX_over_base < n | nd < n;
+ overflow |= ULONG_MAX_over_base < n || nd < n;
n = nd;
}
{
if (c == '\\')
{
- c = cpp_parse_escape (pfile, &ptr);
+ c = cpp_parse_escape (pfile, (char **) &ptr);
if (width < HOST_BITS_PER_INT
&& (unsigned) c >= (1 << width))
cpp_pedwarn (pfile,
{
int num_bits = num_chars * width;
- if (cpp_lookup (pfile, "__CHAR_UNSIGNED__",
+ if (cpp_lookup (pfile, (U_CHAR *)"__CHAR_UNSIGNED__",
sizeof ("__CHAR_UNSIGNED__")-1, -1)
|| ((result >> (num_bits - 1)) & 1) == 0)
op.value
static rtx make_jump_insn_raw PROTO((rtx));
static rtx make_call_insn_raw PROTO((rtx));
-static rtx find_line_node PROTO((rtx));
+static rtx find_line_note PROTO((rtx));
\f
/* rtx gen_rtx (code, mode, [element1, ..., elementn])
**
static struct bb_str **sbb_tail = &sbb_head; /* Ptr to store next bb str */
static int sbb_label_num = 0; /* Last label used */
+#ifdef HAVE_ATTR_length
static int asm_insn_count PROTO((rtx));
+#endif
static void profile_function PROTO((FILE *));
static void profile_after_prologue PROTO((FILE *));
static void add_bb PROTO((FILE *));
rtx, regset));
static void mark_set_1 PROTO((regset, regset, rtx,
rtx, regset));
+#ifdef AUTO_INC_DEC
static void find_auto_inc PROTO((regset, rtx, rtx));
-static void mark_used_regs PROTO((regset, regset, rtx, int, rtx));
static int try_pre_increment_1 PROTO((rtx));
static int try_pre_increment PROTO((rtx, rtx, HOST_WIDE_INT));
+#endif
+static void mark_used_regs PROTO((regset, regset, rtx, int, rtx));
void dump_flow_info PROTO((FILE *));
\f
/* Find basic blocks of the current function and perform data flow analysis.
= (TREE_OVERFLOW (arg1)
|| (force_fit_type (t,
(TREE_INT_CST_HIGH (arg1) < 0
- & (TREE_UNSIGNED (type)
+ && (TREE_UNSIGNED (type)
< TREE_UNSIGNED (TREE_TYPE (arg1)))))
&& TREE_CODE (TREE_TYPE (arg1)) != POINTER_TYPE));
TREE_CONSTANT_OVERFLOW (t)
arg0),
convert (signed_type (TREE_TYPE (arg1)),
integer_zero_node)));
+ default:
+ break;
}
}
}
__store_long (value, dest, bytes)
long value;
char *dest;
- int bytes;
+ size_t bytes;
{
int upper_bit = (value < 0 ? 128 : 0);
- int i;
+ size_t i;
if (value < 0)
{
__write_long (value, file, bytes)
long value;
FILE *file;
- int bytes;
+ size_t bytes;
{
char c[10];
__read_long (dest, file, bytes)
long *dest;
FILE *file;
- int bytes;
+ size_t bytes;
{
char c[10];
source file.
Copyright (C) 1990, 91, 92, 93, 94, 96, 1997 Free Software Foundation, Inc.
Contributed by James E. Wilson of Cygnus Support.
- Mongled by Bob Manson of Cygnus Support.
+ Mangled by Bob Manson of Cygnus Support.
Gcov is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
is no way to get the total execution counts for the included file, can
only get execution counts for one or the other of the including files. */
+#include "config.h"
#include <stdio.h>
+#include "gansidecl.h"
#include <sys/types.h>
#include <sys/stat.h>
-/* The only need for this is so that we get macro definitions for rindex
- if necessary. */
-#include "config.h"
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
#include "gcov-io.h"
-extern char * rindex ();
+#ifdef NEED_DECLARATION_RINDEX
+extern char *rindex ();
+#endif
/* The .bb file format consists of several lists of 4-byte integers
which are the line numbers of each basic block in the file. Each
struct stat buf;
struct bb_info_list *list_end = 0;
struct bb_info_list *b_ptr;
- long total, first_time;
+ long total;
/* Read and ignore the first word of the .da file, which is the count of
how many numbers follow. */
/* Read in the data in the .bbg file and reconstruct the program flow
graph for one function. */
- create_program_flow_graph (b_ptr, first_time);
+ create_program_flow_graph (b_ptr);
/* Set the EOF condition if at the end of file. */
ungetc (getc (bbg_file), bbg_file);
stat (bb_file_name, &buf);
bb_data_size = buf.st_size / 4;
- bb_data = (char *) xmalloc (buf.st_size);
+ bb_data = (char *) xmalloc ((unsigned) buf.st_size);
fread (bb_data, sizeof (char), buf.st_size, bb_file);
fclose (bb_file);
static void
scan_for_source_files ()
{
- struct sourcefile *s_ptr;
+ struct sourcefile *s_ptr = NULL;
char *ptr;
int count;
long line_num;
function_summary ()
{
if (function_source_lines)
- fprintf (stdout, "%6.2lf%% of %d source lines executed in function %s\n",
+ fprintf (stdout, "%6.2f%% of %d source lines executed in function %s\n",
(((double) function_source_lines_executed / function_source_lines)
* 100), function_source_lines, function_name);
else
{
if (function_branches)
{
- fprintf (stdout, "%6.2lf%% of %d branches executed in funcion %s\n",
+ fprintf (stdout, "%6.2f%% of %d branches executed in function %s\n",
(((double) function_branches_executed / function_branches)
* 100), function_branches, function_name);
fprintf (stdout,
- "%6.2lf%% of %d branches taken at least once in function %s\n",
+ "%6.2f%% of %d branches taken at least once in function %s\n",
(((double) function_branches_taken / function_branches)
* 100), function_branches, function_name);
}
else
fprintf (stdout, "No branches in function %s\n", function_name);
if (function_calls)
- fprintf (stdout, "%6.2lf%% of %d calls executed in function %s\n",
+ fprintf (stdout, "%6.2f%% of %d calls executed in function %s\n",
(((double) function_calls_executed / function_calls)
* 100), function_calls, function_name);
else
char *line_exists;
/* An array indexed by line number, which contains a list of branch
probabilities, one for each branch on that line. */
- struct arcdata **branch_probs;
+ struct arcdata **branch_probs = NULL;
struct sourcefile *s_ptr;
char *source_file_name;
FILE *source_file;
char *cptr;
long block_num;
long line_num;
- long last_line_num;
+ long last_line_num = 0;
int i;
struct arcdata *a_ptr;
/* Buffer used for reading in lines from the source file. */
fprintf (stderr,
"didn't use all bb entries of graph, function %s\n",
function_name);
- fprintf (stderr, "block_num = %d, num_blocks = %d\n",
+ fprintf (stderr, "block_num = %ld, num_blocks = %d\n",
block_num, current_graph->num_blocks);
}
if (total_source_lines)
fprintf (stdout,
- "%6.2lf%% of %d source lines executed in file %s\n",
+ "%6.2f%% of %d source lines executed in file %s\n",
(((double) total_source_lines_executed / total_source_lines)
* 100), total_source_lines, source_file_name);
else
{
if (total_branches)
{
- fprintf (stdout, "%6.2lf%% of %d branches executed in file %s\n",
+ fprintf (stdout, "%6.2f%% of %d branches executed in file %s\n",
(((double) total_branches_executed / total_branches)
* 100), total_branches, source_file_name);
fprintf (stdout,
- "%6.2lf%% of %d branches taken at least once in file %s\n",
+ "%6.2f%% of %d branches taken at least once in file %s\n",
(((double) total_branches_taken / total_branches)
* 100), total_branches, source_file_name);
}
else
fprintf (stdout, "No branches in file %s\n", source_file_name);
if (total_calls)
- fprintf (stdout, "%6.2lf%% of %d calls executed in file %s\n",
+ fprintf (stdout, "%6.2f%% of %d calls executed in file %s\n",
(((double) total_calls_executed / total_calls)
* 100), total_calls, source_file_name);
else
if (output_gcov_file)
{
/* Now the statistics are ready. Read in the source file one line
- at a time, and output that line to the gcov file preceeded by
+ at a time, and output that line to the gcov file preceded by
its execution count if non zero. */
source_file = fopen (source_file_name, "r");
before the source line. For lines which exist but were never
executed, print ###### before the source line. Otherwise,
print the execution count before the source line. */
- /* There are 16 spaces of identation added before the source line
- so that tabs won't be messed up. */
+ /* There are 16 spaces of indentation added before the source
+ line so that tabs won't be messed up. */
if (line_exists[count])
{
if (line_counts[count])
- fprintf (gcov_file, "%12d %s", line_counts[count],
+ fprintf (gcov_file, "%12ld %s", line_counts[count],
string);
else
fprintf (gcov_file, " ###### %s", string);
fprintf (gcov_file, "\t\t%s", string);
/* In case the source file line is larger than our buffer, keep
- reading and outputing lines until we get a newline. */
+ reading and outputting lines until we get a newline. */
len = strlen (string);
while ((len == 0 || string[strlen (string) - 1] != '\n')
&& retval != NULL)
fprintf (gcov_file, "\t\t%s", string);
/* In case the source file line is larger than our buffer, keep
- reading and outputing lines until we get a newline. */
+ reading and outputting lines until we get a newline. */
len = strlen (string);
while ((len == 0 || string[strlen (string) - 1] != '\n')
&& retval != NULL)
/* Generate code from machine description to emit insns as rtl.
- Copyright (C) 1987, 1988, 1991, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 91, 94, 95, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
/* These shouldn't be written in MD files. Instead, the appropriate
routines in varasm.c should be called. */
abort ();
+
+ default:
+ break;
}
printf ("gen_rtx (");
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
+ printf ("#include <stdio.h>\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"expr.h\"\n");
printf ("#include \"real.h\"\n");
+ printf ("#include \"flags.h\"\n");
printf ("#include \"output.h\"\n");
printf ("#include \"insn-config.h\"\n\n");
printf ("#include \"insn-flags.h\"\n\n");
case REG:
return reg_equiv_replace[REGNO (x)];
+
+ default:
+ break;
}
fmt = GET_RTX_FORMAT (code);
static int copy_cost PROTO((rtx, enum machine_mode,
enum reg_class, int));
static void record_address_regs PROTO((rtx, enum reg_class, int));
-static auto_inc_dec_reg_p PROTO((rtx, enum machine_mode));
+#ifdef FORBIDDEN_INC_DEC_CLASSES
+static int auto_inc_dec_reg_p PROTO((rtx, enum machine_mode));
+#endif
static void reg_scan_mark_refs PROTO((rtx, rtx, int));
/* Return the reg_class in which pseudo reg number REGNO is best allocated.
/* Return 1 if REG is valid as an auto-increment memory reference
to an object of MODE. */
-static
+static int
auto_inc_dec_reg_p (reg, mode)
rtx reg;
enum machine_mode mode;
n_alternatives = insn_n_alternatives[insn_code_number];
if (n_alternatives == 0 || n_operands == 0)
- return;
+ return 0;
insn_extract (insn);
/* Figure out which alternative currently matches. */
#include "config.h"
#include <ctype.h>
#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#include "rtl.h"
#include "real.h"
FILE *infile;
{
register int c;
- while (c = getc (infile))
+ while ((c = getc (infile)))
{
if (c == ' ' || c == '\n' || c == '\t' || c == '\f')
;
dump_and_abort ('*', c, infile);
prevc = 0;
- while (c = getc (infile))
+ while ((c = getc (infile)))
{
if (prevc == '*' && c == '/')
break;
case 'E':
{
register struct rtx_list *next_rtx, *rtx_list_link;
- struct rtx_list *list_rtx;
+ struct rtx_list *list_rtx = NULL_RTX;
c = read_skip_spaces (infile);
if (c != '[')
case PLUS: case MINUS: case MULT:
return (jmp_uses_reg_or_mem (XEXP (x, 0))
|| jmp_uses_reg_or_mem (XEXP (x, 1)));
+
+ default:
+ break;
}
fmt = GET_RTX_FORMAT (code);
/* scan-decls.c - Extracts declarations from cpp output.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1997 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
char **argv;
{
int saw_extern, saw_inline;
+ int start_written;
int old_written;
/* If declarator_start is non-zero, it marks the start of the current
declarator. If it is zero, we are either still parsing the
new_statement:
CPP_SET_WRITTEN (pfile, 0);
+ start_written = 0;
token = cpp_get_token (pfile);
handle_statement:
declarator_start = 0;
for (;;)
{
- int start_written = CPP_WRITTEN (pfile);
- token = cpp_get_token (pfile);
- handle_token:
switch (token)
{
case CPP_LPAREN:
}
}
else
- goto handle_token;
+ continue;
break;
}
/* This may be the name of a variable or function. */
break;
case CPP_EOF:
- return; /* ??? FIXME */
+ return 0;
case CPP_LBRACE: case CPP_RBRACE: case CPP_DIRECTIVE:
goto new_statement; /* handle_statement? */
default:
prev_id_start = 0;
}
+
+ start_written = CPP_WRITTEN (pfile);
+ token = cpp_get_token (pfile);
}
}
static void sdbout_queue_anonymous_type PROTO((tree));
static void sdbout_dequeue_anonymous_types PROTO((void));
static void sdbout_type PROTO((tree));
-static void sbdout_field_types PROTO((tree));
+static void sdbout_field_types PROTO((tree));
static void sdbout_one_type PROTO((tree));
static void sdbout_parms PROTO((tree));
static void sdbout_reg_parms PROTO((tree));
return;
}
break;
+
+ default:
+ break;
}
PUT_SDB_TYPE (plain_type (type));
PUT_SDB_ENDEF;
PUT_SDB_TYPE (T_ENUM);
member_scl = C_MOE;
break;
+
+ default:
+ break;
}
PUT_SDB_SIZE (size);
PUT_SDB_SIZE (size);
PUT_SDB_ENDEF;
break;
+
+ default:
+ break;
}
}
}