public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org
Subject: Re: [PATCH] Fix CK_BAD propagation for --odr
Date: Mon, 22 Feb 2021 08:51:26 +0100	[thread overview]
Message-ID: <39407bf8-6624-f610-cd19-b8ad78e29136@suse.de> (raw)
In-Reply-To: <54d0e486-a712-13be-1f72-d5df15d1152b@suse.de>

On 2/18/21 3:20 PM, Tom de Vries wrote:

> The problem is caused by the odr code in checksum_ref_die, which skips
> checksum calculation for the children of odr types, with as unintended
> side-effect that it break the CK_BAD propagation to toplevel DIEs.
> 
> Fix this by making the skipping of the checksum calculation less intrusive.
> Specially:
> - undo all modifications related to odr in checksum_ref_die
> - After calling checksum_ref_die in read_debug_info:
>   - override die_ref_hash for odr DIEs, and
>   - recalculate die_ref_hash for all other DIEs.


> @@ -6742,6 +6741,24 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count)
>  
>  	      for (cu = cuf; cu; cu = cu->cu_next)
>  		checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
> +	      if (odr)
> +		{
> +		  for (cu = cuf; cu; cu = cu->cu_next)
> +		    {
> +		      dw_die_ref die;
> +		      FOREACH_LOW_TOPLEVEL_DIE_IN_CU (die, cu)
> +			{
> +			  if (die->die_ck_state != CK_KNOWN)
> +			    continue;
> +			  if (die_odr_state (die_cu (die), die) != ODR_NONE)
> +			    die->u.p1.die_ref_hash = die->u.p1.die_hash;
> +			  else
> +			    die->die_ref_hash_computed = 0;
> +			}
> +		    }
> +		  for (cu = cuf; cu; cu = cu->cu_next)
> +		    checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
> +		}
>  
>  	      if (dump_dies_p)
>  		for (cu = cuf; cu; cu = cu->cu_next)
> @@ -7292,6 +7323,24 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count)
>  
>        for (cu = first_cu; cu; cu = cu->cu_next)
>  	checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
> +      if (odr)
> +	{
> +	  for (cu = first_cu; cu; cu = cu->cu_next)
> +	    {
> +	      dw_die_ref die;
> +	      FOREACH_LOW_TOPLEVEL_DIE_IN_CU (die, cu)
> +		{
> +		  if (die->die_ck_state != CK_KNOWN)
> +		    continue;
> +		  if (die_odr_state (die_cu (die), die) != ODR_NONE)
> +		    die->u.p1.die_ref_hash = die->u.p1.die_hash;
> +		  else
> +		    die->die_ref_hash_computed = 0;
> +		}
> +	    }
> +	  for (cu = first_cu; cu; cu = cu->cu_next)
> +	    checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
> +	}
>  
>        if (dump_dies_p)
>  	for (cu = first_cu; cu; cu = cu->cu_next)
> 

I've realized that these two bits (for op_multifile, and rd_multifile ||
fi_multifile) are not useful, because odr is not a multi-file
optimization, so the die_odr_state (die_cu (die), die) != ODR_NONE would
always return false.

Committed with these bits dropped.

Thanks,
- Tom

      reply	other threads:[~2021-02-22  7:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16  9:11 Tom de Vries
2021-02-18 13:04 ` [committed] Add assert in partition_found_dups Tom de Vries
2021-02-18 14:20 ` [PATCH] Fix CK_BAD propagation for --odr Tom de Vries
2021-02-22  7:51   ` Tom de Vries [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=39407bf8-6624-f610-cd19-b8ad78e29136@suse.de \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=mark@klomp.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).