gmon-sol2.c: Include config.h and system.h.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 7 Mar 1999 05:46:30 +0000 (05:46 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 7 Mar 1999 05:46:30 +0000 (05:46 +0000)
        * 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

gcc/ChangeLog
gcc/config/sparc/gmon-sol2.c
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h
gcc/config/sparc/sparc.md

index 0675c0301c0cfa4fa562daf268cdcf51763fe276..e3ceaf233520ffa2d9f80a56936840091c28ad4c 100644 (file)
@@ -1,3 +1,32 @@
+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>
 
        * system.h (const, inline): Move the stage2 handling of these
index 2a5b898353d9e604a4fbc4a49ef9726d40adb326..a6abcabcc51fa48efcaf67cebe41c0e5613e05bb 100644 (file)
  * for Cygnus Support, July 1992.
  */
 
-#ifndef lint
-static char sccsid[] = "@(#)gmon.c     5.3 (Berkeley) 5/22/91";
-#endif /* not lint */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <unistd.h>
-#include <fcntl.h>
+#include "config.h"
+#include "system.h"
 
 #if 0
 #include "sparc/gmon.h"
@@ -96,7 +88,9 @@ static int    s_scale;
 
 #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)
     char       *lowpc;
@@ -185,7 +179,7 @@ _mcleanup()
     int                        toindex;
     struct rawarc      rawarc;
     char               *profdir;
-    char               *proffile;
+    const char         *proffile;
     char               *progname;
     char                buf[PATH_MAX];
     extern char               **___Argv;
@@ -275,6 +269,8 @@ _mcleanup()
  * -- [eichin:19920702.1107EST]
  */
 
+static void internal_mcount PROTO((char *, unsigned short *)) ATTRIBUTE_UNUSED;
+
 /* i7 == last ret, -> frompcindex */
 /* o7 == current ret, -> selfpc */
 /* Solaris 2 libraries use _mcount.  */
@@ -297,9 +293,9 @@ static void internal_mcount(selfpc, frompcindex)
         */
 
        if(!already_setup) {
-          extern etext();
+          extern char etext[];
          already_setup = 1;
-         monstartup(0, etext);
+         monstartup(0, (char *)etext);
 #ifdef USE_ONEXIT
          on_exit(_mcleanup, 0);
 #else
index bf48b3c3aef9ed85e9c616edc593533900a1bd0f..05affdd528974e55b011194d405b097d2e00b436 100644 (file)
@@ -98,15 +98,15 @@ char leaf_reg_remap[] =
    this is "%sp+something".  We record "something" separately as it may be
    too big for reg+constant addressing.  */
 
-static char *frame_base_name;
+static const char *frame_base_name;
 static int frame_base_offset;
 
 static rtx pic_setup_code      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));
-static int restore_regs                PROTO((FILE *, int, int, char *, int, int));
-static void build_big_number   PROTO((FILE *, int, char *));
+static int restore_regs                PROTO((FILE *, int, int, const char *, int, int));
+static void build_big_number   PROTO((FILE *, int, const char *));
 static int function_arg_slotno PROTO((const CUMULATIVE_ARGS *,
                                       enum machine_mode, tree, int, int,
                                       int *, int *));
@@ -127,14 +127,14 @@ extern char *dwarf2out_cfi_label ();
 /* Option handling.  */
 
 /* Code model option as passed by user.  */
-char *sparc_cmodel_string;
+const char *sparc_cmodel_string;
 /* Parsed value.  */
 enum cmodel sparc_cmodel;
 
 /* Record alignment options as passed by user.  */
-char *sparc_align_loops_string;
-char *sparc_align_jumps_string;
-char *sparc_align_funcs_string;
+const char *sparc_align_loops_string;
+const char *sparc_align_jumps_string;
+const char *sparc_align_funcs_string;
 
 /* Parsed values, as a power of two.  */
 int sparc_align_loops;
