public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/22415] New: ICE in coalesce_abnormal_edges
@ 2005-07-11 19:51 jakub at redhat dot com
  2005-07-11 20:02 ` [Bug tree-optimization/22415] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jakub at redhat dot com @ 2005-07-11 19:51 UTC (permalink / raw)
  To: gcc-bugs

struct C
{
  int a;
  int *b;
  int *c1 (int x) { return new int[sizeof (int) * x]; }
  void c2 (int *x, int *y, int z)
  {
    for (int i = 0; i < z; i++)
      y[i] = x[i];
  }
  C (int x = 0) : a (x)
  {
    if (a)
      {
        b = c1 (a);
        for (int i = 0; i < a; i++)
          b[i] = 0;
      }
  }
  C (const C & x) : a (x.a)
  {
    if (a)
      {
        b = c1 (a);
        c2 (x.b, b, a);
      }
  }
  ~C (void) { if (a) delete b; }
  int &operator [] (int x)
  {
    if (a == 0 && x == 0)
      {
        a = 1;
        b = c1 (1);
        b[0] = 0;
      }
    else
      {
        C e (*this);
        a = x + 1;
        b = c1 (a);
        c2 (e.b, b, e.a);
        for (int i = e.a; i < a; i++)
          b[i] = 0;
      }
    return b[x];
  }
  C & operator << (int x) { (*this)[a] = x; return *this; }
};

int
bar (void)
{
  C a;
  int f = 1;
  while (f != -1)
    {
      f = 0;
      a << 1;
    }
  return 0;
}

ICEs at -O2 in coalesce_abnormal_edges.  The bug is not present on HEAD
and 3.4.x compiles it just fine as well.

-- 
           Summary: ICE in coalesce_abnormal_edges
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-09-27 16:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-11 19:51 [Bug tree-optimization/22415] New: ICE in coalesce_abnormal_edges jakub at redhat dot com
2005-07-11 20:02 ` [Bug tree-optimization/22415] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-07-11 20:16 ` pinskia at gcc dot gnu dot org
2005-07-11 20:50 ` pinskia at gcc dot gnu dot org
2005-07-13 12:56 ` pinskia at gcc dot gnu dot org
2005-07-13 13:12 ` dberlin at gcc dot gnu dot org
2005-09-27 16:25 ` mmitchel 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).