https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90000
--- Comment #4 from Will Schmidt <willschm at gcc dot gnu.org> --- I'll be attaching a proposed(/rfc) patch momentarily. I'm able to add logic in cfgexpand.c expand_asm_stmt() to catch the use of a FP register when our target is SOFT_FLOAT ; but the result is an ICE while trying to process a subsequent instruction. FAIL: gcc.target/powerpc/pr90000.c (test for excess errors) Excess errors: /home/willschm/gcc/gcc-patches/gcc/testsuite/gcc.target/powerpc/pr90000.c:14:3: error: invalid fp register usage with a soft_float target ^ desired error. during RTL pass: expand /home/willschm/gcc/gcc-patches/gcc/testsuite/gcc.target/powerpc/pr90000.c:16:3: internal compiler error: in operator[], at vec.h:867 0x1018dc3f vec<edge_def*, va_gc, vl_embed>::operator[](unsigned int) /home/willschm/gcc/gcc-patches/gcc/vec.h:867 0x103f0a0f vec<tree_node*, va_heap, vl_embed>::operator[](unsigned int) /home/willschm/gcc/gcc-patches/gcc/tree.h:3417 0x103f0a0f vec<tree_node*, va_heap, vl_ptr>::operator[](unsigned int) /home/willschm/gcc/gcc-patches/gcc/vec.h:1433 0x103f0a0f expand_asm_stmt /home/willschm/gcc/gcc-patches/gcc/cfgexpand.c:2959 0x103f829f expand_gimple_stmt_1 /home/willschm/gcc/gcc-patches/gcc/cfgexpand.c:3694 0x103f829f expand_gimple_stmt /home/willschm/gcc/gcc-patches/gcc/cfgexpand.c:3862 0x103ffde3 expand_gimple_basic_block /home/willschm/gcc/gcc-patches/gcc/cfgexpand.c:5902 0x10402907 execute /home/willschm/gcc/gcc-patches/gcc/cfgexpand.c:6557 ^ subsequent undesired. Per debug, the subsequent error is occurring when trying to process a subsequent instruction. Breakpoint 7, expand_asm_stmt (stmt=stmt@entry=0x200000c10000) at cfgexpand.c:2920 2920 location_t locus = gimple_location (stmt); # .MEM_3 = VDEF <.MEM_2(D)> __asm__("#" : "=d" fr1); (gdb) c Continuing./tmp/pr90000.c: In function 'foo': /tmp/pr90000.c:14:3: error: invalid fp register usage with a soft-float target 14 | __asm__ ("#" : "=d" (fr1)); /* { dg-error "invalid fp register usage with a soft-float target" } */ | ^~~~~~~ #0 expand_asm_stmt (stmt=stmt@entry=0x200000c10058) at cfgexpand.c:2920Breakpoint 7, expand_asm_stmt (stmt=stmt@entry=0x200000c10058) at cfgexpand.c:2920 2920 location_t locus = gimple_location (stmt); # VUSE <.MEM_4> __asm__ __volatile__("#" : : "r" r31); (gdb) c Continuing. #0 fancy_abort (file=0x11912d80 "/home/willschm/gcc/gcc-patches/gcc/vec.h", line=0x363, function=0x11919948 "operator[]") at diagnostic.c:1778