public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/24399] Dead code in partition_dups_1
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <bug-24399-11298-VuydvGVz8I@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24399-11298@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24399

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
I think this fixes it:
...
diff --git a/dwz.c b/dwz.c
index 6b6a33e..9728400 100644
--- a/dwz.c
+++ b/dwz.c
@@ -5347,7 +5347,7 @@ partition_dups_1 (dw_die_ref *arr, size_t vec_size,
         the same set of referrers, try to see if we can put also those
         into the partial unit.  They can be put there only if they
         don't refer to DIEs that won't be put into partial units.  */
-      if (second_phase && force && force < j - k)
+      if (second_phase && force && force < j - i)
        {
          /* First optimistically assume all such DIEs can be put there,
             thus mark all such DIEs as going to be included, so that
...

Note: j - i is the size of the partition [i,j).

The intention of the test 'force < j - k' is to test whether there are any
unforced dies in the partition. If all dies in the partition are forced, than
there's no need to enter this clause.

So overall, the code tests whether in the second phase, there are some forced
dies (force > 0) and some unforced dies (force < j - i). If there are no forced
dies, we're done. If there are only forced dies, we're also done. If there are
some forced and unforced dies, try to add unforced dies to the partial unit
already assigned the forced dies.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2019-03-29 14:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 [Bug default/24399] New: " vries at gcc dot gnu.org
2019-01-01  0:00 ` [Bug default/24399] " vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-24399-11298-VuydvGVz8I@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=dwz@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).