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]
Other format: [Raw text]

Re: [RFA:] Fix gcc.c-torture/execute/20020720-1.x and further analysis


> ! # (2) The "abs(x) < 0.0" comparison is split up in too many intermediate
> ! #     insns for combine to handle -- it can handle max three insns
> ! #     simultaneously.  For example, for RISCy machines it is common that 1
> ! #     insn performs abs, 1 insn loads 0.0, 1 insn sets CCmode flags based
> ! #     upon the FP comparison, and a 4th insn makes a conditional branch
> ! #     based upon the appropriate bits in the flags.  On the other hand, if
> ! #     for example the comparison insn takes 0.0 as an operand, the
> ! #     combiner is able to see all intermediate instructions simultaneously
> ! #     and can make the optimization.

This test fails on hppa64-hpux at -O3.  The function foo is correctly optimized
but the inline copy in main is not.  After the life pass, the abs operation is
gone and we have this rtl:

(insn 16 15 27 0 800003ffeffbb960 (set (reg/v:DF 69)
        (mem/u/f:DF (reg/f:DI 70) [2 S8 A64])) 110 {*pa.md:3107} (insn_list 15 (nil))
    (expr_list:REG_DEAD (reg/f:DI 70)
	(expr_list:REG_EQUAL (const_double:DF 0 [0x0] 0 [0x0] -9223301672405565440 [0x80003fff00000000])
	    (nil))))

(insn 27 16 28 0 800003ffeffbb9c0 (set (reg:CCFP 0 %r0)
	(lt:CCFP (reg/v:DF 69)
	    (const_double:DF 0 [0x0] 0 [0x0] 0 [0x0]))) 1 {*pa.md:621} (insn_list 16 (nil))
    (expr_list:REG_DEAD (reg/v:DF 69)
	(expr_list:REG_EQUAL (const_int 0 [0x0])
	    (nil))))

(jump_insn 28 27 54 0 800003ffeffbb9c0 (set (pc)
	(if_then_else (ne (reg:CCFP 0 %r0)
		(const_int 0 [0x0]))
	    (label_ref 31)
	    (pc))) 66 {*pa.md:2159} (insn_list 27 (nil))
    (expr_list:REG_DEAD (reg:CCFP 0 %r0)
	(expr_list:REG_BR_PROB (const_int 3000 [0xbb8])
            (nil))))

>From the discussion, it appears that combine should know how to optimize
this rtl (3 insns?) but apparently there is a problem.  However, the
problem in this case isn't the abs optimization.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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