"Li, Pan2" <pan2...@intel.com> writes: > Thanks Richard Sandiford. Update PATCH v4 here -> > https://gcc.gnu.org/pipermail/gcc-patches/2023-May/618099.html. > >> - if (dv_as_opaque (node->dv) != decl || node->offset != offset) >> + if (node->dv.first_or_null () != decl || node->offset != >> + offset) > >> Genuine question, but: is the first_or_null really needed? I would have >> expected node->dv != decl to work, with an implicit conversion on the >> argument. > > Directly compare node->dv and decl may requires additional overload operator, > or it may complains similar as below. But I am afraid it is unreasonable to > add such kind of operator for one specific type RTX in pointer_mux up to a > point. Thus I think here we may need node->dv == (decl_or_val) decl here. > > ../../gcc/var-tracking.cc:3233:28: error: no match for 'operator!=' (operand > types are 'rtx' {aka 'rtx_def*'} and 'decl_or_value' {aka > 'pointer_mux<tree_node, rtx_def>'}).
Yeah, since we're adding operator== and operator!= as member operators, the decl_or_value has to come first. Please try the conditions in the order that I'd written them in the review. Thanks, Richard