With the following code gcc-4.1 and 4.2 ICE when using "-O3 -ftree-vectorize". 
The latest checkout I have of 4.0 worked just fine.

struct re_pattern_buffer
{
  char *buffer;
  char *fastmap;
  long options;
};
void
ruby_re_compile_fastmap (struct re_pattern_buffer *bufp)
{
  unsigned char *pattern = (unsigned char *) bufp->buffer;
  register char *fastmap = bufp->fastmap;
  register unsigned char *p = pattern;
  register int j;
  int options = bufp->options;
  while (p)
    {
      switch (*p++)
    {
    case 0:
      for (j = 0; j < (1 << 8); j++)
        {
          if (j != '\n' || (options & (((1L) << 1) << 1)))
        fastmap[j] = 1;
        }
    }
    }
}

gcc version 4.2.0 20060331 (experimental)

gcc -O3 -ftree-vectorize ruby.c -c

ruby.x.i: In function ‘ruby_re_compile_fastmap’:
ruby.x.i:9: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions


-- 
           Summary: ICE with -O3 -ftree-vectorize
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: halcy0n at gentoo dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to