On Sun, 7 May 2023, Jeff Law wrote: > > > On 5/6/23 19:55, Li, Pan2 wrote: > > It looks like we cannot simply swap the code and mode in rtx_def, the code > > may have to be the same bits as the tree_code in tree_base. Or we will meet > > ICE like below. > > > > rtx_def code 16 => 8 bits. > > rtx_def mode 8 => 16 bits. > > > > static inline decl_or_value > > dv_from_value (rtx value) > > { > > decl_or_value dv; > > dv = value; > > gcc_checking_assert (dv_is_value_p (dv)); <= ICE > > return dv; > Ugh. We really just need to fix this code. It assumes particular structure > layouts and that's just wrong/dumb.
Well, it's a neat trick ... we just need to adjust it to static inline bool dv_is_decl_p (decl_or_value dv) { return !dv || (int) GET_CODE ((rtx) dv) != (int) VALUE; } I think (and hope for the 'decl' case the bits inspected are never 'VALUE'). Of course the above stinks from a TBAA perspective ... Any "real" fix would require allocating storage for a discriminator and thus hurt the resource constrained var-tracking a lot. Richard.