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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Sorry it is the rtl_costs for the const_int with the outer being COMPARE.

So I think this:
```
          /* 1. Hoist will GCSE constants only if TOTAL returned is non-zero.
             2. For constants loaded more than once, the approach so far has
                been to duplicate the operation than to CSE the constant.
             3. TODO: make cost more accurate specially if riscv_const_insns
                returns > 1.  */
          if (outer_code == SET || GET_MODE (x) == VOIDmode)
            *total = COSTS_N_INSNS (1);

```
should change to:
```
if (outer_code == COMPARE)
  *total = COSTS_N_INSNS (cost)
else if (outer_code == SET || GET_MODE (x) == VOIDmode)
...
```

Reply via email to