https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120494

            Bug ID: 120494
           Summary: get_call_fndecl requires REG_CALL_DECL note
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

/* Get the declaration of the function called by INSN.  */

tree
get_call_fndecl (const rtx_insn *insn)
{
  rtx note, datum;

  note = find_reg_note (insn, REG_CALL_DECL, NULL_RTX);
  if (note == NULL_RTX)
    return NULL_TREE;

  datum = XEXP (note, 0);
  if (datum != NULL_RTX)
    return SYMBOL_REF_DECL (datum);

  return NULL_TREE;
}

doesn't work on

(call_insn 39 38 61 7 (set (reg:SI 0 ax)
        (call (mem:QI (symbol_ref:DI ("foo") [flags 0x3] <function_decl
0x7fffe96da900 foo>) [0 foo S1 A8])
            (const_int 0 [0]))) "pr92080-15.c":24:9 1480 {*call_value}
     (expr_list:REG_DEAD (reg:SI 5 di)
        (expr_list:REG_DEAD (reg:SI 4 si)
            (expr_list:REG_EH_REGION (const_int 0 [0])
                (nil))))
    (expr_list:SI (use (reg:SI 5 di))
        (expr_list:SI (use (reg:SI 4 si))
            (nil))))

since there is no REG_CALL_DECL note.

Reply via email to