------- Comment #1 from rguenth at gcc dot gnu dot org  2009-05-07 08:58 -------
C testcase:

int foo(_Bool b)
{
  return b | 1;
}

int bar(_Bool b)
{
  return b & -2;
}

should both be folded to return a constant but instead are never optimized,
not even at RTL level.

Due to C semantics we get

  return (int) b | 1;

and

  return (int) b & -2;

here.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-07 08:58:29
               date|                            |
            Summary|missed optimizations on     |missed optimizations on
                   |logical types: (x | 1) --> 1|(extended) logical types: (x
                   |                            || 1) --> 1


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

Reply via email to