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

            Bug ID: 80470
           Summary: Can't compile wait4 implementation on i586 target
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: i586-linux-gnu
            Target: i586-linux-gnu

Following comes from gperftools, where I can't compile with GCC 7 attach
test-case. It's implementation of wait4 syscall and it used to work with GCC6.
It's quite tricky to do the set-up, I had to use a qemu i686 machine with GCC
configured with:

../configure --prefix=/home/marxin/bin/gcc --disable-bootstrap
--disable-libsanitizer --enable-languages=c,c++ --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=i586-suse-linux
--host=i586-suse-linux

Problematic command line is:
$ ./xg++ -B. asm.ii -c  -fPIC   -fomit-frame-pointer -O
asm.ii: In function ‘void h()’:
asm.ii:15:44: error: ‘asm’ operand has impossible constraints
                          : "esp", "memory");
                                            ^

Where the problematic insn looks as follows:

1449                  if (asm_noperands (PATTERN (insn)) >= 0)
(gdb) p debug_rtx(insn)
(insn 20 69 66 4 (parallel [
            (set (reg:SI 105 [orig:96 __res ] [96])
                (asm_operands/v:SI ("push %%ebx
movl %2,%%ebx
int $0x80
pop %%ebx
") ("=a") 0 [
                        (reg:SI 105 [orig:96 __res ] [96])
                        (reg:SI 102 [orig:89 _8 ] [89])
                        (reg/f:SI 108 [orig:91 j$d ] [91])
                        (reg:SI 106 [orig:88 j$e ] [88])
                        (reg:SI 107)
                    ]
                     [
                        (asm_input:SI ("0") asm.ii:15)
                        (asm_input:SI ("ri") asm.ii:15)
                        (asm_input:SI ("c") asm.ii:15)
                        (asm_input:SI ("d") asm.ii:15)
                        (asm_input:SI ("S") asm.ii:15)
                    ]
                     [] asm.ii:15))
            (clobber (mem:BLK (scratch) [0  A8]))
            (clobber (reg/f:SI 7 sp))
            (clobber (reg:CCFP 18 fpsr))
            (clobber (reg:CC 17 flags))
        ]) "asm.ii":15 -1
     (expr_list:REG_DEAD (reg/f:SI 108 [orig:91 j$d ] [91])
        (expr_list:REG_DEAD (reg:SI 106 [orig:88 j$e ] [88])
            (expr_list:REG_DEAD (reg:SI 107)
                (expr_list:REG_DEAD (reg:SI 102 [orig:89 _8 ] [89])
                    (expr_list:REG_UNUSED (reg:CCFP 18 fpsr)
                        (expr_list:REG_UNUSED (reg:CC 17 flags)
                            (nil))))))))
$1 = void

I also tried to add registers 'c', 'd', 'S' to clobber argument, but it's still
not possible.

Thanks,
Martin

Reply via email to