This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6438: gcc gets an ICE in extract_insn, at recog.c:2132



>Number:         6438
>Category:       c++
>Synopsis:       gcc gets an ICE in extract_insn, at recog.c:2132
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 24 09:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Philipp Thomas, SuSE Linux Ag
>Release:        3.1 20020415
>Organization:
>Environment:
i486-suse-linux-gnu
>Description:
gcc gets an ICE when compiling the attached code:

Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.1/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --libdir=/usr/lib --enable-checking i486-suse-linux
Thread model: posix
gcc version 3.1 20020415 (prerelease)
 /usr/lib/gcc-lib/i486-suse-linux/3.1/cc1plus -fpreprocessed bug.ii -quiet -dumpbase bug.ii -version -o /tmp/ccKX2iHz.s
GNU CPP version 3.1 20020415 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.1 20020415 (prerelease) (i486-suse-linux)
        compiled by GNU C version 3.1 20020415 (prerelease).
bug.ii: In function `void __miFillSppPoly(miPaintedSet*, miPixel, int, const
   SppPoint*, int, int, double, double)':
bug.ii:201: unrecognizable insn:
(insn 536 532 537 (set (reg:DF 178)
        (const_int 0 [0x0])) -1 (nil)
    (nil))
bug.ii:201: Internal compiler error in extract_insn, at recog.c:2132
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug.cc"
Content-Disposition: inline; filename="bug.cc"

typedef unsigned int size_t;
extern void free (void *__ptr) throw ();

typedef struct
{
  int x, y;
} miPoint;


typedef struct { unsigned char type; union { unsigned char index; unsigned char rgb[3]; } u; } miPixel;

typedef struct
{
  int count;
  miPoint *points;
  unsigned int *widths;
} Spans;

typedef struct
{
    miPixel pixel;
    Spans *group;
    int size;
    int count;
    int ymin, ymax;
} SpanGroup;

typedef struct lib_miPaintedSet
{
  SpanGroup **groups;
  int size;
  int ngroups;
} _miPaintedSet;

typedef struct lib_miPaintedSet miPaintedSet;

extern void * __mi_xmalloc (size_t size);


typedef struct
{
  double x, y;
} SppPoint;


static int GetFPolyYBounds (const SppPoint *pts, int n, double yFtrans, int *by, int *ty);

void
__miFillSppPoly (miPaintedSet *paintedSet, miPixel pixel, int count,
		 const SppPoint *ptsIn, int xTrans, int yTrans, double xFtrans, double yFtrans)
{
  double xl = 0.0,
                xr = 0.0,
                ml = 0.0,
                mr = 0.0,
                dy,
                i;
  int y,
                j,
                imin,
                ymin,
                ymax;
  int left, right,
                nextleft,
                nextright;
  int *Marked;
  unsigned int *width,
                *FirstWidth;
  miPoint *ptsOut,
                *FirstPoint;

  imin = GetFPolyYBounds (ptsIn, count, yFtrans, &ymin, &ymax);

  y = ymax - ymin + 1;
  if ((count < 3) || (y <= 0))
    return;
  ptsOut = FirstPoint = (miPoint *)__mi_xmalloc(sizeof(miPoint) * y);
  width = FirstWidth = (unsigned int *)__mi_xmalloc(sizeof(unsigned int) * y);
  Marked = (int *) __mi_xmalloc(sizeof(int) * count);

  for (j = 0; j < count; j++)
    Marked[j] = 0;
  nextleft = nextright = imin;
  Marked[imin] = -1;

  y = ({double _x = (ptsIn[nextleft].y + yFtrans); int _i = (int)_x; ((_x == _i) || (_x < 0.0)) ? _i : _i + 1;});

  do
    {

      if ((y > (ptsIn[nextleft].y + yFtrans) ||
           ((((y) - (ptsIn[nextleft].y + yFtrans)) >= 0.0 ? ((y) - (ptsIn[nextleft].y + yFtrans)) : -((y) - (ptsIn[nextleft].y + yFtrans))) <= 0.000001))
          && Marked[nextleft] != 1)
        {
          Marked[nextleft]++;
          left = nextleft++;


          if (nextleft >= count)
            nextleft = 0;


          dy = ptsIn[nextleft].y - ptsIn[left].y;
          if (dy != 0.0)
            {
              ml = (ptsIn[nextleft].x - ptsIn[left].x) / dy;
              dy = y - (ptsIn[left].y + yFtrans);
              xl = (ptsIn[left].x + xFtrans) + ml * ({double _a = (dy), _b = (0); _a > _b ? _a : _b; });
            }
        }


      if ((y > ptsIn[nextright].y + yFtrans)
          ||
          (((((y) - (ptsIn[nextright].y + yFtrans)) >= 0.0 ? ((y) - (ptsIn[nextright].y + yFtrans)) : -((y) - (ptsIn[nextright].y + yFtrans))) <= 0.000001)
           && Marked[nextright] != 1))
        {
          Marked[nextright]++;
          right = nextright--;


          if (nextright < 0)
            nextright = count - 1;


          dy = ptsIn[nextright].y - ptsIn[right].y;
          if (dy != 0.0)
            {
              mr = (ptsIn[nextright].x - ptsIn[right].x) / dy;
              dy = y - (ptsIn[right].y + yFtrans);
              xr = (ptsIn[right].x + xFtrans) + mr * ({double _a = (dy), _b = (0); _a > _b ? _a : _b; });
            }
        }





      i = (({double _a = (ptsIn[nextleft].y), _b = (ptsIn[nextright].y); _a < _b ? _a : _b; }) + yFtrans) - y;

      if (i < 0.000001)
        {
          if(Marked[nextleft] && Marked[nextright])
            {
              break;
            }
          continue;
        }
      else
        {
          j = (int) i;
          if (!j)
            j++;
        }
      while (j > 0)
        {
          int cxl, cxr;

          ptsOut->y = (y) + yTrans;

          cxl = ({double _x = (xl); int _i = (int)_x; ((_x == _i) || (_x < 0.0)) ? _i : _i + 1;});
          cxr = ({double _x = (xr); int _i = (int)_x; ((_x == _i) || (_x < 0.0)) ? _i : _i + 1;});

          if (xl < xr)
            {
              *(width++) = (unsigned int)(cxr - cxl);
              (ptsOut++)->x = cxl + xTrans;
            }
          else
            {
              *(width++) = (unsigned int)(cxl - cxr);
              (ptsOut++)->x = cxr + xTrans;
            }
          y++;


          xl += ml;
          xr += mr;
          j--;
        }
    } while (y <= ymax);

  free (Marked);


  {
    Spans spanRec;
		
		if (ptsOut - FirstPoint > 0)
		{
			spanRec.points = (FirstPoint);
			spanRec.widths = (FirstWidth);
			spanRec.count = (ptsOut - FirstPoint);
		}
		else
		{
			free (FirstPoint);
			free (FirstWidth);
		}
	}
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]