+2014-06-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-tail-merge.c (same_succ_hash): Hash the static chain of a
+ call statement, if any.
+ (gimple_equal_p) <GIMPLE_CALL>: Compare the static chain of the call
+ statements, if any. Tidy up.
+
2014-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/61431
--- /dev/null
+package body Opt38_Pkg is
+
+ procedure Proc (I : Integer);
+ pragma Inline (Proc);
+
+ procedure Proc (I : Integer) is
+
+ procedure Inner;
+ pragma No_Inline (Inner);
+
+ procedure Inner is
+ begin
+ if I /= 110 then
+ raise Program_Error;
+ end if;
+ end;
+
+ begin
+ if I > 0 then
+ Inner;
+ end if;
+ end;
+
+ procedure Test (I : Integer) is
+ begin
+ if I > -1 then
+ Proc (I);
+ else
+ Proc (I + 111);
+ end if;
+ end;
+
+end Opt38_Pkg;
hashval = iterative_hash_hashval_t
((hashval_t) gimple_call_internal_fn (stmt), hashval);
else
- hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval);
+ {
+ hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval);
+ if (gimple_call_chain (stmt))
+ hashval = iterative_hash_expr (gimple_call_chain (stmt), hashval);
+ }
for (i = 0; i < gimple_call_num_args (stmt); i++)
{
arg = gimple_call_arg (stmt, i);
switch (gimple_code (s1))
{
case GIMPLE_CALL:
- if (gimple_call_num_args (s1) != gimple_call_num_args (s2))
- return false;
if (!gimple_call_same_target_p (s1, s2))
return false;
+ t1 = gimple_call_chain (s1);
+ t2 = gimple_call_chain (s2);
+ if (!gimple_operand_equal_value_p (t1, t2))
+ return false;
+
+ if (gimple_call_num_args (s1) != gimple_call_num_args (s2))
+ return false;
+
for (i = 0; i < gimple_call_num_args (s1); ++i)
{
t1 = gimple_call_arg (s1, i);
t2 = gimple_call_arg (s2, i);
- if (gimple_operand_equal_value_p (t1, t2))
- continue;
- return false;
+ if (!gimple_operand_equal_value_p (t1, t2))
+ return false;
}
lhs1 = gimple_get_lhs (s1);