> > +  /* If the code of DECL is ERROR_MARK or invalid code, usually 
> > "ggc_freed", we
> > +     use integer_zero_node instead of it. This will be very helpful for the
> > +     ggc_free.  */
> > +  if (TREE_CODE (decl) == ERROR_MARK || TREE_CODE (decl) >= MAX_TREE_CODES)
> > +    decl = integer_zero_node;
> > +
> 
> ... this one looks like a hack (note ggc_free only poisons memory when
> checking is enabled).

Hi, I just built the compiler with "--enable-multilib" from riscv-gnu-toolchain 
source,
and it seems to have "CHECKING_P"/"ENABLE_EXTRA_CHECKING" on by default, 
resulting in
"flag_checking=2".

I haven't located it in detail, so I'm not sure if it is.

> I'm curious why you ever get a ggc_freed decl here.

It seems that the overloaded interface of RVV has been registered repeatedly, 
resulting
in invalid registrations except for the first registration, and these invalid 
registrations
have been ggc_freed. But anyway, I think it is necessary to do a check here. I 
think using
"integer_zero_node" is to meet the needs, although direct return would be 
better.

BR
Jin

Reply via email to