public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/24399] New: Dead code in partition_dups_1
@ 2019-01-01  0:00 vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/24399] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz

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

            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            
         into a partial unit because they are referenced from something         
         already forced into a partial unit, but also some DIEs with            
         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)
        {
...

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 = i; k < j; k++)
        {
          if (second_phase && arr[k]->die_ref_seen)
            force++;
          size += calc_sizes (arr[k]);
          for (ref = arr[k]->die_parent;
               ref->die_named_namespace && ref->die_dup == NULL;
               ref = ref->die_parent)
            {
              ref->die_dup = arr[k];
              namespaces++;
            }
        }
...
and it does not contain a break, so the expected end status will be k == j.

So, the condition 'force < j - k' with force >= will always evaluate to false.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-18 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [Bug default/24399] New: Dead code in partition_dups_1 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 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).