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

            Bug ID: 72873
           Summary: error: ‘asm’ operand has impossible constraints
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: vmakarov at redhat dot com
  Target Milestone: ---

On x86-64, I got

[hjl@gnu-6 asm-2]$ cat x.i
void foo (int disks, int start, int stop, unsigned long bytes, void **ptrs)
{
  unsigned char **dptr = (unsigned char **)ptrs;
  unsigned char *p, *q;
  int d, z, z0;
  z0 = stop;
  p = dptr[disks-2];
  q = dptr[disks-1];
  for ( d = 0 ; d < bytes ; d += 512 ) {
    asm volatile("#"
                 :
                 : "m" (p[d]), "m" (p[d+64]), "m" (p[d+128]), "m" (p[d+192]),
                 "m" (p[d+256]), "m" (p[d+320]), "m" (p[d+384]),
                 "m" (p[d+448]), "m" (q[d]), "m" (q[d+64]),
                 "m" (q[d+128]), "m" (q[d+192]), "m" (q[d+256]),
                 "m" (q[d+320]), "m" (q[d+384]), "m" (q[d+448]));
    for ( z = z0-1 ; z >= start ; z-- ) {
      asm volatile("#"
                   :
                   :
                   "m" (dptr[0][d]));
    }
    asm volatile("#"
                 :
                 : "m" (p[d]), "m" (p[d+64]), "m" (p[d+128]), "m" (p[d+192]),
                 "m" (p[d+256]), "m" (p[d+320]), "m" (p[d+384]),
                 "m" (p[d+448]), "m" (q[d]), "m" (q[d+64]),
                 "m" (q[d+128]), "m" (q[d+192]), "m" (q[d+256]),
                 "m" (q[d+320]), "m" (q[d+384]), "m" (q[d+448]));
  }
}
[hjl@gnu-6 asm-2]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2
-fno-asynchronous-unwind-tables -S -o x.s x.i
x.i: In function ‘foo’:
x.i:10:5: error: ‘asm’ operand has impossible constraints
     asm volatile("#"
     ^~~
x.i:23:5: error: ‘asm’ operand has impossible constraints
     asm volatile("#"
     ^~~
Makefile:23: recipe for target 'x.s' failed
make: *** [x.s] Error 1
[hjl@gnu-6 asm-2]$

Reply via email to