This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix num_imm_uses (PR tree-optimization/70405)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: Jeff Law <law at redhat dot com>, Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 29 Mar 2016 19:54:16 +0200
- Subject: Re: [PATCH] Fix num_imm_uses (PR tree-optimization/70405)
- Authentication-results: sourceware.org; auth=none
- References: <20160329172318 dot GP3017 at tucnak dot redhat dot com> <56FABB34 dot 20605 at redhat dot com> <56FABF78 dot 1090108 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Mar 29, 2016 at 07:46:32PM +0200, Bernd Schmidt wrote:
> On 03/29/2016 07:28 PM, Jeff Law wrote:
> >On 03/29/2016 11:23 AM, Jakub Jelinek wrote:
> >>Hi!
> >>
> >>The recent change to num_imm_uses (to add support for NULL USE_STMT)
> >>broke it totally, fortunately we have just one user of this function
> >>right now. I've filed a PR for GCC 7 so that we get a warning on this.
> >>
> >>Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
> >>ok for
> >>trunk?
> >>
> >>2016-03-29 Jakub Jelinek <jakub@redhat.com>
> >>
> >> PR tree-optimization/70405
> >> * ssa-iterators.h (num_imm_uses): Add missing braces.
> >>
> >> * gcc.dg/pr70405.c: New test.
> >Not caught by -Wmisleading-indentation? Seems like it'd be worth a bug
> >report for that.
>
> Actually this looks like the dangling-else regression I've complained about
> previously. When I added that warning, I intentionally made it catch
>
> if (foo)
> for (..)
> if (bar)
> ...
> else
> ....
>
> but at some point the code was changed so as to no longer warn for this
> case.
Indeed, GCC 3.4 warns about this:
pr70405-3.c:7: warning: suggest explicit braces to avoid ambiguous `else'
That warning is still in there under -Wparentheses, but doesn't trigger
anymore.
Jakub