public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Richard Biener <rguenther@suse.de>, gcc-patches@gcc.gnu.org
Cc: msebor@redhat.com
Subject: Re: [PATCH] tree-optimization/101573 - improve uninit warning at -O0
Date: Fri, 23 Jul 2021 11:36:56 -0600	[thread overview]
Message-ID: <58095323-cc9f-a9fa-694b-70061acba908@gmail.com> (raw)
In-Reply-To: <3on3509q-309q-8562-r54n-qr20o3ns1p5q@fhfr.qr>



On 7/22/2021 6:34 AM, Richard Biener wrote:
> We can improve uninit warnings from the early pass by looking
> at PHI arguments on fallthru edges that are uninitialized and
> have uses that are before a possible loop exit.  This catches
> some cases earlier that we'd only warn in a more confusing
> way after early inlining as seen by testcase adjustments.
>
> It introduces
>
> FAIL: gcc.dg/uninit-23.c (test for excess errors)
>
> where we additionally warn
>
> gcc.dg/uninit-23.c:21:13: warning: 't4' is used uninitialized [-Wuninitialized]
>
> which I think is OK even if it's not obvious that the new
> warning is an improvement when you look at the obvious source.
>
> Somehow for all cases I never get the `'foo' was declared here`
> notes, I didn't dig why that happens but it's odd.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>
> Any comments?
>
> Thanks,
> Richard.
>
> 2021-07-22  Richard Biener  <rguenther@suse.de>
>
> 	PR tree-optimization/101573
> 	* tree-ssa-uninit.c (warn_uninitialized_vars): Look at
> 	uninitialized PHI arg defs in some constrained cases.
> 	(execute_early_warn_uninitialized): Calculate dominators.
>
> 	* gcc.dg/uninit-pr101573.c: New testcase.
> 	* gcc.dg/uninit-15-O0.c: Adjust.
> 	* gcc.dg/uninit-15.c: Likewise.
> 	* gcc.dg/uninit-23.c: Likewise.
> 	* c-c++-common/uninit-17.c: Likewise.
OK.  Like Martin I think the new code in a function would be easier to 
read.  So if you could factor the bits into a new function it'd be 
appreciated.

I wouldn't be terribly surprised if we find additional fallout on other 
targets, but we can fault in those fixes.

Jeff



  parent reply	other threads:[~2021-07-23 17:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 12:34 Richard Biener
2021-07-22 18:03 ` Martin Sebor
2021-07-23 17:36 ` Jeff Law [this message]
2021-07-27  8:45   ` 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=58095323-cc9f-a9fa-694b-70061acba908@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@redhat.com \
    --cc=rguenther@suse.de \
    /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).