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

            Bug ID: 106632
           Summary: undefined code causes assembler failure
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: assemble-failure
          Severity: normal
          Priority: P3
         Component: target
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: riscv-linux-gnu

Take:
long f(long a, long  b)
{
  b = 66;
  return (a >> b) & 1;
}

This will produce:
f:
        bexti   a0,a0,66
        ret

Which is invalid assembly as rejected by gas:
/tmp/ccTvKnLv.s: Assembler messages:
/tmp/ccTvKnLv.s:8: Error: improper shift amount (66)

Reply via email to