This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C PATCH to fix missing -Wlogical-op warning (PR c/80525)
- From: Marek Polacek <polacek at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Thu, 4 May 2017 14:11:52 +0200
- Subject: Re: C PATCH to fix missing -Wlogical-op warning (PR c/80525)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=polacek at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3B38F7AE81
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3B38F7AE81
- References: <20170504102746.GM4255@redhat.com> <CAFiYyc1BUtif3TruFLMa-GGP_tQP-hBdRoDtoXoZd_V19awctQ@mail.gmail.com>
On Thu, May 04, 2017 at 12:42:03PM +0200, Richard Biener wrote:
> > +static tree
> > +unwrap_c_maybe_const (tree *tp, int *walk_subtrees, void *)
> > +{
> > + if (TREE_CODE (*tp) == C_MAYBE_CONST_EXPR)
> > + {
> > + *tp = C_MAYBE_CONST_EXPR_EXPR (*tp);
> > + /* C_MAYBE_CONST_EXPRs don't nest. */
> > + *walk_subtrees = false;
>
> This changes trees in-place -- do you need to operate on a copy?
Ugh, yes. But I can't simply copy_node, because that creates new VAR_DECLs,
and operand_equal_p would consider them unequal. Hmm... We need something
else.
Marek