flags.h (g_switch_value): Change to an unsigned HOST_WIDE_INT.
authorMatt Kraai <kraai@alumni.cmu.edu>
Mon, 19 May 2003 00:31:10 +0000 (00:31 +0000)
committerMatt Kraai <kraai@gcc.gnu.org>
Mon, 19 May 2003 00:31:10 +0000 (00:31 +0000)
* flags.h (g_switch_value): Change to an unsigned
HOST_WIDE_INT.
* toplev.c (g_switch_value): Likewise.

* config/alpha/alpha.c (small_symbolic_operand): Remove
g_switch_value cast.
(alpha_in_small_data_p): Cast size to an unsigned
HOST_WIDE_INT.

* config/frv/frv.c (frv_in_small_data_p): Cast size to an
unsigned HOST_WIDE_INT.
* config/frv/frv.h (g_switch_value, g_switch_set): Remove.
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Declare g_switch_set.

* config/m32r/m32r.c (m32r_in_small_data_p): Cast size to an
unsigned HOST_WIDE_INT.
(m32r_asm_file_start): Use HOST_WIDE_INT_PRINT_UNSIGNED.
* config/m32r/m32r.h (g_switch_value, g_switch_set): Remove.
(ASM_OUTPUT_ALIGNED_COMMON): Declare g_switch_value.

* config/rs6000/rs6000.c (rs6000_file_start): Use
HOST_WIDE_INT_PRINT_UNSIGNED.
(small_data_operand): Cast summand to unsigned HOST_WIDE_INT.
(rs6000_elf_in_small_data_p): Cast size to unsigned
HOST_WIDE_INT.
* config/rs6000/sysv4.h (g_switch_value, g_switch_set):
Remove.
(SUBTARGET_OVERRIDE_OPTIONS): Declare g_switch_value and
g_switch_set.
(ASM_OUTPUT_ALIGNED_LOCAL): Declare g_switch_value and remove
g_switch_value cast.

From-SVN: r66945

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/frv/frv.c
gcc/config/frv/frv.h
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/sysv4.h
gcc/flags.h
gcc/toplev.c

