[Bug rtl-optimization/99567] New: internal error in extract_constrain_insn with asan-stack

arnd at linaro dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 12 20:45:10 GMT 2021


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

            Bug ID: 99567
           Summary: internal error in extract_constrain_insn  with
                    asan-stack
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arnd at linaro dot org
  Target Milestone: ---

I ran into an internal compiler error while building linux kernels with the
kernel address sanitizer. Reduced it to this test case:

$ gcc-11 --version
gcc-11 (Ubuntu 11-20210306-1ubuntu1) 11.0.1 20210306 (experimental) [master
revision 574e7601829:6b84c9062bc:84185598dc7470bad4e7f8c22b64e3c944efb670]

$ cat tcp_ipv4.i

enum { a };
struct b {
  short c;
};
int d(void);
void e(int, _Bool *);
void f(struct b *, int *);
void g(struct b *h) {
  int i, l;
  volatile char j;
  struct b k = *h;
  void *m = h + k.c;
  l = *(int *)m;
  asm("" : : "g"(l));
lookup:
  i = j;
  int n = d();
  _Bool o = a;
  if (i)
    f(h, m);
  e(n, &o);
  goto lookup;
}

$ gcc-11 -fno-omit-frame-pointer  -fsanitize=address  --param
asan-instrumentation-with-call-threshold=10000  --param asan-stack=1 -c -O2
-Wall tcp_ipv4.i 
tcp_ipv4.i: In function ‘g’:
tcp_ipv4.i:23:1: error: unrecognizable insn:
   23 | }
      | ^
(insn 84 83 160 10 (parallel [
            (asm_operands/v ("") ("") 0 [
                    (mem:SI (mem/c:DI (plus:DI (reg/f:DI 6 bp)
                                (const_int -192 [0xffffffffffffff40])) [9
%sfp+-144 S8 A64]) [1 MEM[(int *)m_8]+0 S4 A32])
                ]
                 [
                    (asm_input:SI ("g") tcp_ipv4.i:14)
                ]
                 [] tcp_ipv4.i:14)
            (clobber (reg:CC 17 flags))
        ]) "tcp_ipv4.i":14:3 -1
     (nil))
during RTL pass: reload
tcp_ipv4.i:23:1: internal compiler error: in extract_constrain_insn, at
recog.c:2670
0xce2eb1 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../src/gcc/rtl-error.c:108
0xce3057 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../src/gcc/rtl-error.c:116
0x95f537 extract_constrain_insn(rtx_insn*)
        ../../src/gcc/recog.c:2670
0x95f537 extract_constrain_insn(rtx_insn*)
        ../../src/gcc/recog.c:2666
0x95f537 check_rtl
        ../../src/gcc/lra.c:2087
0x17962bc lra(_IO_FILE*)
        ../../src/gcc/lra.c:2505
0x1794579 do_reload
        ../../src/gcc/ira.c:5827
0x1794579 execute
        ../../src/gcc/ira.c:6013
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.

So far this only happened on x86 targets.


More information about the Gcc-bugs mailing list