From 0305f797108bf9def3183406575ac59d98d112bb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 11 May 2012 08:50:08 +0200 Subject: [PATCH] Always perform parent check in die_eq_1 for toplevel dies, Remove unneeded inside{1,2} testing. --- dwz.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/dwz.c b/dwz.c index a7a0309..c3f61a1 100644 --- a/dwz.c +++ b/dwz.c @@ -2265,7 +2265,6 @@ die_eq_1 (dw_die_ref top_die1, dw_die_ref top_die2, unsigned char *ptr1, *ptr2; dw_die_ref ref1, ref2; dw_die_ref child1, child2; - bool inside1, inside2; #define FAIL goto fail if (die1 == die2 || die_safe_dup (die2) == die1) @@ -2284,17 +2283,15 @@ die_eq_1 (dw_die_ref top_die1, dw_die_ref top_die2, assert (die1->die_parent != NULL && die2->die_parent != NULL); - inside1 = die1->u.p1.die_enter >= top_die1->u.p1.die_enter - && die1->u.p1.die_exit <= top_die1->u.p1.die_exit; - inside2 = die2->u.p1.die_enter >= top_die2->u.p1.die_enter - && die2->u.p1.die_exit <= top_die2->u.p1.die_exit; - if (inside1 ^ inside2) - return 0; - if (inside1 - && die1->u.p1.die_enter - top_die1->u.p1.die_enter - != die2->u.p1.die_enter - top_die2->u.p1.die_enter) - return 0; - if (!inside1) + t1 = die1->die_abbrev; + t2 = die2->die_abbrev; + ptr1 = debug_sections[DEBUG_INFO].data + die1->die_offset; + ptr2 = debug_sections[DEBUG_INFO].data + die2->die_offset; + read_uleb128 (ptr1); + read_uleb128 (ptr2); + i = 0; + j = 0; + if (die1->die_toplevel) { for (ref1 = die1->die_parent, ref2 = die2->die_parent; ref1 && ref2; ref1 = ref1->die_parent, ref2 = ref2->die_parent) @@ -2316,17 +2313,6 @@ die_eq_1 (dw_die_ref top_die1, dw_die_ref top_die2, } if (ref1 == NULL || ref2 == NULL) return 0; - } - t1 = die1->die_abbrev; - t2 = die2->die_abbrev; - ptr1 = debug_sections[DEBUG_INFO].data + die1->die_offset; - ptr2 = debug_sections[DEBUG_INFO].data + die2->die_offset; - read_uleb128 (ptr1); - read_uleb128 (ptr2); - i = 0; - j = 0; - if (die1->die_toplevel) - { /* For each toplevel die seen, record optimistically that we expect them to match, to avoid recursing on it again. If non-match is determined later, -- 2.43.5