index 96f2290c53f20f7ba09346ca656c6dd16b920f69..41f88875975b7fc1d5566b222ac35f9c908b443a 100644 (file)
@@ -1,3 +1,37 @@
+2003-05-18  Matt Kraai  <kraai@alumni.cmu.edu>
+
+       * flags.h (g_switch_value): Change to an unsigned
+       HOST_WIDE_INT.
+       * toplev.c (g_switch_value): Likewise.
+
+       * config/alpha/alpha.c (small_symbolic_operand): Remove
+       g_switch_value cast. 
+       (alpha_in_small_data_p): Cast size to an unsigned
+       HOST_WIDE_INT.
+
+       * config/frv/frv.c (frv_in_small_data_p): Cast size to an
+       unsigned HOST_WIDE_INT.
+       * config/frv/frv.h (g_switch_value, g_switch_set): Remove.
+       (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Declare g_switch_set.
+
+       * config/m32r/m32r.c (m32r_in_small_data_p): Cast size to an
+       unsigned HOST_WIDE_INT.
+       (m32r_asm_file_start): Use HOST_WIDE_INT_PRINT_UNSIGNED.
+       * config/m32r/m32r.h (g_switch_value, g_switch_set): Remove.
+       (ASM_OUTPUT_ALIGNED_COMMON): Declare g_switch_value.
+
+       * config/rs6000/rs6000.c (rs6000_file_start): Use
+       HOST_WIDE_INT_PRINT_UNSIGNED.
+       (small_data_operand): Cast summand to unsigned HOST_WIDE_INT.
+       (rs6000_elf_in_small_data_p): Cast size to unsigned
+       HOST_WIDE_INT.
+       * config/rs6000/sysv4.h (g_switch_value, g_switch_set):
+       Remove.
+       (SUBTARGET_OVERRIDE_OPTIONS): Declare g_switch_value and
+       g_switch_set.
+       (ASM_OUTPUT_ALIGNED_LOCAL): Declare g_switch_value and remove
+       g_switch_value cast.
+
 2003-05-18  Roger Sayle  <roger@eyesopen.com>
            Zack Weinberg  <zack@codesourcery.com>
 
index 276428574e653d13ae44a80d596164e8de838543..76f399e3c6e15119f1d5eb7ef5893763b50ec392 100644 (file)
@@ -1166,7 +1166,7 @@ small_symbolic_operand (op, mode)
   /* ??? There's no encode_section_info equivalent for the rtl
      constant pool, so SYMBOL_FLAG_SMALL never gets set.  */
   if (CONSTANT_POOL_ADDRESS_P (op))
-    return GET_MODE_SIZE (get_pool_mode (op)) <= (unsigned) g_switch_value;
+    return GET_MODE_SIZE (get_pool_mode (op)) <= g_switch_value;
 
   return (SYMBOL_REF_LOCAL_P (op)
          && SYMBOL_REF_SMALL_P (op)
@@ -1891,7 +1891,7 @@ alpha_in_small_data_p (exp)
 
       /* If this is an incomplete type with size 0, then we can't put it
         in sdata because it might be too big when completed.  */
-      if (size > 0 && size <= g_switch_value)
+      if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
        return true;
     }
 
index 822c19a0693160f2d22c1d94cbb06640417669ea..c2a8ef95c6cdc5e5c9b8d2e9f6507a7e8a325d66 100644 (file)
@@ -9714,7 +9714,7 @@ frv_in_small_data_p (decl)
     return false;
 
   size = int_size_in_bytes (TREE_TYPE (decl));
-  if (size > 0 && size <= g_switch_value)
+  if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
     return true;
 
   /* If we already know which section the decl should be in, see if
index c93ad267a75f84b7580d5293a125d64cfa16b040..f7d46c0ab80e29456ea845eb00a27086f1f851b4 100644 (file)
@@ -554,9 +554,6 @@ extern int target_flags;
 #define SDATA_DEFAULT_SIZE 8
 #endif
 
-extern int g_switch_value;        /* value of the -G xx switch */
-extern int g_switch_set;          /* whether -G xx was passed.  */
-
 
 /* Storage Layout */
 
@@ -2783,6 +2780,8 @@ extern int size_directive_output;
 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
 do {                                                                           \
+  extern unsigned HOST_WIDE_INT g_switch_value;                                \
+                                                                       \
   if ((SIZE) > 0 && (SIZE) <= g_switch_value)                          \
     sbss_section ();                                                   \
   else                                                                         \
index c8f0c728e6d676f655decab06b9ab205247ead26..a4d3c1254d5257602866ce8992a3e1c214f4164a 100644 (file)
@@ -433,7 +433,7 @@ m32r_in_small_data_p (decl)
        {
          int size = int_size_in_bytes (TREE_TYPE (decl));
 
-         if (size > 0 && size <= g_switch_value)
+         if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
            return true;
        }
     }
@@ -2208,7 +2208,8 @@ m32r_asm_file_start (file)
      FILE * file;
 {
   if (flag_verbose_asm)
-    fprintf (file, "%s M32R/D special options: -G %d\n",
+    fprintf (file,
+            "%s M32R/D special options: -G " HOST_WIDE_INT_PRINT_UNSIGNED "\n",
             ASM_COMMENT_START, g_switch_value);
 }
 \f
index ec46ff5d94539af4c64f54cedc24700c5fc3ab88..ab7d5fc9484f0b5e3f2a6d5c20dae275b3e0bc85 100644 (file)
@@ -350,9 +350,6 @@ extern enum m32r_model m32r_model;
 #define SDATA_DEFAULT_SIZE 8
 #endif
 
-extern int g_switch_value;             /* value of the -G xx switch */
-extern int g_switch_set;               /* whether -G xx was passed.  */
-
 enum m32r_sdata { M32R_SDATA_NONE, M32R_SDATA_SDATA, M32R_SDATA_USE };
 
 extern enum m32r_sdata m32r_sdata;
@@ -1690,6 +1687,8 @@ extern char m32r_punct_chars[256];
 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)             \
   do                                                                   \
     {                                                                  \
+      extern unsigned HOST_WIDE_INT g_switch_value;                    \
+                                                                       \
       if (! TARGET_SDATA_NONE                                          \
          && (SIZE) > 0 && (SIZE) <= g_switch_value)                    \
        fprintf ((FILE), "%s", SCOMMON_ASM_OP);                         \
index dc25005679a0a0b814bb8f2b3a2ff8c3a9a1a903..770df4f3d53d6cca222c71b7b1c6c3221525418f 100644 (file)
@@ -950,7 +950,8 @@ rs6000_file_start (file, default_cpu)
 
       if (rs6000_sdata && g_switch_value)
        {
-         fprintf (file, "%s -G %d", start, g_switch_value);
+         fprintf (file, "%s -G " HOST_WIDE_INT_PRINT_UNSIGNED, start,
+                  g_switch_value);
          start = "";
        }
 #endif
@@ -2254,7 +2255,7 @@ small_data_operand (op, mode)
       /* We have to be careful here, because it is the referenced address
         that must be 32k from _SDA_BASE_, not just the symbol.  */
       summand = INTVAL (XEXP (sum, 1));
-      if (summand < 0 || summand > g_switch_value)
+      if (summand < 0 || (unsigned HOST_WIDE_INT) summand > g_switch_value)
        return 0;
 
       sym_ref = XEXP (sum, 0);
@@ -13452,7 +13453,7 @@ rs6000_elf_in_small_data_p (decl)
       HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl));
 
       if (size > 0
-         && size <= g_switch_value
+         && (unsigned HOST_WIDE_INT) size <= g_switch_value
          /* If it's not public, and we're not going to reference it there,
             there's no need to put it in the small data section.  */
          && (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl)))
