public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Make uninit PHI processing more consistent
Date: Mon, 29 Aug 2022 12:18:34 +0000 (UTC)	[thread overview]
Message-ID: <nycvar.YFH.7.77.849.2208291216000.14286@jbgna.fhfr.qr> (raw)

On Mon, 29 Aug 2022, Richard Biener wrote:

[...]

> The patch correctly diagnoses an uninitalized use of 'regnum'
> in store_bit_field_1 but also diagnoses an uninitialized use of
> best_match::m_best_candidate_len which I've chosen to silence
> without analyzing it in detail (I'm doing that right now).

To followup myself this is

  cpp_hashnode *best_macro = bmm.get_best_meaningful_candidate ();
  /* If a macro is the closest so far to NAME, use it, creating an 
     identifier tree node for it.  */
  if (best_macro)
    {
      const char *id = (const char *)best_macro->ident.str;
      tree macro_as_identifier
        = get_identifier_with_length (id, best_macro->ident.len);
      bm.set_best_so_far (macro_as_identifier,
                          bmm.get_best_distance (),
                          bmm.get_best_candidate_length ());

and

  edit_distance_t get_cutoff (size_t candidate_len) const
  {    
    return ::get_edit_distance_cutoff (m_goal_len, candidate_len);
  }    
       
  candidate_t get_best_meaningful_candidate () const
  {    
    /* If the edit distance is too high, the suggestion is likely to be
       meaningless.  */
    if (m_best_candidate)
      {
        edit_distance_t cutoff = get_cutoff (m_best_candidate_len);
        if (m_best_distance > cutoff)
          return NULL;
    }

where the connection between m_best_candidate_len being initialized
when m_best_candidate is not NULL is not visible.  I think it's
OK to initialize the member together with m_best_candidate here.

I'm reducing a testcase, but not sure where that will go.

Richard.

             reply	other threads:[~2022-08-29 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 12:18 Richard Biener [this message]
2022-08-30  7:30 ` Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2022-08-29 12:06 Richard Biener

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=nycvar.YFH.7.77.849.2208291216000.14286@jbgna.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.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).