Trunk 154492 is uncompilable on Cygwin because
of incorrect data types in LTO. It compiles with the
attached fixes, but I have no write access to the
repository. Could someone please apply them?
Best regards
Piotr Wyderski
Index: gcc/lto-streamer-out.c
===
--- gcc/lto-streamer-out.c (revision 154492)
+++ gcc/lto-streamer-out.c (working copy)
@@ -86,7 +86,7 @@
/* Free the string slot pointed-to by P. */
-static void
+static void
string_slot_free (void *p)
{
struct string_slot *slot = (struct string_slot *) p;
@@ -365,7 +365,7 @@
{
unsigned i;
REAL_VALUE_TYPE r;
-
+
r = TREE_REAL_CST (expr);
bp_pack_value (bp, r.cl, 2);
bp_pack_value (bp, r.decimal, 1);
@@ -758,7 +758,7 @@
lto_output_chain (struct output_block *ob, tree t, bool ref_p)
{
int i, count;
-
+
count = list_length (t);
output_sleb128 (ob, count);
for (i = 0; i count; i++)
@@ -1612,7 +1612,7 @@
output_phi (struct output_block *ob, gimple phi)
{
unsigned i, len = gimple_phi_num_args (phi);
-
+
output_record_start (ob, lto_gimple_code_to_tag (GIMPLE_PHI));
output_uleb128 (ob, SSA_NAME_VERSION (PHI_RESULT (phi)));
@@ -1732,7 +1732,7 @@
gimple stmt = gsi_stmt (bsi);
output_gimple_stmt (ob, stmt);
-
+
/* Emit the EH region holding STMT. */
region = lookup_stmt_eh_lp_fn (fn, stmt);
if (region != 0)
@@ -1785,14 +1785,14 @@
/* The entire header is stream computed here. */
memset (header, 0, sizeof (struct lto_function_header));
-
+
/* Write the header. */
header.lto_header.major_version = LTO_major_version;
header.lto_header.minor_version = LTO_minor_version;
header.lto_header.section_type = section_type;
-
+
header.compressed_size = 0;
-
+
if (section_type == LTO_section_function_body)
header.cfg_size = ob-cfg_stream-total_size;
header.main_size = ob-main_stream-total_size;
@@ -2037,7 +2037,7 @@
VEC_safe_push (tree, heap, encoder-trees, trees[j]);
encoder-next_index = n;
}
-
+
lto_free_section_data (file_data, LTO_section_function_body, name,
data, len);
free (output_stream);
@@ -2122,7 +2122,7 @@
};
-/* Write each node in encoded by ENCODER to OB, as well as those reachable
+/* Write each node in encoded by ENCODER to OB, as well as those reachable
from it and required for correct representation of its semantics.
Each node in ENCODER must be a global declaration or a type. A node
is written only once, even if it appears multiple times in the
@@ -2230,7 +2230,7 @@
unsigned i;
int32_t ref;
tree decl;
-
+
/* Write reference to FUNCTION_DECL. If there is not function,
write reference to void_type_node. */
decl = (state-fn_decl) ? state-fn_decl : void_type_node;
@@ -2280,7 +2280,7 @@
const char *name;
enum gcc_plugin_symbol_kind kind;
enum gcc_plugin_symbol_visibility visibility;
- int slot_num;
+ int32_t slot_num;
uint64_t size;
const char *comdat;
@@ -2442,7 +2442,7 @@
needed. */
output_unreferenced_globals (set);
- memset (header, 0, sizeof (struct lto_decl_header));
+ memset (header, 0, sizeof (struct lto_decl_header));
section_name = lto_get_section_name (LTO_section_decls, NULL);
lto_begin_section (section_name, !flag_wpa);
@@ -2488,7 +2488,7 @@
lto_output_data_stream (header_stream, header, sizeof header);
lto_write_stream (header_stream);
free (header_stream);
-
+
/* Write the main out-decl state, followed by out-decl states of
functions. */
decl_state_stream = ((struct lto_output_stream *)
@@ -2504,7 +2504,7 @@
lto_output_decl_state_refs (ob, decl_state_stream, fn_out_state);
}
lto_write_stream (decl_state_stream);
- free(decl_state_stream);
+ free(decl_state_stream);
lto_write_stream (ob-main_stream);
lto_write_stream (ob-string_stream);
Index: gcc/lto-streamer-in.c
===
--- gcc/lto-streamer-in.c (revision 154492)
+++ gcc/lto-streamer-in.c (working copy)
@@ -140,7 +140,7 @@
unsigned int len;
unsigned int loc;
const char *result;
-
+
loc = lto_input_uleb128 (ib);
LTO_INIT_INPUT_BLOCK (str_tab, data_in-strings, loc, data_in-strings_len);
len = lto_input_uleb128 (str_tab);
@@ -148,7 +148,7 @@
if (str_tab.p + len data_in-strings_len)
internal_error (bytecode stream: string too long for the string table);
-
+
result = (const char *)(data_in-strings + str_tab.p);
return result;
@@ -220,7 +220,7 @@
{
enum LTO_tags tag = (enum LTO_tags) lto_input_uleb128 (ib);
return tag;
-}
+}
/* Lookup STRING in file_name_hash_table. If found, return the existing
@@ -311,7 +311,7 @@
function scope for the read tree. */
static tree
-lto_input_tree_ref (struct lto_input_block *ib, struct