]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add missing varasm DECL_P check.
authorJim Wilson <jimw@sifive.com>
Thu, 10 Dec 2020 02:57:32 +0000 (18:57 -0800)
committerJim Wilson <jimw@sifive.com>
Fri, 11 Dec 2020 19:14:22 +0000 (11:14 -0800)
commit755cf781f2eb3a6317af90bf3b12206b0fc54a96
treef26580128560e2ae086cf874dcb0a9db0e67017e
parent35af87784e02c8c89f020092d91858fe066788f0
Add missing varasm DECL_P check.

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.
gcc/varasm.c