gcc/
* gimple.h (gimple_call_set_fn): Require a gimple_call.
* trans-mem.c (dump_tm_memopt_transform): Likewise.
(tm_memopt_transform_blocks): Add checked casts to gimple_call in
suites guarded by is_tm_simple_{load|store}, which enforce that
the statement must be a GIMPLE_CALL; use this when invoking
dump_tm_memopt_transform.
---
gcc/gimple.h | 3 +--
gcc/trans-mem.c | 14 ++++++++------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 33f1889..fb7b5d3 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -2957,9 +2957,8 @@ gimple_call_fn_ptr (const_gimple gs)
/* Set FN to be the function called by call statement GS. */
static inline void
-gimple_call_set_fn (gimple gs, tree fn)
+gimple_call_set_fn (gimple_call gs, tree fn)
{
- GIMPLE_CHECK (gs, GIMPLE_CALL);
gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
gimple_set_op (gs, 1, fn);
}
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 8ec892c..febc817 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -3800,7 +3800,7 @@ dump_tm_memopt_transform (gimple stmt)
static void
tm_memopt_transform_stmt (unsigned int offset,
- gimple stmt,
+ gimple_call stmt,
gimple_stmt_iterator *gsi)
{
tree fn = gimple_call_fn (stmt);
@@ -3836,28 +3836,30 @@ tm_memopt_transform_blocks (vec<basic_block> blocks)
if (is_tm_simple_load (stmt))
{
+ gimple_call call_stmt = stmt->as_a_gimple_call ();
loc = tm_memopt_value_number (stmt, NO_INSERT);
if (store_avail && bitmap_bit_p (store_avail, loc))
- tm_memopt_transform_stmt (TRANSFORM_RAW, stmt, &gsi);
+ tm_memopt_transform_stmt (TRANSFORM_RAW, call_stmt, &gsi);
else if (store_antic && bitmap_bit_p (store_antic, loc))
{
- tm_memopt_transform_stmt (TRANSFORM_RFW, stmt, &gsi);
+ tm_memopt_transform_stmt (TRANSFORM_RFW, call_stmt, &gsi);
bitmap_set_bit (store_avail, loc);
}
else if (read_avail && bitmap_bit_p (read_avail, loc))
- tm_memopt_transform_stmt (TRANSFORM_RAR, stmt, &gsi);
+ tm_memopt_transform_stmt (TRANSFORM_RAR, call_stmt, &gsi);
else
bitmap_set_bit (read_avail, loc);
}
else if (is_tm_simple_store (stmt))
{
+ gimple_call call_stmt = stmt->as_a_gimple_call ();
loc = tm_memopt_value_number (stmt, NO_INSERT);
if (store_avail && bitmap_bit_p (store_avail, loc))
- tm_memopt_transform_stmt (TRANSFORM_WAW, stmt, &gsi);
+ tm_memopt_transform_stmt (TRANSFORM_WAW, call_stmt, &gsi);
else
{
if (read_avail && bitmap_bit_p (read_avail, loc))
- tm_memopt_transform_stmt (TRANSFORM_WAR, stmt, &gsi);
+ tm_memopt_transform_stmt (TRANSFORM_WAR, call_stmt, &gsi);
bitmap_set_bit (store_avail, loc);
}
}
--
1.8.5.3