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

--- Comment #16 from Drea Pinski <pinskia at gcc dot gnu.org> ---
So flow_active_insn_p has:
  if ((GET_CODE (PATTERN (insn)) == CLOBBER
       || GET_CODE (PATTERN (insn)) == USE)
      && REG_P (XEXP (PATTERN (insn), 0))
      && REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))
    return true;

But here we have:
(insn 86 84 138 18 (clobber (reg:SI 0 ax [orig:133 <retval> ] [133]))
"/app/example.cpp":23:1 -1
     (expr_list:REG_UNUSED (reg:SI 0 ax [orig:133 <retval> ] [133])
        (nil)))


That code is expected:
(insn 85 84 86 16 (clobber (reg/i:SI 0 ax)) "/app/example.cpp":23:1 -1
     (nil))

Notice the /i there.

Before DSE we have:
(insn 186 189 187 22 (clobber (reg/i:SI 0 ax)) "/app/example.cpp":23:1 -1
     (nil))
(insn 187 186 192 22 (clobber (reg:SI 0 ax [orig:133 <retval> ] [133]))
"/app/example.cpp":23:1 -1
     (nil))

dce inside dse2 is removing it:

DCE: Deleting insn 186
deleting insn with uid = 186.

So maybe DCE should NOT be removing the clobber with REG_FUNCTION_VALUE_P  set.

Reply via email to