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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-12-18
     Ever confirmed|0                           |1

--- Comment #8 from Peter Bergner <bergner at gcc dot gnu.org> ---
Building a debug ada compiler, I see the same thing.  This does look like
you're hitting an assumption that 64-bit compiles assume they have hw FP.  If I
add -fdump-rtl-expand-all to the compile command and then look at the generated
dump file, I see:

;; Generating RTL for gimple basic block 2

;; P.0 = ada.text_io.complex_aux.get (file_2(D), width_3(D));

(insn 7 6 8 (set (reg:DI 4 4)
        (reg/v:DI 134 [ widthD.3010 ])) "a-ticoio.adb":58 -1
     (nil))

(insn 8 7 9 (set (reg:DI 3 3)
        (reg/v/f:DI 133 [ fileD.3006 ])) "a-ticoio.adb":58 -1
     (nil))

(call_insn 9 8 10 (parallel [
            (set (parallel:TI [
                        (expr_list:REG_DEP_TRUE (reg:DF 33 1)
                            (const_int 0 [0]))
                        (expr_list:REG_DEP_TRUE (reg:DF 34 2)
                            (const_int 8 [0x8]))
                    ])
                (call (mem:SI (symbol_ref:DI ("ada__text_io__complex_aux__get")
[flags 0x41] <function_decl 0x3fff8dcbbe00 ada__text_io__complex_aux__get>) [0
ada__text_io__complex_aux__getD.3060 S4 A8])
                    (const_int 0 [0])))
            (clobber (reg:DI 65 lr))
        ]) "a-ticoio.adb":58 -1
     (expr_list:REG_EH_REGION (const_int 2 [0x2])
        (expr_list:REG_CALL_DECL (symbol_ref:DI
("ada__text_io__complex_aux__get") [flags 0x41] <function_decl 0x3fff8dcbbe00
ada__text_io__complex_aux__get>)
            (nil)))
    (expr_list (use (reg:DI 2 2))
        (expr_list:DI (use (reg:DI 3 3))
            (expr_list:SI (use (reg:DI 4 4))
                (nil)))))

(insn 10 9 11 (set (reg:DF 135)
        (reg:DF 33 1)) "a-ticoio.adb":58 -1
     (nil))

(insn 11 10 12 (set (reg:DF 136)
        (reg:DF 34 2)) "a-ticoio.adb":58 -1
     (nil))

This shows we pass in the FP arguments in integer registers (regs 3 and 4) that
we'd expect with -msoft-float, but the return values and the call pattern
itself make mention of FP regs f1 and f2 (ie, regs 33 and 34), which it
shouldn't when we've disabled hw FP.  Then LRA has no way to spill those, since
FP regs don't exist with -msoft-float, so it loops forever.

Reply via email to