index 4ccc71da6b5383c34503303b5de4f00edcc60ad8..d266c283ccad416772dd19c6f94c847f038ac8e0 100644 (file)
@@ -89,11 +89,6 @@ extern const char *rs6000_tls_size_string; /* For -mtls-size= */
   { "tls-size=", &rs6000_tls_size_string,                                      \
    N_("Specify bit size of immediate TLS offsets"), 0 }
 
-/* Max # of bytes for variables to automatically be put into the .sdata
-   or .sdata2 sections.  */
-extern int g_switch_value;             /* Value of the -G xx switch.  */
-extern int g_switch_set;               /* Whether -G xx was passed.  */
-
 #define SDATA_DEFAULT_SIZE 8
 
 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just
@@ -171,6 +166,9 @@ extern int g_switch_set;            /* Whether -G xx was passed.  */
 
 #define SUBTARGET_OVERRIDE_OPTIONS                                     \
 do {                                                                   \
+  extern unsigned HOST_WIDE_INT g_switch_value;                                \
+  extern int g_switch_set;                                             \
+                                                                       \
   if (!g_switch_set)                                                   \
     g_switch_value = SDATA_DEFAULT_SIZE;                               \
                                                                        \
@@ -665,8 +663,10 @@ extern int rs6000_pic_labelno;
 #undef ASM_OUTPUT_ALIGNED_LOCAL
 #define        ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)               \
 do {                                                                   \
+  extern unsigned HOST_WIDE_INT g_switch_value;                                \
+                                                                       \
   if (rs6000_sdata != SDATA_NONE && (SIZE) > 0                         \
-      && (SIZE) <= (unsigned HOST_WIDE_INT)g_switch_value)             \
+      && (SIZE) <= g_switch_value)                                     \
     {                                                                  \
       sbss_section ();                                                 \
       ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));     \
index c58b5e6a39186376ae7d0e9e4c5a4b3093b5af8b..4050517d37968ee4fda651cebe8ddf8a35b83bad 100644 (file)
@@ -586,7 +586,7 @@ extern int frame_pointer_needed;
 extern int flag_trapv;
 
 /* Value of the -G xx switch, and whether it was passed or not.  */
-extern int g_switch_value;
+extern unsigned HOST_WIDE_INT g_switch_value;
 extern int g_switch_set;
 
 /* Values of the -falign-* flags: how much to align labels in code. 
index 32e08a4c6ce0322ac71d85518744400019b4fdc2..7cfb29e8ef6d274cf137bfd2131309126e5fd8cf 100644 (file)
@@ -329,7 +329,7 @@ enum graph_dump_types graph_dump_format;
 char *asm_file_name;
 
 /* Value of the -G xx switch, and whether it was passed or not.  */
-int g_switch_value;
+unsigned HOST_WIDE_INT g_switch_value;
 int g_switch_set;
 
 /* Type(s) of debugging information we are producing (if any).