[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug default/24399] Dead code in partition_dups_1



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.