From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: law@cygnus.com Cc: hjl@lucon.org, wilson@cygnus.com, scox@cygnus.com, crux@pool.informatik.rwth-aachen.de, egcs@cygnus.com Subject: Re: More fp bug in egcs Date: Tue, 05 May 1998 19:14:00 -0000 Message-id: References: <23041.894353710@hurl.cygnus.com> X-SW-Source: 1998-05/msg00154.html > > > In message < m0yVnEy-000268C@ocean.lucon.org >you write: > > Here is the trimmed down test case. I am not sure if your patch is > > correct. If you take look at the stack RTL dump, you will see SF 1 in > [ ... ] > BTW, I added the testcase to the testsuite. > > jeff > Here is the stack RTL dump again. As you can see (clobber (reg:SF 14 %st(6))) should be (clobber (reg:SF 8 %st(0))) Should I worry about it? I think the bug is in move_for_stack_reg () in reg-stack.c: else if (STACK_REG_P (src)) { /* Save from a stack reg to MEM, or possibly integer reg. Since only top of stack may be saved, emit an exchange first if needs be. */ emit_swap_insn (insn, regstack, src); note = find_regno_note (insn, REG_DEAD, REGNO (src)); if (note) { replace_reg (&XEXP (note, 0), FIRST_STACK_REG); regstack->top--; CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src)); } else if (GET_MODE (src) == XFmode && regstack->top < REG_STACK_SIZE - 1) { /* A 387 cannot write an XFmode value to a MEM without clobbering the source reg. The output code can handle this by reading back the value from the MEM. But it is more efficient to use a temp register if one is available. Push the source value here if the register stack is not full, and then write the value to memory via a pop. */ rtx push_rtx, push_insn; rtx top_stack_reg = FP_MODE_REG (FIRST_STACK_REG, XFmode); push_rtx = gen_movxf (top_stack_reg, top_stack_reg); push_insn = emit_insn_before (push_rtx, insn); PUT_MODE (push_insn, QImode); REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD, top_stack_reg, REG_NOTES (insn)); } replace_reg (psrc, FIRST_STACK_REG); } The problem is not all notes are updated. -- H.J. Lu (hjl@gnu.org) ---- ;; Insn is not within a basic block (insn:QI 67 163 166 (parallel[ (set (reg:DI 2 %ecx) (fix:DI (fix:SF (reg:SF 8 %st(0))))) (clobber (reg:SF 14 %st(6))) (clobber (mem:SI (plus:SI (reg:SI 6 %ebp) (const_int -20)))) (clobber (mem:DI (plus:SI (reg:SI 6 %ebp) (const_int -28)))) (clobber (reg:SI 1 %edx)) ] ) 120 {fix_truncxfsi2-1} (nil) (nil)) ;; Insn is not within a basic block (insn:QI 166 67 68 (set (mem:SF (plus:SI (reg:SI 6 %ebp) (const_int -76))) (reg:SF 8 %st(0))) -1 (nil) (expr_list:REG_DEAD (reg:DF 8 %st(0)) (nil)))