@@ -160,7 +160,7 @@ void
 sparc_override_options ()
 {
   static struct code_model {
-    char *name;
+    const char *name;
     int value;
   } cmodels[] = {
     { "32", CM_32 },
@@ -174,7 +174,7 @@ sparc_override_options ()
   /* Map TARGET_CPU_DEFAULT to value for -m{arch,tune}=.  */
   static struct cpu_default {
     int cpu;
-    char *name;
+    const char *name;
   } cpu_default[] = {
     /* There must be one entry here for each TARGET_CPU value.  */
     { TARGET_CPU_sparc, "cypress" },
@@ -191,7 +191,7 @@ sparc_override_options ()
   struct cpu_default *def;
   /* Table of values for -m{cpu,tune}=.  */
   static struct cpu_table {
-    char *name;
+    const char *name;
     enum processor_type processor;
     int disable;
     int enable;
@@ -2886,7 +2886,7 @@ static int
 save_regs (file, low, high, base, offset, n_regs, real_offset)
      FILE *file;
      int low, high;
-     char *base;
+     const char *base;
      int offset;
      int n_regs;
      int real_offset;
@@ -2959,7 +2959,7 @@ static int
 restore_regs (file, low, high, base, offset, n_regs)
      FILE *file;
      int low, high;
-     char *base;
+     const char *base;
      int offset;
      int n_regs;
 {
@@ -3074,7 +3074,7 @@ static void
 build_big_number (file, num, reg)
      FILE *file;
      int num;
-     char *reg;
+     const char *reg;
 {
   if (num >= 0 || ! TARGET_ARCH64)
     {
@@ -3206,7 +3206,7 @@ output_function_prologue (file, size, leaf_function)
   if (num_gfregs)
     {
       int offset, real_offset, n_regs;
-      char *base;
+      const char *base;
 
       real_offset = -apparent_fsize;
       offset = -apparent_fsize + frame_base_offset;
@@ -3257,7 +3257,7 @@ output_function_epilogue (file, size, leaf_function)
      int size ATTRIBUTE_UNUSED;
      int leaf_function;
 {
-  char *ret;
+  const char *ret;
 
   if (leaf_label)
     {
@@ -3287,7 +3287,7 @@ output_function_epilogue (file, size, leaf_function)
   if (num_gfregs)
     {
       int offset, n_regs;
-      char *base;
+      const char *base;
 
       offset = -apparent_fsize + frame_base_offset;
       if (offset < -4096 || offset + num_gfregs * 4 > 4096 - 8 /*double*/)
@@ -4675,7 +4675,7 @@ epilogue_renumber (where)
 
 /* Output assembler code to return from a function.  */
 
-char *
+const char *
 output_return (operands)
      rtx *operands;
 {
@@ -5876,7 +5876,7 @@ sparc_flat_output_function_prologue (file, size)
     {
       unsigned int reg_offset = current_frame_info.reg_offset;
       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
         bytes and outgoing arguments take up more than ~4096 bytes.  When that
@@ -6055,7 +6055,7 @@ sparc_flat_output_function_epilogue (file, size)
       unsigned int size1;
       char *sp_str = reg_names[STACK_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
         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)
          if (dep_type == TYPE_FPCMP)
            return cost - 1;
          break;
+       default:
+         break;
        }
        break;
 
@@ -6540,7 +6542,7 @@ enum ultra_code { NONE=0, /* no insn at all                               */
                  SINGLE, /* single issue instructions                  */
                  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",
   "FPM", "FPA", "SINGLE" };
 
index f63d4d94f1d943282329ecf098cee7fe4a765de7..2954539d3062e0b0bd10fc7e1031c0a61eacd6d9 100644 (file)
@@ -87,7 +87,7 @@ enum cmodel {
 };
 
 /* Value of -mcmodel specified by user.  */
-extern char *sparc_cmodel_string;
+extern const char *sparc_cmodel_string;
 /* One of CM_FOO.  */
 extern enum cmodel sparc_cmodel;
 
@@ -389,7 +389,7 @@ void sparc_override_options ();
       {                                                                        \
        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",         \
                     pic_string, pic_string);                           \
            flag_pic = 0;                                               \
@@ -675,8 +675,8 @@ extern enum processor_type sparc_cpu;
 /* sparc_select[0] is reserved for the default cpu.  */
 struct sparc_cpu_select
 {
-  char *string;
-  char *name;
+  const char *string;
+  const char *name;
   int set_tune_p;
   int set_arch_p;
 };
@@ -684,9 +684,9 @@ struct sparc_cpu_select
 extern struct sparc_cpu_select sparc_select[];
 
 /* Variables to record values the user passes.  */
-extern char *sparc_align_loops_string;
-extern char *sparc_align_jumps_string;
-extern char *sparc_align_funcs_string;
+extern const char *sparc_align_loops_string;
+extern const char *sparc_align_jumps_string;
+extern const char *sparc_align_funcs_string;
 /* Parsed values as a power of two.  */
 extern int sparc_align_loops;
 extern int sparc_align_jumps;
@@ -3400,7 +3400,7 @@ extern int sparc_splitdi_legitimate ();
 extern int sparc_absnegfloat_split_legitimate ();
 
 extern char *output_cbranch ();
-extern char *output_return ();
+extern const char *output_return ();
 extern char *output_v9branch ();
 
 extern void emit_v9_brxx_insn ();
index 55d07422e9e94442f30b0b7d56221a2c18751add..c1adf93bbda1a379dc50b1bf45096a1cb4167428 100644 (file)
 {
   /* Where possible, convert CONST_DOUBLE into a CONST_INT.  */
   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_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))
 #endif
       )
   ""
   "
 {
+#if 0
   rtx chain = operands[0];
+#endif
   rtx fp = operands[1];
   rtx stack = operands[2];
   rtx lab = operands[3];