[committed] Fix ICE in pa_elf_select_rtx_section

Message ID 60eca0fe-e234-c857-1d4a-b21f996d727a@bell.net
State New
Headers show
  • [committed] Fix ICE in pa_elf_select_rtx_section
Related show

Commit Message

John David Anglin Jan. 30, 2020, 12:38 p.m.
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.


2020-01-30  John David Anglin  <danglin@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);