]> 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:03:05 +0000 (22:03 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 13 Dec 2011 22:03:05 +0000 (22:03 +0000)
* lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
* lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets.
* lto-streamer-in.c (lto_read_body): Likewise.
(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: r182311

gcc/ChangeLog
gcc/df.h
gcc/ipa-prop.c
gcc/lto-cgraph.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 32f31498e0e7c0fb7269cc7c9859a1d19a5ce4c1..d3757c50dbb76d09ee5c1597681f5336ba31bdc7 100644 (file)
@@ -1,3 +1,15 @@
+2011-12-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
+       * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets.
+       * lto-streamer-in.c (lto_read_body): Likewise.
+       (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 684b06db0693c08700c038f858b71d12bb1f2f50..f59b52582c163d27e9f905ceec7796544a5b4896 100644 (file)
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -53,7 +53,7 @@ union df_ref_d;
 #define DF_RD      3      /* Reaching Defs. */
 #define DF_CHAIN   4      /* Def-Use and/or Use-Def Chains. */
 #define DF_WORD_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 bb32ad8e88f18c9558fd3210c58aa092dcd44c55..f2a5759b0b550f5272b771e7286b55d4d632b962 100644 (file)
@@ -2868,9 +2868,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 a7f31fee9135706f26a178004950cde081c1df80..cc126169c68601bd8ce42a3ad58b0caa32f1399b 100644 (file)
@@ -1792,9 +1792,9 @@ input_cgraph_opt_section (struct lto_file_decl_data *file_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 3f80e91b5b13238d117b33f154ef6afcf94675ab..71a7067ce2282cb3f94e03a7fd59c284d74ccebf 100644 (file)
@@ -358,7 +358,7 @@ lto_read_file_options (struct lto_file_decl_data *file_data)
   size_t len, l, skip;
   const char *data, *p;
   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);
@@ -379,10 +379,10 @@ lto_read_file_options (struct lto_file_decl_data *file_data)
 
       lto_check_version (header->lto_header.major_version,
                         header->lto_header.minor_version);
-      
+
       LTO_INIT_INPUT_BLOCK (ib, p + opts_offset, 0, header->main_size);
       input_options (&ib);
-      
+
       skip = header->main_size + opts_offset;
       l -= skip;
       p += skip;
index bfa9c37b68ba0c8d795bd0f47e24333f9c5dcf51..12ae4f1842b1c56f24b62c99651247e25c5ac336 100644 (file)
@@ -296,7 +296,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 47837177bad22a264f1b590ea1c885ef5dc0b391..5ef06abfb548860a55da9c07902a05cfc2044b80 100644 (file)
@@ -1366,9 +1366,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 3b90fdd68b53fefd1d69a713c2775f5fcd2a2625..4f5247afbf8092d6516f44efbe1e319d3a8ae16b 100644 (file)
@@ -2408,7 +2408,7 @@ write_symbol (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;
   unsigned char c;
 
@@ -2466,7 +2466,7 @@ write_symbol (struct lto_streamer_cache_d *cache,
      when symbol has attribute (visibility("hidden")) specified.
      targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this
      right. */
-     
+
   if (DECL_EXTERNAL (t)
       && !targetm.binds_local_p (t))
     visibility = GCCPV_DEFAULT;
@@ -2488,14 +2488,9 @@ write_symbol (struct lto_streamer_cache_d *cache,
       }
 
   if (kind == GCCPK_COMMON
-      && DECL_SIZE (t)
-      && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST)
-    {
-      size = (HOST_BITS_PER_WIDE_INT >= 64)
-       ? (uint64_t) int_size_in_bytes (TREE_TYPE (t))
-       : (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t))) << 32)
-               | TREE_INT_CST_LOW (DECL_SIZE_UNIT (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 7bb5b11297322af70dbfee77c61bc935152ec1b4..4f50139c87e3736f55b73cf2c776ed74a6ad3df0 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-10-26  Release Manager
 
        * GCC 4.6.2 released.
index 4c832fb8a20ab57a2d28602e6d2d938dfa1be215..3d699c4f84bca8a58cb535b34f212c3525ac0f02 100644 (file)
@@ -198,7 +198,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)
@@ -241,9 +241,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;
@@ -291,17 +291,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;
@@ -317,6 +320,7 @@ lto_parse_hex (const char *p) {
         internal_error ("could not parse hex number");
       ret |= part;
     }
+
   return ret;
 }
 
@@ -352,7 +356,7 @@ lto_resolution_read (splay_tree file_ids, 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 8110ace2749751b24b052b4bd1338fba5866500f..e7236b6cbeface5ba4600a68b3c2946980261fbf 100644 (file)
@@ -60,6 +60,4 @@ struct lto_section_slot
   size_t len;
 };
 
-int64_t lto_parse_hex (const char *p);
-
 #endif /* LTO_H */