https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71374
Bug ID: 71374 Summary: ICE on valid code at -O1 and above on x86_64-linux-gnu: in extract_constrain_insn, at recog.c:2190 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following code causes an ICE when compiled with the current GCC trunk (and 5.x and 6.x) at -O1 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes. This is a regression from 4.9.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160601 (experimental) [trunk revision 236978] (GCC) $ $ gcc-trunk -O0 -c small.c $ gcc-4.9 -O1 -c small.c $ $ gcc-trunk -O1 -c small.c small.c: In function ‘fn1’: small.c:5:1: error: unrecognizable insn: } ^ (insn 10 4 15 2 (parallel [ (set (reg:SI 2 cx [89]) (asm_operands:SI ("") ("=&c") 0 [ (reg/v/f:DI 4 si [orig:88 p2 ] [88]) (reg/v/f:DI 4 si [orig:88 p2 ] [88]) ] [ (asm_input:DI ("0q") small.c:4) (asm_input:DI ("2") small.c:4) ] [] small.c:4)) (set (reg:SI 5 di [90]) (asm_operands:SI ("") ("=&D") 1 [ (reg/v/f:DI 4 si [orig:88 p2 ] [88]) (reg/v/f:DI 4 si [orig:88 p2 ] [88]) ] [ (asm_input:DI ("0q") small.c:4) (asm_input:DI ("2") small.c:4) ] [] small.c:4)) (set (reg:SI 4 si [orig:88 p2 ] [88]) (asm_operands:SI ("") ("=&S") 2 [ (reg/v/f:DI 4 si [orig:88 p2 ] [88]) (reg/v/f:DI 4 si [orig:88 p2 ] [88]) ] [ (asm_input:DI ("0q") small.c:4) (asm_input:DI ("2") small.c:4) ] [] small.c:4)) (clobber (reg:CCFP 18 fpsr)) (clobber (reg:CC 17 flags)) ]) small.c:4 -1 (nil)) small.c:5:1: internal compiler error: in extract_constrain_insn, at recog.c:2190 0xb56908 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ../../gcc-source-trunk/gcc/rtl-error.c:108 0xb56939 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) ../../gcc-source-trunk/gcc/rtl-error.c:116 0xb24c3d extract_constrain_insn(rtx_insn*) ../../gcc-source-trunk/gcc/recog.c:2190 0xa4756f check_rtl ../../gcc-source-trunk/gcc/lra.c:2022 0xa4b379 lra(_IO_FILE*) ../../gcc-source-trunk/gcc/lra.c:2432 0xa01be9 do_reload ../../gcc-source-trunk/gcc/ira.c:5384 0xa01be9 execute ../../gcc-source-trunk/gcc/ira.c:5568 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ -------------------------------------------------------------------- int a, b, c; extern inline void fn1 (void *p1, void *p2) { __asm__ ("": "=&c" (a), "=&D" (b), "=&S" (c):"0q" (p2), "2" (p2)); }