On Thu, Oct 20, 2016 at 12:56:12PM -0600, Jeff Law wrote:
> On 10/20/2016 08:37 AM, David Malcolm wrote:
> > On Thu, 2016-10-20 at 16:24 +0200, Marek Polacek wrote:
> > > On Thu, Oct 20, 2016 at 10:11:55AM -0400, Jason Merrill wrote:
> > > > On Wed, Oct 19, 2016 at 7:07 AM, Marek Polacek <pola...@redhat.com>
> > > > wrote:
> > > > > But since integer csts and various decls
> > > > > don't carry location info, this works only partially, so the
> > > > > warning
> > > > > warns even for e.g.
> > > > > 
> > > > >   if (TREE_STATIC (node) || DECL_EXTERNAL (node))
> > > > >     max_align = MAX_OFILE_ALIGNMENT;
> > > > >   else
> > > > >     max_align = MAX_STACK_ALIGNMENT;
> > > > > 
> > > > > when MAX_OFILE_ALIGNMENT and MAX_STACK_ALIGNMENT represent the
> > > > > same number.
> > > > > There's no way to get around this, so the warning isn't enabled
> > > > > by nor
> > > > > -Wall neither -Wextra, and can't be until we solve the pesky
> > > > > location
> > > > > horror.  (-Wduplicated-cond is off for the very same reason.)
> > > > 
> > > > Is someone working on this?
> > > 
> > > Not me, but I think David has been experimenting with this.  David,
> > > is that
> > > correct?
> > 
> > I started looking at this, but it's unlikely that I'll have something
> > ready for gcc 7 (have been focusing on the RTL frontend).
> Right.  David and I have kicked around some ideas on how we might get to a
> point where constants and decls can carry location information, but we
> agreed that it wasn't likely gcc-7 material.
> 
> So the question in my mind is does the warning make sense given we can't
> current disambiguate constants and thus are likely generating a goodly
> number of false positives.

That's the question.  It certainly can't be in -Wall/-Wextra given the
macro problem, but that is also true for other warnings.  Maybe it makes
sense to add it all the same so that people can experiment with it.

> [ Presumably it was good enough to catch the duplicated branch code Jon
> pointed out in tree-ssa-threadupdate.c recently?  Any other real bugs
> flagged? ]

Yeah, it would've found it.  I haven't found any other clear bugs yet.

        Marek

Reply via email to