------- Comment #4 from rguenth at gcc dot gnu dot org  2008-11-02 11:27 -------
The following fails this way with plain -O.  The key is the typedef - if you
replace the use of UInt32 with unsinged int the testcase succeeds.  Mine.

typedef unsigned int UInt32;
int Read(unsigned int *processedSize);
void FindAndReadSignature(void)
{   
    unsigned int numPrevBytes = 31;
    for (;;)
      {
        unsigned int numReadBytes = (1 << 16) - numPrevBytes;
        unsigned int processedSize;
        int __result__ = Read(&processedSize);
        unsigned int numBytesInBuffer = numPrevBytes + processedSize;
        UInt32 numTests = numBytesInBuffer - 31;
        for (unsigned int pos = 0; pos < numTests; pos++)
          ;
        numPrevBytes = numBytesInBuffer - numTests;
      }
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-11-02 10:42:12         |2008-11-02 11:27:05
               date|                            |


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

Reply via email to