Compile the following program with -O3 on FreeBSD or Linux, x86: /////////////// #include <stdlib.h> #include <string.h> register long foo asm("esi"); register long bar asm("edi"); char * crash_me_baby(char *str) { char *path = malloc(1024 + strlen(str)); return path; } /////////////// This results in an error like the following: test.c:10: error: unable to find a register to spill in class 'DIREG' test.c:10: error: this is the insn: (insn:HI 16 83 17 2 (parallel [ (set (reg:SI 2 cx [66]) (unspec:SI [ (mem:BLK (reg/v/f:SI 63 [ suffix ]) [0 A8]) (reg:QI 0 ax [70]) (const_int 1 [0x1]) (reg:SI 2 cx [69]) ] 20)) (use (reg:SI 19 dirflag)) (clobber (reg/f:SI 68 [ suffix ])) (clobber (reg:CC 17 flags)) ]) 530 {*strlenqi_1} (insn_list:REG_DEP_TRUE 6 (insn_list:REG_DEP_TRUE 12 (insn_list:REG_DEP_TRUE 14 (insn_list:REG_DEP_TRUE 15 (nil))))) (expr_list:REG_DEAD (reg:SI 19 dirflag) (expr_list:REG_DEAD (reg:SI 2 cx [69]) (expr_list:REG_DEAD (reg:QI 0 ax [70]) (expr_list:REG_UNUSED (reg:CC 17 flags) (expr_list:REG_UNUSED (reg/f:SI 68 [ suffix ]) (expr_list:REG_EQUAL (unspec:SI [ (mem:BLK (reg/v/f:SI 63 [ suffix ]) [0 A8]) (reg:QI 0 ax [70]) (const_int 1 [0x1]) (reg:SI 2 cx [69]) ] 20) (nil))))))))
Created attachment 14068 [details] Test case This is a test case for the bug. Compile with -O1, -O2 or -O3 to trigger it. With -O0, it compiles fine.
*** This bug has been marked as a duplicate of 11001 ***