An ICE was noticed in pa_elf_select_rtx_section building googletest on 
hppa-unknown-linux-gnu.
This change fixes the problem.  It puts function pointer rtx's without a DECL 
in .data.rel.ro.local.

Tested on hppa-unknown-linux-gnu.  Committed to trunk and gcc-9 branch.

Dave

2020-01-30  John David Anglin  <dang...@gcc.gnu.org>

        * config/pa/pa.c (pa_elf_select_rtx_section): Place function pointers
        without a DECL in .data.rel.ro.local.

diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index fb7e2ee110f..24b88304637 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -9852,7 +9852,7 @@ pa_elf_select_rtx_section (machine_mode mode, rtx x,
     {
       tree decl = SYMBOL_REF_DECL (x);

-      if (DECL_P (decl) && DECL_COMDAT_GROUP (decl))
+      if (!decl || (DECL_P (decl) && DECL_COMDAT_GROUP (decl)))
        return get_named_section (NULL, ".data.rel.ro.local", 1);
     }

Reply via email to