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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bergner at gcc dot gnu.org

--- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Robin Dapp from comment #0)
>  int foo (int t)
>  {
>    return 3 * t - 1;
>  }
> 
> With -march=rv64gcbv -O3, we emit:
>       slliw   a5,a0,1
>       addw    a0,a5,a0
>       addiw   a0,a0,-1
>       ret
> 
> and it could be:
>       sh1add  a0, a0, a0
>       addiw   a0, a0, -1
>       ret

Confirmed fixed on trunk, but if we simplify the test case to just:

int foo (int t)
{
  return 3 * t;
}

I'd expect just the sh1add, ala:

        sh1add  a0, a0, a0
        ret

...but instead, we get:

        slliw   a5,a0,1
        addw    a0,a5,a0
        ret

Do we want a new bugzilla entry for this?

Reply via email to