This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A patch for gcc.c-torture/execute/980505-1.c


> 
>   > > Change this to (set && in_libcall) since we do not need to make any
>   > > of these transformations unless we are in a libcall block.
>   > > 
>   > 
>   > That is not true. Please see the enclosed RTL dump. When we delete
> I think this means you've misunderstood how I wanted this problem
> fixed.
> 
> To delete insns 9 and 22 we have to modify insns in the libcall block
> itself (insns 11 and 24 respectively).  We should be keying this
> on changes in the libcall block only.  Anything else is wrong.

Why do I have to fix insns 11 and 24. egcs handles them correctly. The
problem is the REG_RETVAL notes on insn 17 and 30. Please see the RTL
dumps enclosed here before and after delete_trivially_dead_insns.

> 
> Basically I think you're attacking the problem at the wrong time
> and your current scheme will lose badly.
> 

My patch fixes the REG_RETVAL note at the end of  the next libcall
block:

(insn 17 15 19 (set (reg:SI 24)
        (reg:SI 0 %eax)) -1 (nil)
    (insn_list:REG_RETVAL 11 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("f"))
                (expr_list (const_int 1)
                    (nil)))
            (nil))))

and


(insn 30 28 34 (set (reg:SI 25)
        (reg:SI 0 %eax)) 53 {movsi+2} (nil)
    (insn_list:REG_RETVAL 24 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("f"))
                (expr_list (const_int 2)
                    (nil)))
            (nil))))


H.J.
---
Here is the RTL dump before delete_trivially_dead_insns:

(insn 9 6 11 (set (reg/v:SI 23)
        (const_int 1)) -1 (nil)
    (nil))

(insn 11 9 13 (set (mem:SI (pre_dec:SI (reg:SI 7 %esp)))
        (reg/v:SI 23)) -1 (nil)
    (insn_list:REG_LIBCALL 17 (nil)))

(call_insn/u 13 11 15 (set (reg:SI 0 %eax)
        (call (mem:QI (symbol_ref:SI ("f")))
            (const_int 4))) -1 (nil)
    (nil)
    (nil))

(insn 15 13 17 (set (reg:SI 7 %esp)
        (plus:SI (reg:SI 7 %esp)
            (const_int 4))) -1 (nil)
    (nil))

(insn 17 15 19 (set (reg:SI 24)
        (reg:SI 0 %eax)) -1 (nil)
    (insn_list:REG_RETVAL 11 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("f"))
                (expr_list (reg/v:SI 23)
                    (nil)))
            (nil))))

(insn 19 17 22 (set (reg/v:SI 21)
        (reg:SI 24)) -1 (nil)
    (nil))

(insn 22 19 24 (set (reg/v:SI 23)
        (const_int 2)) -1 (nil)
    (nil))

(insn 24 22 26 (set (mem:SI (pre_dec:SI (reg:SI 7 %esp)))
        (reg/v:SI 23)) -1 (nil)
    (insn_list:REG_LIBCALL 30 (nil)))

(call_insn/u 26 24 28 (set (reg:SI 0 %eax)
        (call (mem:QI (symbol_ref:SI ("f")))
            (const_int 4))) -1 (nil)
    (nil)
    (nil))

(insn 28 26 30 (set (reg:SI 7 %esp)
        (plus:SI (reg:SI 7 %esp)
            (const_int 4))) -1 (nil)
    (nil))

(insn 30 28 32 (set (reg:SI 25)
        (reg:SI 0 %eax)) -1 (nil)
    (insn_list:REG_RETVAL 24 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("f"))
                (expr_list (reg/v:SI 23)
                    (nil)))
            (nil))))

-------
Here is the RTL dump after delete_trivially_dead_insns:

(insn 11 6 13 (set (mem:SI (pre_dec:SI (reg:SI 7 %esp)))
        (const_int 1)) 49 {movsi-2} (nil)
    (insn_list:REG_LIBCALL 17 (nil)))

(call_insn/u 13 11 15 (set (reg:SI 0 %eax)
        (call (mem:QI (symbol_ref:SI ("f")))
            (const_int 4))) -1 (nil)
    (nil)
    (nil))

(insn 15 13 17 (set (reg:SI 7 %esp)
        (plus:SI (reg:SI 7 %esp)
            (const_int 4))) 142 {addsi3+1} (nil)
    (nil))

(insn 17 15 24 (set (reg:SI 24)
        (reg:SI 0 %eax)) 53 {movsi+2} (nil)
    (insn_list:REG_RETVAL 11 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("f"))
                (expr_list (reg/v:SI 23)
                    (nil)))
            (nil))))

(insn 24 17 26 (set (mem:SI (pre_dec:SI (reg:SI 7 %esp)))
        (const_int 2)) 49 {movsi-2} (nil)
    (insn_list:REG_LIBCALL 30 (nil)))

(call_insn/u 26 24 28 (set (reg:SI 0 %eax)
        (call (mem:QI (symbol_ref:SI ("f")))
            (const_int 4))) -1 (nil)
    (nil)
    (nil))

(insn 28 26 30 (set (reg:SI 7 %esp)
        (plus:SI (reg:SI 7 %esp)
            (const_int 4))) 142 {addsi3+1} (nil)
    (nil))

(insn 30 28 34 (set (reg:SI 25)
        (reg:SI 0 %eax)) 53 {movsi+2} (nil)
    (insn_list:REG_RETVAL 24 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("f"))
                (expr_list (reg/v:SI 23)
                    (nil)))
            (nil))))



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]