[Bug optimization/12828] -floop-optimize is unstable on PowerPC (float to int conversion problem)

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Oct 30 05:12:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-30 05:08 -------
Here is the code:
/*
 * This gives me a SIGSEGV when compiled with -floop-optimize on PPC w/3.3
 * chlunde at ifi.uio.no
 */
#include <math.h>

typedef unsigned int uint;

int main(int, char**)
{
  const uint size = 181; // 180 and lower seems to work
  unsigned char data[size][size];

  for(uint x = 0; x < size; ++x)
  {
    for(uint y = 0; y < size; ++y)
    {
      int intensity = (int)(x * 10.0); // This is needed
      data[y][x] = (intensity >= 0) ? 0 : 1;
    }
  }
}

// vim: ts=2 sw=2 et



More information about the Gcc-bugs mailing list