]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 13 Dec 2011 22:05:56 +0000 (22:05 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 13 Dec 2011 22:05:56 +0000 (22:05 +0000)
* lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
* lto-streamer-in.c (lto_read_body): Use 'int' for offsets.
(lto_input_toplevel_asms): Likewise.
* lto-section-in.c (lto_create_simple_input_block): Likewise.
* lto-opts.c (lto_read_file_options): Likewise.
* ipa-prop.c (ipa_prop_read_section): Likewise.

* df.h (DF_NOTE): Fix typo in comment.
lto/
* lto.h (lto_parse_hex): Delete.
* lto.c (lto_read_decls): Use 'int' for offsets.
(lto_parse_hex): Make static and return proper 64-bit host type.
(lto_resolution_read): Use proper 64-bit host type.

From-SVN: r182312

gcc/ChangeLog
gcc/df.h
gcc/ipa-prop.c
gcc/lto-opts.c
gcc/lto-section-in.c
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/lto/ChangeLog
gcc/lto/lto.c
gcc/lto/lto.h

index 14eef623ebffe9815b4b09ca74dbe93f7b19bc4a..304a9580d4b3498fa34ea84eaf4c6fe24fff3b5d 100644 (file)
@@ -1,3 +1,14 @@
+2011-12-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
+       * lto-streamer-in.c (lto_read_body): Use 'int' for offsets.
+       (lto_input_toplevel_asms): Likewise.
+       * lto-section-in.c (lto_create_simple_input_block): Likewise.
+       * lto-opts.c (lto_read_file_options): Likewise.
+       * ipa-prop.c (ipa_prop_read_section): Likewise.
+
+       * df.h (DF_NOTE): Fix typo in comment.
+
 2011-12-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * regmove.c (fixup_match_2): Only access call_used_regs with hard
index c73f00fe6cebb9481173b9b803d0651dbae0f42a..9a83eb733b7e6655bb650b80c96a608d267bbf1f 100644 (file)
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -51,7 +51,7 @@ union df_ref_d;
 #define DF_RD      3      /* Reaching Defs. */
 #define DF_CHAIN   4      /* Def-Use and/or Use-Def Chains. */
 #define DF_BYTE_LR 5      /* Subreg tracking lr.  */
-#define DF_NOTE    6      /* REG_DEF and REG_UNUSED notes. */
+#define DF_NOTE    6      /* REG_DEAD and REG_UNUSED notes. */
 #define DF_MD      7      /* Multiple Definitions. */
 
 #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1)
index e9bf20470bb737485e9fafb806c148f32a04e429..97aac6f37f47d07c03d9d5a29a4ec5967df993fe 100644 (file)
@@ -2134,9 +2134,9 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data,
 {
   const struct lto_function_header *header =
     (const struct lto_function_header *) data;
-  const int32_t cfg_offset = sizeof (struct lto_function_header);
-  const int32_t main_offset = cfg_offset + header->cfg_size;
-  const int32_t string_offset = main_offset + header->main_size;
+  const int cfg_offset = sizeof (struct lto_function_header);
+  const int main_offset = cfg_offset + header->cfg_size;
+  const int string_offset = main_offset + header->main_size;
   struct data_in *data_in;
   struct lto_input_block ib_main;
   unsigned int i;
index f96dfab522d1dd917576c9739498e9eff97a9062..0b4750093101b1e1af0749f5c4fd8880cd3301d0 100644 (file)
@@ -351,7 +351,7 @@ lto_read_file_options (struct lto_file_decl_data *file_data)
   size_t len;
   const char *data;
   const struct lto_simple_header *header;
-  int32_t opts_offset;
+  int opts_offset;
   struct lto_input_block ib;
 
   data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len);
index 9277b12005fb501064531fa80646b7c0db86b63d..c0066728f38fff6c5f3b11236e17f5eebf7f96d8 100644 (file)
@@ -294,7 +294,7 @@ lto_create_simple_input_block (struct lto_file_decl_data *file_data,
     = (const struct lto_simple_header *) data;
 
   struct lto_input_block* ib_main;
-  int32_t main_offset = sizeof (struct lto_simple_header);
+  int main_offset = sizeof (struct lto_simple_header);
 
   if (!data)
     return NULL;
index c5bad64fa705d711bf8d85d4af090f92e8caf34a..f732785e122e969a9b2a768bed600e00adb31d18 100644 (file)
@@ -1445,9 +1445,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
 {
   const struct lto_function_header *header;
   struct data_in *data_in;
-  int32_t cfg_offset;
-  int32_t main_offset;
-  int32_t string_offset;
+  int cfg_offset;
+  int main_offset;
+  int string_offset;
   struct lto_input_block ib_cfg;
   struct lto_input_block ib_main;
 
index ebd54da9e286991901c5b64dff6d45c6b2408309..7e04855632f1d19d0f73a7dc379472bebcf2f259 100644 (file)
@@ -2302,7 +2302,7 @@ write_symbol_vec (struct lto_streamer_cache_d *cache,
       enum gcc_plugin_symbol_kind kind;
       enum gcc_plugin_symbol_visibility visibility;
       int slot_num;
-      uint64_t size;
+      unsigned HOST_WIDEST_INT size;
       const char *comdat;
 
       /* None of the following kinds of symbols are needed in the
@@ -2367,10 +2367,9 @@ write_symbol_vec (struct lto_streamer_cache_d *cache,
        }
 
       if (kind == GCCPK_COMMON
-         && DECL_SIZE (t)
-         && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST)
-       size = (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE (t))) << 32)
-         | TREE_INT_CST_LOW (DECL_SIZE (t));
+         && DECL_SIZE_UNIT (t)
+         && TREE_CODE (DECL_SIZE_UNIT (t)) == INTEGER_CST)
+       size = TREE_INT_CST_LOW (DECL_SIZE_UNIT (t));
       else
        size = 0;
 
index 92537f8390309be867c0bfaa754b8cac10d6d29f..74a9ee3435d39bdf32ba1605cfba54be1772f89c 100644 (file)
@@ -1,3 +1,10 @@
+2011-12-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * lto.h (lto_parse_hex): Delete.
+       * lto.c (lto_read_decls): Use 'int' for offsets.
+       (lto_parse_hex): Make static and return proper 64-bit host type.
+       (lto_resolution_read): Use proper 64-bit host type.
+
 2011-04-28  Release Manager
 
        * GCC 4.5.3 released.
index 1d8a498b5767bc7d3e6866096bd1a7d5188f2620..47e8cfe4a56f3ac33b6e249830555f6e95b111b4 100644 (file)
@@ -157,7 +157,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data,
   uint32_t ix;
   tree decl;
   uint32_t i, j;
-  
+
   ix = *data++;
   decl = lto_streamer_cache_get (data_in->reader_cache, (int) ix);
   if (TREE_CODE (decl) != FUNCTION_DECL)
@@ -200,9 +200,9 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
                VEC(ld_plugin_symbol_resolution_t,heap) *resolutions)
 {
   const struct lto_decl_header *header = (const struct lto_decl_header *) data;
-  const int32_t decl_offset = sizeof (struct lto_decl_header);
-  const int32_t main_offset = decl_offset + header->decl_state_size;
-  const int32_t string_offset = main_offset + header->main_size;
+  const int decl_offset = sizeof (struct lto_decl_header);
+  const int main_offset = decl_offset + header->decl_state_size;
+  const int string_offset = main_offset + header->main_size;
   struct lto_input_block ib_main;
   struct data_in *data_in;
   unsigned int i;
@@ -250,17 +250,20 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
 
   if (data_ptr != data_end)
     internal_error ("bytecode stream: garbage at the end of symbols section");
-  
+
   /* Set the current decl state to be the global state. */
   decl_data->current_decl_state = decl_data->global_decl_state;
 
   lto_data_in_delete (data_in);
 }
 
-/* strtoll is not portable. */
-int64_t
-lto_parse_hex (const char *p) {
-  uint64_t ret = 0;
+/* Custom version of strtoll, which is not portable.  */
+
+static HOST_WIDEST_INT
+lto_parse_hex (const char *p)
+{
+  HOST_WIDEST_INT ret = 0;
+
   for (; *p != '\0'; ++p)
     {
       char c = *p;
@@ -276,6 +279,7 @@ lto_parse_hex (const char *p) {
         internal_error ("could not parse hex number");
       ret |= part;
     }
+
   return ret;
 }
 
@@ -311,7 +315,7 @@ lto_resolution_read (FILE *resolution, lto_file *file)
     {
       int t;
       char offset_p[17];
-      int64_t offset;
+      HOST_WIDEST_INT offset;
       t = fscanf (resolution, "@0x%16s", offset_p);
       if (t != 1)
         internal_error ("could not parse file offset");
index 7f8e108054d020751199bf6e80b8b8169310070a..0a693ac7e8500c5e285a934350cde6c96688bf33 100644 (file)
@@ -58,6 +58,4 @@ struct lto_section_slot
   size_t len;
 };
 
-int64_t lto_parse_hex (const char *p);
-
 #endif /* LTO_H */