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 tree-optimization/18031] OR of a bitfield and a constant is not optimized at tree level


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-07 05:55 -------
For the RTL level (at least on PPC), we could combine the following instructions and simplify them:
(insn 15 13 16 0 (set (reg:SI 124)
        (const_int 1 [0x1])) 293 {*movsi_internal1} (nil)
    (nil))
(insn 17 16 18 0 (set (zero_extract:SI (reg:SI 125)
            (const_int 1 [0x1])
            (const_int 0 [0x0]))
        (reg:SI 124)) 112 {insvsi} (insn_list:REG_DEP_TRUE 15 (insn_list:REG_DEP_TRUE 16 (nil)))
    (expr_list:REG_DEAD (reg:SI 124)
        (nil)))
into:
(set (reg:SI 121)
       (ior:SI (reg:SI 119)
                 (const_int -2147483648 [0xffffffff80000000])))


For x86 we need to combine and simplify the following code (which is not simplified at the tree level or 
RTL level yet, well is is optimizated with my tree combiner to the correct thing):
unsigned f(unsigned i)
{
 unsigned t = i&1;
 t|=1;
 t|=(i&~1);
 return t;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org


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


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