https://gcc.gnu.org/g:ddb565d3acb79f37d253b33a8649ab1563fcc918
commit r17-4874-gddb565d3acb79f37d253b33a8649ab1563fcc918 Author: John David Anglin <[email protected]> Date: Sun Oct 4 13:25:13 2026 -0400 hppa: Fix canonicalize_funcptr_for_compare expander This fixes the case where the canonicalize_funcptr_for_compare expander is called with a SYMBOL_REF that isn't a function pointer. This can happen when one side of the comparison is a function pointer and the other side is a data or text symbol. 2026-10-04 John David Anglin <[email protected]> gcc/ChangeLog: * config/pa/pa.md (canonicalize_funcptr_for_compare): Check for SYMBOL_REF targets that are not function addresses early and emit a direct move instruction to bypass redundant libcall wrappers. Diff: --- gcc/config/pa/pa.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 4148d0dacf46..db812ba726b7 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -10199,6 +10199,15 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT" " { + /* If operand 1 is an address calculation of a variable, do not emit + a redundant libcall wrapper. Copy the address directly. */ + if (GET_CODE (operands[1]) == SYMBOL_REF + && !SYMBOL_REF_FUNCTION_P (operands[1])) + { + emit_move_insn (operands[0], operands[1]); + DONE; + } + if (TARGET_ELF32) { rtx canonicalize_funcptr_for_compare_libfunc
