This fixes a riscv64-linux bootstrap failure.
get_constant_section calls the select_section target hook, and select_section
calls get_named_section which calls get_section. So it is possible to have
a constant not a decl in both of these functions. They already call DECL_P
checks everywhere except for the new code HJ recently added. This adds the
missing DECL_P check.
gcc/
* varasm.c (get_section): Add DECL_P check before DECL_PRESERVE_P.
flags |= SECTION_NAMED;
if (HAVE_GAS_SHF_GNU_RETAIN
&& decl != nullptr
+ && DECL_P (decl)
&& DECL_PRESERVE_P (decl))
flags |= SECTION_RETAIN;
if (*slot == NULL)