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

[Bug rtl-optimization/49088] Combine fails to properly handle zero-extension and signed int constant


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49088

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-05-20 17:19:26 UTC ---
We have

#10 0x0000000001121405 in simplify_and_const_int_1 (mode=DImode, 
    varop=0x7ffff0acbdf8, constop=4294967294)
    at /export/gnu/import/git/gcc-x32/gcc/combine.c:9413
9413      varop = force_to_mode (varop, mode, constop, 0);
(gdb) call debug_rtx (varop)
(subreg:DI (plus:SI (subreg:SI (reg/f:DI 20 frame) 0)
        (const_int -58 [0xffffffffffffffc6])) 0)
(gdb) p/x constop
$5 = 0xfffffffe
(gdb) p mode
$6 = DImode
(gdb) f 9
#9  0x000000000111db3a in force_to_mode (x=0x7ffff0acbdf8, mode=DImode, 
    mask=4294967294, just_select=0)
    at /export/gnu/import/git/gcc-x32/gcc/combine.c:8154
8154        return force_to_mode (SUBREG_REG (x), mode, mask, next_select);
(gdb) call debug_rtx (x)
(subreg:DI (plus:SI (subreg:SI (reg/f:DI 20 frame) 0)
        (const_int -58 [0xffffffffffffffc6])) 0)
(gdb) 

I think we need to adjust mask by sign-extend it.


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