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

            Bug ID: 95943
           Summary: arc -mbig-endian "inappropriate arguments" error from
                    assembler
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arnd at linaro dot org
  Target Milestone: ---

Building an 'allmodconfig' linux kernel for ARC results in a failure to
assemble one file:

{standard input}: Assembler messages:
{standard input}:12347: Error: inappropriate arguments for opcode 'mpyd'
make[3]: *** [/tmp/mainline/scripts/Makefile.build:281: kernel/sched/core.o]
Error 1

With creduce, I reduced the problem to

void a(int b, int c, long long d) {
  long e = d;
  long long f = 0;
  if (e / 1000)
    f = (long long)e * 1000;
  g(a, f);
}

$ arc-linux-gcc-O2 -mbig-endian  -mcpu=hs38 -c test.c
/tmp/ccfzWfgR.s: Assembler messages:
/tmp/ccfzWfgR.s:21: Error: inappropriate arguments for opcode 'mpyd'


$ arc-linux-gcc-O2 -mbig-endian  -mcpu=hs38 -S test.c -o-
        .section        .text
        .align 4
        .global a
        .type   a, @function
a:
        mov_s   r2,r3   ;4
        add r2,r2,999
        cmp r2,1998
        mov.ls r2,0
        mov.ls r3,0
        mpyd.hi r2,r3,1000
        mov_s   r1,r2   ;4
        mov_s   r0,@a   ;13
        b.d     @g
        mov_s   r2,r3   ;4
        .size   a, .-a
        .ident  "GCC: (GNU) 10.1.0"

This happens with at least gcc-8 through gcc-10, but not with gcc-7.5.

Reply via email to