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

            Bug ID: 101428
           Summary: [10/11/12 Regression] ICE: 'asm' clobber conflict with
                    output operand
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

gcc-12.0.0-alpha20210711 snapshot (g:269256f33c51222167ad461f775d5468bb5ecaf5)
ICEs when compiling the following testcase, extracted from
test/CodeGen/inline-asm-x86-flag-output.c from the clang 12.0.0 test suite:

int test_ccge(long nr, volatile long *addr) {
  int x;
  asm("cmp %2,%1"
      : "=@ccge"(x), "=m"(*(volatile long *)(addr))
      : "r"(nr)
      : "cc");
  if (x)
    return 0;
  return 1;
}

% aarch64-linux-gnu-gcc-12.0.0 -c dwwjjifx.c
during RTL pass: expand
dwwjjifx.c: In function 'test_ccge':
dwwjjifx.c:3:3: internal compiler error: 'asm' clobber conflict with output
operand
    3 |   asm("cmp %2,%1"
      |   ^~~
0xa35e46 expand_asm_stmt
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210711/work/gcc-12-20210711/gcc/cfgexpand.c:3603
0xa3a640 expand_gimple_stmt_1
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210711/work/gcc-12-20210711/gcc/cfgexpand.c:3874
0xa3a640 expand_gimple_stmt
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210711/work/gcc-12-20210711/gcc/cfgexpand.c:4041
0xa41036 expand_gimple_basic_block
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210711/work/gcc-12-20210711/gcc/cfgexpand.c:6083
0xa42de7 execute
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210711/work/gcc-12-20210711/gcc/cfgexpand.c:6809

(if it really makes sense to file PRs for this type of ICEs, of course.)

Reply via email to