Commit 3bb5de61 by Kaveh R. Ghazi Committed by Kaveh Ghazi

gmon-sol2.c: Include config.h and system.h.

        * gmon-sol2.c: Include config.h and system.h.  Don't redundantly
        include system header files.
        (sccsid): Remove.
        (moncontrol, monstartup, _mcleanup, internal_mcount): Prototype.
        (_mcleanup): Add the `const' keyword to a char*.
        (internal_mcount): Declare `etext' as a char[] not a function.
        Cast `etext' to char* when calling `monstartup'.
        * sparc.c (frame_base_name, save_regs, restore_regs,
        build_big_number, sparc_cmodel_string, sparc_align_loops_string,
        sparc_align_jumps_string, sparc_align_funcs_string, code_model,
        cpu_default, cpu_table, output_function_prologue,
        output_function_epilogue, output_return,
        sparc_flat_output_function_prologue, ultra_code_names,
        sparc_flat_output_function_epilogue): Constify a char*.
        (hypersparc_adjust_cost): Add a default case in a switch.
        * sparc.h (sparc_cmodel_string, OVERRIDE_OPTIONS,
        sparc_cpu_select, sparc_align_loops_string,
        sparc_align_jumps_string, sparc_align_funcs_string,
        output_return): Constify a char*.
        * sparc.md (movdi): Change the comparison of HOST_BITS_PER_WIDE_INT
        so that we check "== 32", instead of "!= 64".  Cast a value to
        HOST_WIDE_INT when comparing against one.  Hide the declaration
        for variable `chain'.

From-SVN: r25627
parent 366453bf
Sun Mar 7 08:30:37 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gmon-sol2.c: Include config.h and system.h. Don't redundantly
include system header files.
(sccsid): Remove.
(moncontrol, monstartup, _mcleanup, internal_mcount): Prototype.
(_mcleanup): Add the `const' keyword to a char*.
(internal_mcount): Declare `etext' as a char[] not a function.
Cast `etext' to char* when calling `monstartup'.
* sparc.c (frame_base_name, save_regs, restore_regs,
build_big_number, sparc_cmodel_string, sparc_align_loops_string,
sparc_align_jumps_string, sparc_align_funcs_string, code_model,
cpu_default, cpu_table, output_function_prologue,
output_function_epilogue, output_return,
sparc_flat_output_function_prologue, ultra_code_names,
sparc_flat_output_function_epilogue): Constify a char*.
(hypersparc_adjust_cost): Add a default case in a switch.
* sparc.h (sparc_cmodel_string, OVERRIDE_OPTIONS,
sparc_cpu_select, sparc_align_loops_string,
sparc_align_jumps_string, sparc_align_funcs_string,
output_return): Constify a char*.
* sparc.md (movdi): Change the comparison of HOST_BITS_PER_WIDE_INT
so that we check "== 32", instead of "!= 64". Cast a value to
HOST_WIDE_INT when comparing against one. Hide the declaration
for variable `chain'.
Sun Mar 7 08:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Sun Mar 7 08:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* system.h (const, inline): Move the stage2 handling of these * system.h (const, inline): Move the stage2 handling of these
......
...@@ -35,16 +35,8 @@ ...@@ -35,16 +35,8 @@
* for Cygnus Support, July 1992. * for Cygnus Support, July 1992.
*/ */
#ifndef lint #include "config.h"
static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91"; #include "system.h"
#endif /* not lint */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#if 0 #if 0
#include "sparc/gmon.h" #include "sparc/gmon.h"
...@@ -96,7 +88,9 @@ static int s_scale; ...@@ -96,7 +88,9 @@ static int s_scale;
#define MSG "No space for profiling buffer(s)\n" #define MSG "No space for profiling buffer(s)\n"
static void moncontrol(); static void moncontrol PROTO ((int));
extern void monstartup PROTO ((char *, char *));
extern void _mcleanup PROTO ((void));
void monstartup(lowpc, highpc) void monstartup(lowpc, highpc)
char *lowpc; char *lowpc;
...@@ -185,7 +179,7 @@ _mcleanup() ...@@ -185,7 +179,7 @@ _mcleanup()
int toindex; int toindex;
struct rawarc rawarc; struct rawarc rawarc;
char *profdir; char *profdir;
char *proffile; const char *proffile;
char *progname; char *progname;
char buf[PATH_MAX]; char buf[PATH_MAX];
extern char **___Argv; extern char **___Argv;
...@@ -275,6 +269,8 @@ _mcleanup() ...@@ -275,6 +269,8 @@ _mcleanup()
* -- [eichin:19920702.1107EST] * -- [eichin:19920702.1107EST]
*/ */
static void internal_mcount PROTO((char *, unsigned short *)) ATTRIBUTE_UNUSED;
/* i7 == last ret, -> frompcindex */ /* i7 == last ret, -> frompcindex */
/* o7 == current ret, -> selfpc */ /* o7 == current ret, -> selfpc */
/* Solaris 2 libraries use _mcount. */ /* Solaris 2 libraries use _mcount. */
...@@ -297,9 +293,9 @@ static void internal_mcount(selfpc, frompcindex) ...@@ -297,9 +293,9 @@ static void internal_mcount(selfpc, frompcindex)
*/ */
if(!already_setup) { if(!already_setup) {
extern etext(); extern char etext[];
already_setup = 1; already_setup = 1;
monstartup(0, etext); monstartup(0, (char *)etext);
#ifdef USE_ONEXIT #ifdef USE_ONEXIT
on_exit(_mcleanup, 0); on_exit(_mcleanup, 0);
#else #else
......
...@@ -98,15 +98,15 @@ char leaf_reg_remap[] = ...@@ -98,15 +98,15 @@ char leaf_reg_remap[] =
this is "%sp+something". We record "something" separately as it may be this is "%sp+something". We record "something" separately as it may be
too big for reg+constant addressing. */ too big for reg+constant addressing. */
static char *frame_base_name; static const char *frame_base_name;
static int frame_base_offset; static int frame_base_offset;
static rtx pic_setup_code PROTO((void)); static rtx pic_setup_code PROTO((void));
static void sparc_init_modes PROTO((void)); static void sparc_init_modes PROTO((void));
static int save_regs PROTO((FILE *, int, int, char *, static int save_regs PROTO((FILE *, int, int, const char *,
int, int, int)); int, int, int));
static int restore_regs PROTO((FILE *, int, int, char *, int, int)); static int restore_regs PROTO((FILE *, int, int, const char *, int, int));
static void build_big_number PROTO((FILE *, int, char *)); static void build_big_number PROTO((FILE *, int, const char *));
static int function_arg_slotno PROTO((const CUMULATIVE_ARGS *, static int function_arg_slotno PROTO((const CUMULATIVE_ARGS *,
enum machine_mode, tree, int, int, enum machine_mode, tree, int, int,
int *, int *)); int *, int *));
...@@ -127,14 +127,14 @@ extern char *dwarf2out_cfi_label (); ...@@ -127,14 +127,14 @@ extern char *dwarf2out_cfi_label ();
/* Option handling. */ /* Option handling. */
/* Code model option as passed by user. */ /* Code model option as passed by user. */
char *sparc_cmodel_string; const char *sparc_cmodel_string;
/* Parsed value. */ /* Parsed value. */
enum cmodel sparc_cmodel; enum cmodel sparc_cmodel;
/* Record alignment options as passed by user. */ /* Record alignment options as passed by user. */
char *sparc_align_loops_string; const char *sparc_align_loops_string;
char *sparc_align_jumps_string; const char *sparc_align_jumps_string;
char *sparc_align_funcs_string; const char *sparc_align_funcs_string;
/* Parsed values, as a power of two. */ /* Parsed values, as a power of two. */
int sparc_align_loops; int sparc_align_loops;
...@@ -160,7 +160,7 @@ void ...@@ -160,7 +160,7 @@ void
sparc_override_options () sparc_override_options ()
{ {
static struct code_model { static struct code_model {
char *name; const char *name;
int value; int value;
} cmodels[] = { } cmodels[] = {
{ "32", CM_32 }, { "32", CM_32 },
...@@ -174,7 +174,7 @@ sparc_override_options () ...@@ -174,7 +174,7 @@ sparc_override_options ()
/* Map TARGET_CPU_DEFAULT to value for -m{arch,tune}=. */ /* Map TARGET_CPU_DEFAULT to value for -m{arch,tune}=. */
static struct cpu_default { static struct cpu_default {
int cpu; int cpu;
char *name; const char *name;
} cpu_default[] = { } cpu_default[] = {
/* There must be one entry here for each TARGET_CPU value. */ /* There must be one entry here for each TARGET_CPU value. */
{ TARGET_CPU_sparc, "cypress" }, { TARGET_CPU_sparc, "cypress" },
...@@ -191,7 +191,7 @@ sparc_override_options () ...@@ -191,7 +191,7 @@ sparc_override_options ()
struct cpu_default *def; struct cpu_default *def;
/* Table of values for -m{cpu,tune}=. */ /* Table of values for -m{cpu,tune}=. */
static struct cpu_table { static struct cpu_table {
char *name; const char *name;
enum processor_type processor; enum processor_type processor;
int disable; int disable;
int enable; int enable;
...@@ -2886,7 +2886,7 @@ static int ...@@ -2886,7 +2886,7 @@ static int
save_regs (file, low, high, base, offset, n_regs, real_offset) save_regs (file, low, high, base, offset, n_regs, real_offset)
FILE *file; FILE *file;
int low, high; int low, high;
char *base; const char *base;
int offset; int offset;
int n_regs; int n_regs;
int real_offset; int real_offset;
...@@ -2959,7 +2959,7 @@ static int ...@@ -2959,7 +2959,7 @@ static int
restore_regs (file, low, high, base, offset, n_regs) restore_regs (file, low, high, base, offset, n_regs)
FILE *file; FILE *file;
int low, high; int low, high;
char *base; const char *base;
int offset; int offset;
int n_regs; int n_regs;
{ {
...@@ -3074,7 +3074,7 @@ static void ...@@ -3074,7 +3074,7 @@ static void
build_big_number (file, num, reg) build_big_number (file, num, reg)
FILE *file; FILE *file;
int num; int num;
char *reg; const char *reg;
{ {
if (num >= 0 || ! TARGET_ARCH64) if (num >= 0 || ! TARGET_ARCH64)
{ {
...@@ -3206,7 +3206,7 @@ output_function_prologue (file, size, leaf_function) ...@@ -3206,7 +3206,7 @@ output_function_prologue (file, size, leaf_function)
if (num_gfregs) if (num_gfregs)
{ {
int offset, real_offset, n_regs; int offset, real_offset, n_regs;
char *base; const char *base;
real_offset = -apparent_fsize; real_offset = -apparent_fsize;
offset = -apparent_fsize + frame_base_offset; offset = -apparent_fsize + frame_base_offset;
...@@ -3257,7 +3257,7 @@ output_function_epilogue (file, size, leaf_function) ...@@ -3257,7 +3257,7 @@ output_function_epilogue (file, size, leaf_function)
int size ATTRIBUTE_UNUSED; int size ATTRIBUTE_UNUSED;
int leaf_function; int leaf_function;
{ {
char *ret; const char *ret;
if (leaf_label) if (leaf_label)
{ {
...@@ -3287,7 +3287,7 @@ output_function_epilogue (file, size, leaf_function) ...@@ -3287,7 +3287,7 @@ output_function_epilogue (file, size, leaf_function)
if (num_gfregs) if (num_gfregs)
{ {
int offset, n_regs; int offset, n_regs;
char *base; const char *base;
offset = -apparent_fsize + frame_base_offset; offset = -apparent_fsize + frame_base_offset;
if (offset < -4096 || offset + num_gfregs * 4 > 4096 - 8 /*double*/) if (offset < -4096 || offset + num_gfregs * 4 > 4096 - 8 /*double*/)
...@@ -4675,7 +4675,7 @@ epilogue_renumber (where) ...@@ -4675,7 +4675,7 @@ epilogue_renumber (where)
/* Output assembler code to return from a function. */ /* Output assembler code to return from a function. */
char * const char *
output_return (operands) output_return (operands)
rtx *operands; rtx *operands;
{ {
...@@ -5876,7 +5876,7 @@ sparc_flat_output_function_prologue (file, size) ...@@ -5876,7 +5876,7 @@ sparc_flat_output_function_prologue (file, size)
{ {
unsigned int reg_offset = current_frame_info.reg_offset; unsigned int reg_offset = current_frame_info.reg_offset;
char *fp_str = reg_names[FRAME_POINTER_REGNUM]; char *fp_str = reg_names[FRAME_POINTER_REGNUM];
char *t1_str = "%g1"; const char *t1_str = "%g1";
/* Things get a little tricky if local variables take up more than ~4096 /* Things get a little tricky if local variables take up more than ~4096
bytes and outgoing arguments take up more than ~4096 bytes. When that bytes and outgoing arguments take up more than ~4096 bytes. When that
...@@ -6055,7 +6055,7 @@ sparc_flat_output_function_epilogue (file, size) ...@@ -6055,7 +6055,7 @@ sparc_flat_output_function_epilogue (file, size)
unsigned int size1; unsigned int size1;
char *sp_str = reg_names[STACK_POINTER_REGNUM]; char *sp_str = reg_names[STACK_POINTER_REGNUM];
char *fp_str = reg_names[FRAME_POINTER_REGNUM]; char *fp_str = reg_names[FRAME_POINTER_REGNUM];
char *t1_str = "%g1"; const char *t1_str = "%g1";
/* In the reload sequence, we don't need to fill the load delay /* In the reload sequence, we don't need to fill the load delay
slots for most of the loads, also see if we can fill the final slots for most of the loads, also see if we can fill the final
...@@ -6331,6 +6331,8 @@ hypersparc_adjust_cost (insn, link, dep_insn, cost) ...@@ -6331,6 +6331,8 @@ hypersparc_adjust_cost (insn, link, dep_insn, cost)
if (dep_type == TYPE_FPCMP) if (dep_type == TYPE_FPCMP)
return cost - 1; return cost - 1;
break; break;
default:
break;
} }
break; break;
...@@ -6540,7 +6542,7 @@ enum ultra_code { NONE=0, /* no insn at all */ ...@@ -6540,7 +6542,7 @@ enum ultra_code { NONE=0, /* no insn at all */
SINGLE, /* single issue instructions */ SINGLE, /* single issue instructions */
NUM_ULTRA_CODES }; NUM_ULTRA_CODES };
static char *ultra_code_names[NUM_ULTRA_CODES] = { static const char *ultra_code_names[NUM_ULTRA_CODES] = {
"NONE", "IEU0", "IEU1", "IEUN", "LSU", "CTI", "NONE", "IEU0", "IEU1", "IEUN", "LSU", "CTI",
"FPM", "FPA", "SINGLE" }; "FPM", "FPA", "SINGLE" };
......
...@@ -87,7 +87,7 @@ enum cmodel { ...@@ -87,7 +87,7 @@ enum cmodel {
}; };
/* Value of -mcmodel specified by user. */ /* Value of -mcmodel specified by user. */
extern char *sparc_cmodel_string; extern const char *sparc_cmodel_string;
/* One of CM_FOO. */ /* One of CM_FOO. */
extern enum cmodel sparc_cmodel; extern enum cmodel sparc_cmodel;
...@@ -389,7 +389,7 @@ void sparc_override_options (); ...@@ -389,7 +389,7 @@ void sparc_override_options ();
{ \ { \
if (flag_pic) \ if (flag_pic) \
{ \ { \
char *pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC"; \ const char *pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC";\
warning ("%s and profiling conflict: disabling %s", \ warning ("%s and profiling conflict: disabling %s", \
pic_string, pic_string); \ pic_string, pic_string); \
flag_pic = 0; \ flag_pic = 0; \
...@@ -675,8 +675,8 @@ extern enum processor_type sparc_cpu; ...@@ -675,8 +675,8 @@ extern enum processor_type sparc_cpu;
/* sparc_select[0] is reserved for the default cpu. */ /* sparc_select[0] is reserved for the default cpu. */
struct sparc_cpu_select struct sparc_cpu_select
{ {
char *string; const char *string;
char *name; const char *name;
int set_tune_p; int set_tune_p;
int set_arch_p; int set_arch_p;
}; };
...@@ -684,9 +684,9 @@ struct sparc_cpu_select ...@@ -684,9 +684,9 @@ struct sparc_cpu_select
extern struct sparc_cpu_select sparc_select[]; extern struct sparc_cpu_select sparc_select[];
/* Variables to record values the user passes. */ /* Variables to record values the user passes. */
extern char *sparc_align_loops_string; extern const char *sparc_align_loops_string;
extern char *sparc_align_jumps_string; extern const char *sparc_align_jumps_string;
extern char *sparc_align_funcs_string; extern const char *sparc_align_funcs_string;
/* Parsed values as a power of two. */ /* Parsed values as a power of two. */
extern int sparc_align_loops; extern int sparc_align_loops;
extern int sparc_align_jumps; extern int sparc_align_jumps;
...@@ -3400,7 +3400,7 @@ extern int sparc_splitdi_legitimate (); ...@@ -3400,7 +3400,7 @@ extern int sparc_splitdi_legitimate ();
extern int sparc_absnegfloat_split_legitimate (); extern int sparc_absnegfloat_split_legitimate ();
extern char *output_cbranch (); extern char *output_cbranch ();
extern char *output_return (); extern const char *output_return ();
extern char *output_v9branch (); extern char *output_v9branch ();
extern void emit_v9_brxx_insn (); extern void emit_v9_brxx_insn ();
......
...@@ -2285,10 +2285,10 @@ ...@@ -2285,10 +2285,10 @@
{ {
/* Where possible, convert CONST_DOUBLE into a CONST_INT. */ /* Where possible, convert CONST_DOUBLE into a CONST_INT. */
if (GET_CODE (operands[1]) == CONST_DOUBLE if (GET_CODE (operands[1]) == CONST_DOUBLE
#if HOST_BITS_PER_WIDE_INT != 64 #if HOST_BITS_PER_WIDE_INT == 32
&& ((CONST_DOUBLE_HIGH (operands[1]) == 0 && ((CONST_DOUBLE_HIGH (operands[1]) == 0
&& (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0) && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0)
|| (CONST_DOUBLE_HIGH (operands[1]) == 0xffffffff || (CONST_DOUBLE_HIGH (operands[1]) == (HOST_WIDE_INT) 0xffffffff
&& (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0)) && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0))
#endif #endif
) )
...@@ -7704,7 +7704,9 @@ ...@@ -7704,7 +7704,9 @@
"" ""
" "
{ {
#if 0
rtx chain = operands[0]; rtx chain = operands[0];
#endif
rtx fp = operands[1]; rtx fp = operands[1];
rtx stack = operands[2]; rtx stack = operands[2];
rtx lab = operands[3]; rtx lab = operands[3];
......
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