This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH to fix missing -Wlogical-op warning (PR c/80525)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]