------- Comment #3 from jakub at gcc dot gnu dot org  2008-10-27 13:53 -------
I see at least 2 bugs.  One is simplify_shift_const "optimizes"
(lshiftrt:SI (xor:SI (ashiftrt:SI (ashift:SI (subreg:SI (mem/c/i:QI
(symbol_ref:DI ("a") <var_decl 0x7ffff33f0820 a>) [0 a+0 S1 A8]) 0)
                (const_int 24 [0x18]))
            (const_int 24 [0x18]))
        (const_int -512 [0xfffffffffffffe00]))
    (const_int 9 [0x9]))
into invalid:
(and:SI (not:SI (ashiftrt:SI (ashift:SI (subreg:SI (mem/c/i:QI (symbol_ref:DI
("a") <var_decl 0x7ffff33f0820 a>) [0 a+0 S1 A8]) 0)
                (const_int 24 [0x18]))
            (const_int 33 [0x21])))
    (const_int 8388607 [0x7fffff]))
(it should IMHO never create a shift bigger than precision, as that has
undefined behavior, while the original did not have one).
The other bug is that make_compound_operation should && mode_width >= INTVAL
(rhs), even if the user passes in undefined behavior code, GCC shouldn't ICE on
it.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-10-27 11:01:06         |2008-10-27 13:53:09
               date|                            |


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

Reply via email to