/* Read the GIMPLE representation from a file stream.
- Copyright (C) 2009-2019 Free Software Foundation, Inc.
+ Copyright (C) 2009-2020 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
Re-implemented by Diego Novillo <dnovillo@google.com>
loop->owned_clique = streamer_read_hwi (ib);
loop->dont_vectorize = streamer_read_hwi (ib);
loop->force_vectorize = streamer_read_hwi (ib);
+ loop->finite_p = streamer_read_hwi (ib);
loop->simduid = stream_read_tree (ib, data_in);
place_new_loop (fn, loop);
fatal_error (input_location,
"Cgraph edge statement index out of range");
cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]);
+ cedge->lto_stmt_uid = 0;
if (!cedge->call_stmt)
fatal_error (input_location,
"Cgraph edge statement index not found");
fatal_error (input_location,
"Cgraph edge statement index out of range");
cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]);
+ cedge->lto_stmt_uid = 0;
if (!cedge->call_stmt)
fatal_error (input_location, "Cgraph edge statement index not found");
}
fatal_error (input_location,
"Reference statement index out of range");
ref->stmt = stmts[ref->lto_stmt_uid - 1];
+ ref->lto_stmt_uid = 0;
if (!ref->stmt)
fatal_error (input_location, "Reference statement index not found");
}
static void
input_function (tree fn_decl, class data_in *data_in,
- class lto_input_block *ib, class lto_input_block *ib_cfg)
+ class lto_input_block *ib, class lto_input_block *ib_cfg,
+ cgraph_node *node)
{
struct function *fn;
enum LTO_tags tag;
gimple **stmts;
basic_block bb;
- struct cgraph_node *node;
tag = streamer_read_record_start (ib);
lto_tag_check (tag, LTO_function);
gimple_register_cfg_hooks ();
- node = cgraph_node::get (fn_decl);
- if (!node)
- node = cgraph_node::create (fn_decl);
input_struct_function_base (fn, data_in, ib);
input_cfg (ib_cfg, data_in, fn);
we'd later ICE on. */
tree block;
if (gimple_debug_inline_entry_p (stmt)
- && (block = gimple_block (stmt))
- && !inlined_function_outer_scope_p (block))
+ && (((block = gimple_block (stmt))
+ && !inlined_function_outer_scope_p (block))
+ || !debug_inline_points))
remove = true;
if (is_gimple_call (stmt)
&& gimple_call_internal_p (stmt))
fixup_call_stmt_edges (node, stmts);
execute_all_ipa_stmt_fixups (node, stmts);
- update_ssa (TODO_update_ssa_only_virtuals);
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
free (stmts);
{
lto_input_block ib_cfg (data + cfg_offset, header->cfg_size,
file_data->mode_table);
- input_function (fn_decl, data_in, &ib_main, &ib_cfg);
+ input_function (fn_decl, data_in, &ib_main, &ib_cfg,
+ dyn_cast <cgraph_node *>(node));
}
else
input_constructor (fn_decl, data_in, &ib_main);
lto_read_tree_1 (ib, data_in, result);
- /* end_marker = */ streamer_read_uchar (ib);
-
return result;
}
/* Populate the reader cache with trees materialized from the SCC
- following in the IB, DATA_IN stream. */
+ following in the IB, DATA_IN stream.
+ If SHARED_SCC is true we input LTO_tree_scc. */
hashval_t
lto_input_scc (class lto_input_block *ib, class data_in *data_in,
- unsigned *len, unsigned *entry_len)
+ unsigned *len, unsigned *entry_len, bool shared_scc)
{
- /* A blob of unnamed tree nodes, fill the cache from it and
- recurse. */
unsigned size = streamer_read_uhwi (ib);
- hashval_t scc_hash = streamer_read_uhwi (ib);
+ hashval_t scc_hash = 0;
unsigned scc_entry_len = 1;
+ if (shared_scc)
+ {
+ if (size & 1)
+ scc_entry_len = streamer_read_uhwi (ib);
+ size /= 2;
+ scc_hash = streamer_read_uhwi (ib);
+ }
+
if (size == 1)
{
enum LTO_tags tag = streamer_read_record_start (ib);
unsigned int first = data_in->reader_cache->nodes.length ();
tree result;
- scc_entry_len = streamer_read_uhwi (ib);
-
/* Materialize size trees by reading their headers. */
for (unsigned i = 0; i < size; ++i)
{
|| (tag >= LTO_field_decl_ref && tag <= LTO_global_decl_ref)
|| tag == LTO_tree_pickle_reference
|| tag == LTO_integer_cst
- || tag == LTO_tree_scc)
+ || tag == LTO_tree_scc
+ || tag == LTO_trees)
gcc_unreachable ();
result = streamer_alloc_tree (ib, data_in, tag);
result = streamer_tree_cache_get_tree (data_in->reader_cache,
first + i);
lto_read_tree_1 (ib, data_in, result);
- /* end_marker = */ streamer_read_uchar (ib);
}
}
(a, len, TYPE_PRECISION (type)));
streamer_tree_cache_append (data_in->reader_cache, result, hash);
}
- else if (tag == LTO_tree_scc)
+ else if (tag == LTO_tree_scc || tag == LTO_trees)
gcc_unreachable ();
else
{
{
enum LTO_tags tag;
- /* Input and skip SCCs. */
- while ((tag = streamer_read_record_start (ib)) == LTO_tree_scc)
+ /* Input pickled trees needed to stream in the reference. */
+ while ((tag = streamer_read_record_start (ib)) == LTO_trees)
{
unsigned len, entry_len;
- lto_input_scc (ib, data_in, &len, &entry_len);
+ lto_input_scc (ib, data_in, &len, &entry_len, false);
/* Register DECLs with the debuginfo machinery. */
while (!dref_queue.is_empty ())
debug_hooks->register_external_die (e.decl, e.sym, e.off);
}
}
- return lto_input_tree_1 (ib, data_in, tag, 0);
+ tree t = lto_input_tree_1 (ib, data_in, tag, 0);
+
+ if (!dref_queue.is_empty ())
+ {
+ dref_entry e = dref_queue.pop ();
+ debug_hooks->register_external_die (e.decl, e.sym, e.off);
+ gcc_checking_assert (dref_queue.is_empty ());
+ }
+ return t;
}
}
/* FALLTHRU */
default:
- fatal_error (UNKNOWN_LOCATION, "unsupported mode %qs", mname);
+ /* This is only used for offloading-target compilations and
+ is a user-facing error. Give a better error message for
+ the common modes; see also mode-classes.def. */
+ if (mclass == MODE_FLOAT)
+ fatal_error (UNKNOWN_LOCATION,
+ "%s - %u-bit-precision floating-point numbers "
+ "unsupported (mode %qs)", TARGET_MACHINE,
+ prec.to_constant (), mname);
+ else if (mclass == MODE_DECIMAL_FLOAT)
+ fatal_error (UNKNOWN_LOCATION,
+ "%s - %u-bit-precision decimal floating-point "
+ "numbers unsupported (mode %qs)", TARGET_MACHINE,
+ prec.to_constant (), mname);
+ else if (mclass == MODE_COMPLEX_FLOAT)
+ fatal_error (UNKNOWN_LOCATION,
+ "%s - %u-bit-precision complex floating-point "
+ "numbers unsupported (mode %qs)", TARGET_MACHINE,
+ prec.to_constant (), mname);
+ else if (mclass == MODE_INT)
+ fatal_error (UNKNOWN_LOCATION,
+ "%s - %u-bit integer numbers unsupported (mode "
+ "%qs)", TARGET_MACHINE, prec.to_constant (), mname);
+ else
+ fatal_error (UNKNOWN_LOCATION, "%s - unsupported mode %qs",
+ TARGET_MACHINE, mname);
break;
}
}