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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The code get the correct cost is there (in estimate_num_insns):
    case GIMPLE_ASM:
      {
        int count = asm_str_count (gimple_asm_string (as_a <gasm *> (stmt)));
        /* 1000 means infinity. This avoids overflows later
           with very long asm statements.  */
        if (count > 1000)
          count = 1000;
        /* If this asm is asm inline, count anything as minimum size.  */
        if (gimple_asm_inline_p (as_a <gasm *> (stmt)))
          count = MIN (1, count);
        return MAX (1, count);
      }
....
/* Return the number of machine instructions likely to be generated for the
   inline-asm template. */
int
asm_str_count (const char *templ)
{
  int count = 1;

  if (!*templ)
    return 0;

  for (; *templ; templ++)
    if (IS_ASM_LOGICAL_LINE_SEPARATOR (*templ, templ)
        || *templ == '\n')
      count++;

  return count;
}
---- CUT ----
Maybe jump threading (in DOM) is not using estimate_num_insns to get that cost.

Reply via email to