public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27549]  New: [4.1 Regression] ICE in coalesce_abnormal_edges
@ 2006-05-11  8:44 jakub at gcc dot gnu dot org
  2006-05-11  8:48 ` [Bug tree-optimization/27549] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-05-11  8:44 UTC (permalink / raw)
  To: gcc-bugs

typedef __SIZE_TYPE__ size_t;

struct E
{
  virtual ~E () {}
  virtual size_t e () const = 0;
  virtual void f (char *x) const = 0;
};

struct F : public E
{
  virtual ~F () {}
  virtual size_t e () const { return 0; }
  virtual void f (char *x) const { *x = '\0'; }
};

struct S
{
  S () { a = new char[32]; b = 32; c = 0; a[0] = 0; }
  void s (const char *x, size_t y) { v (c + y + 1); __builtin_memcpy(a + c, x,
y); c += y; a[c] = '\0'; }
  void s (const E *x) { size_t l = x->e(); v (c + l + 1); x->f (a + c); c += l;
}
  const char *t () { return a; }
  void v (size_t n)
    {
      if (b >= n) return;

      size_t b2 = b;
      char *a2 = a;

      for (;;)
        {
          b *= 2;
          if (b >= n)
            break;
        }

      a = new char[b];

      if (b2)
        {
          __builtin_memcpy(a, a2, c);
          a2[0] = 0;
          for (size_t i = 1; i < b2; i++)
            a2[i] = a2[i - 1];
          delete[] a2;
        }
    }

  ~S ()
    {
      if (b)
        {
          a[0] = 0;
          for (size_t i = 1; i < b; i++)
            a[i] = a[i - 1];
        }
      delete[] a;
    }
  char * a;
  size_t b, c;
};

const char *p;
size_t q;
const F u;

const char *
foo ()
{
  S s;
  s.s (p, q);
  s.s (&u);
  return s.t ();
}

ICEs at -O{1,2,3} in coalesce_abnormal_edges, at least on x86_64 and i386
linux.


-- 
           Summary: [4.1 Regression] ICE in coalesce_abnormal_edges
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-05-17  8:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11  8:44 [Bug tree-optimization/27549] New: [4.1 Regression] ICE in coalesce_abnormal_edges jakub at gcc dot gnu dot org
2006-05-11  8:48 ` [Bug tree-optimization/27549] " pinskia at gcc dot gnu dot org
2006-05-11  8:51 ` pinskia at gcc dot gnu dot org
2006-05-11  9:06 ` jakub at gcc dot gnu dot org
2006-05-11  9:07 ` jakub at gcc dot gnu dot org
2006-05-11  9:07 ` jakub at gcc dot gnu dot org
2006-05-12  4:48 ` pinskia at gcc dot gnu dot org
2006-05-14 22:37 ` mmitchel at gcc dot gnu dot org
2006-05-15 10:10 ` jakub at gcc dot gnu dot org
2006-05-15 10:11 ` jakub at gcc dot gnu dot org
2006-05-17  8:24 ` jakub at gcc dot gnu dot org
2006-05-17  8:32 ` jakub at gcc dot gnu dot org
2006-05-17  8:46 ` jakub at gcc dot gnu dot 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).