public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/26190]  New: combine misses some distributivity
@ 2006-02-09  9:06 bonzini at gnu dot org
  2006-02-09  9:07 ` [Bug rtl-optimization/26190] " bonzini at gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: bonzini at gnu dot org @ 2006-02-09  9:06 UTC (permalink / raw)
  To: gcc-bugs

In this code,

  unsigned short
  crc (unsigned short crc, unsigned char data)
  {
    unsigned char i, x16;
    for (i = 0; i < 8; i++)
      {
        x16 = (data ^ (unsigned char) crc) & 1;
        data >>= 1;
        if (x16)
          {
            crc ^= 0x4002;
            crc >>= 1;
            crc |= 0x8000;
          }
        else
          crc >>= 1;
      }
    return crc;
  }

the `then' branch of the if-statement should become

  crc >>= 1;
  crc ^= 0xA001;

Seems related to bug 16798.

Paolo


-- 
           Summary: combine misses some distributivity
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bonzini at gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-26190-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2023-10-12  3:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-09  9:06 [Bug rtl-optimization/26190] New: combine misses some distributivity bonzini at gnu dot org
2006-02-09  9:07 ` [Bug rtl-optimization/26190] " bonzini at gnu dot org
2006-02-09 13:31 ` pinskia at gcc dot gnu dot org
2006-02-25 19:49 ` pinskia at gcc dot gnu dot org
     [not found] <bug-26190-4@http.gcc.gnu.org/bugzilla/>
2015-04-24 21:12 ` wilson at gcc dot gnu.org
2015-04-24 21:13 ` wilson at gcc dot gnu.org
2023-10-12  3:33 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).