From 3433ee3503fd172ef5e1eede6dd097b09428bb3f Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 6 May 2016 13:02:42 +0000 Subject: [PATCH] gimple.c (gimple_call_same_target_p): Unique functions are eq. * gimple.c (gimple_call_same_target_p): Unique functions are eq. * tree-ssa-tail-merge.c (same_succ::equal): Check pointer eq equality first. From-SVN: r235964 --- gcc/ChangeLog | 6 ++++++ gcc/gimple.c | 3 ++- gcc/tree-ssa-tail-merge.c | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f7ad75da01..eea7c7a534b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-06 Nathan Sidwell + + * gimple.c (gimple_call_same_target_p): Unique functions are eq. + * tree-ssa-tail-merge.c (same_succ::equal): Check pointer eq + equality first. + 2016-05-06 Richard Biener PR tree-optimization/70948 diff --git a/gcc/gimple.c b/gcc/gimple.c index 25d965cead2..1a22e8235f1 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1355,7 +1355,8 @@ gimple_call_same_target_p (const gimple *c1, const gimple *c2) if (gimple_call_internal_p (c1)) return (gimple_call_internal_p (c2) && gimple_call_internal_fn (c1) == gimple_call_internal_fn (c2) - && !gimple_call_internal_unique_p (as_a (c1))); + && (!gimple_call_internal_unique_p (as_a (c1)) + || c1 == c2)); else return (gimple_call_fn (c1) == gimple_call_fn (c2) || (gimple_call_fndecl (c1) diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index e95879fb8aa..3df41fd08fc 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -538,6 +538,9 @@ same_succ::equal (const same_succ *e1, const same_succ *e2) gimple *s1, *s2; basic_block bb1, bb2; + if (e1 == e2) + return 1; + if (e1->hashval != e2->hashval) return 0; -- 2.30.2