aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-10-20 17:30:17 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-10-20 15:30:17 +0000
commit3e23d1bcc4d4b3daf48651d622404c88f9072fe7 (patch)
treeb07dffedeeb4914ef5c5bccf9990ff7e49c9b5a8
parent2c35bbe14a830f58e121a6bd59c7088de93fc155 (diff)
downloadgcc-3e23d1bcc4d4b3daf48651d622404c88f9072fe7.zip
gcc-3e23d1bcc4d4b3daf48651d622404c88f9072fe7.tar.gz
gcc-3e23d1bcc4d4b3daf48651d622404c88f9072fe7.tar.bz2
Do not fixup edges for a thunk in LTRANS (PR lto/78049)
PR lto/78049 * lto-streamer-in.c (fixup_call_stmt_edges_1): Replace value comparison with STMT_UID_NOT_IN_RANGE. (fixup_call_stmt_edges): Do not fixup edges of a thunk in LTRANS. From-SVN: r241380
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/lto-streamer-in.c12
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7b72536..1d06d98 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2016-10-20 Martin Liska <mliska@suse.cz>
+
+ PR lto/78049
+ * lto-streamer-in.c (fixup_call_stmt_edges_1): Replace value
+ comparison with STMT_UID_NOT_IN_RANGE.
+ (fixup_call_stmt_edges): Do not fixup edges of a thunk in
+ LTRANS.
+
2016-10-20 Eric Botcazou <ebotcazou@adacore.com>
* compare-elim.c (conforming_compare): Accept UNSPECs.
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index f852bf9..1f39e6b 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -889,13 +889,16 @@ static void
fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple **stmts,
struct function *fn)
{
+#define STMT_UID_NOT_IN_RANGE(uid) \
+ (gimple_stmt_max_uid (fn) < uid || uid == 0)
+
struct cgraph_edge *cedge;
struct ipa_ref *ref = NULL;
unsigned int i;
for (cedge = node->callees; cedge; cedge = cedge->next_callee)
{
- if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
+ if (STMT_UID_NOT_IN_RANGE (cedge->lto_stmt_uid))
fatal_error (input_location,
"Cgraph edge statement index out of range");
cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]);
@@ -905,7 +908,7 @@ fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple **stmts,
}
for (cedge = node->indirect_calls; cedge; cedge = cedge->next_callee)
{
- if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
+ if (STMT_UID_NOT_IN_RANGE (cedge->lto_stmt_uid))
fatal_error (input_location,
"Cgraph edge statement index out of range");
cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]);
@@ -915,7 +918,7 @@ fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple **stmts,
for (i = 0; node->iterate_reference (i, ref); i++)
if (ref->lto_stmt_uid)
{
- if (gimple_stmt_max_uid (fn) < ref->lto_stmt_uid)
+ if (STMT_UID_NOT_IN_RANGE (ref->lto_stmt_uid))
fatal_error (input_location,
"Reference statement index out of range");
ref->stmt = stmts[ref->lto_stmt_uid - 1];
@@ -937,7 +940,8 @@ fixup_call_stmt_edges (struct cgraph_node *orig, gimple **stmts)
orig = orig->clone_of;
fn = DECL_STRUCT_FUNCTION (orig->decl);
- fixup_call_stmt_edges_1 (orig, stmts, fn);
+ if (!orig->thunk.thunk_p)
+ fixup_call_stmt_edges_1 (orig, stmts, fn);
if (orig->clones)
for (node = orig->clones; node != orig;)
{