This is the mail archive of the gcc-bugs@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]

gcc-2.95 19990623 64-bit PowerPC CSE bug


	In 64-bit mode, gcc-2.95 miscompiles the function "f" in
gcc.c-torture/execute/divconst-2.c .  Looking at the intermediate RTL
dumps, a crucial negation is removed:

-----divconst-2.c.jump-----

(insn 16 14 17 (set (reg:DI 83)
        (ashiftrt:DI (reg:DI 86)
            (const_int 31 [0x1f]))) -1 (nil)
    (expr_list:REG_EQUAL (div:DI (reg/v:DI 82)
            (const_int -2147483648 [0x80000000]))
        (nil)))

(insn 17 16 19 (set (reg:DI 83)
        (neg:DI (reg:DI 83))) -1 (nil)
    (expr_list:REG_EQUAL (div:DI (reg/v:DI 82)
            (const_int -2147483648 [0x80000000]))
        (nil)))

(insn 19 17 20 (set (reg/i:DI 3 r3)
        (reg:DI 83)) -1 (nil)
    (nil))

-----divconst-2.c.cse-----

(insn 16 14 19 (set (reg:DI 83)
        (ashiftrt:DI (reg:DI 86)
            (const_int 31 [0x1f]))) 386 {ashrdi3+1} (nil)
    (expr_list:REG_EQUAL (div:DI (reg/v:DI 82)
            (const_int -2147483648 [0x80000000]))
        (nil)))

(insn 19 16 20 (set (reg/i:DI 3 r3)
        (reg:DI 83)) 448 {*movdi_64} (nil)
    (nil))

Any idea what would make the backend think this transformation was
correct? 

Thanks, David


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