From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86845 invoked by alias); 29 Mar 2019 11:04:38 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 86789 invoked by uid 48); 29 Mar 2019 11:04:35 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/24399] New: Dead code in partition_dups_1 Date: Tue, 01 Jan 2019 00:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q1/txt/msg00158.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24399 Bug ID: 24399 Summary: Dead code in partition_dups_1 Product: dwz Version: unspecified Status: NEW Severity: normal Priority: P2 Component: default Assignee: nobody at sourceware dot org Reporter: vries at gcc dot gnu.org CC: dwz at sourceware dot org Target Milestone: --- There's this clause in partition_dups_1: ... /* If during second_phase there are some DIEs we want to force=20=20= =20=20=20=20=20=20=20=20=20=20 into a partial unit because they are referenced from something=20= =20=20=20=20=20=20=20=20 already forced into a partial unit, but also some DIEs with=20=20= =20=20=20=20=20=20=20=20=20=20 the same set of referrers, try to see if we can put also those=20= =20=20=20=20=20=20=20=20 into the partial unit. They can be put there only if they=20=20= =20=20=20=20=20=20=20=20=20=20=20 don't refer to DIEs that won't be put into partial units. */ if (second_phase && force && force < j - k) { ... It seems that the clause is dead. I can't trigger this abort in the test suites: ... diff --git a/dwz.c b/dwz.c index 6b6a33e..c44d53d 100644 --- a/dwz.c +++ b/dwz.c @@ -5349,6 +5349,7 @@ partition_dups_1 (dw_die_ref *arr, size_t vec_size, don't refer to DIEs that won't be put into partial units. */ if (second_phase && force && force < j - k) { + abort (); /* First optimistically assume all such DIEs can be put there, thus mark all such DIEs as going to be included, so that even if one of those DIEs references another one from those ... There's a loop just before this optimization: ... for (k =3D i; k < j; k++) { if (second_phase && arr[k]->die_ref_seen) force++; size +=3D calc_sizes (arr[k]); for (ref =3D arr[k]->die_parent; ref->die_named_namespace && ref->die_dup =3D=3D NULL; ref =3D ref->die_parent) { ref->die_dup =3D arr[k]; namespaces++; } } ... and it does not contain a break, so the expected end status will be k =3D= =3D j. So, the condition 'force < j - k' with force >=3D will always evaluate to f= alse. --=20 You are receiving this mail because: You are on the CC list for the bug.