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; 14+ 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] 14+ messages in thread

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
  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 ` pinskia at gcc dot gnu dot org
  2005-07-11 20:16 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-11 20:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-11 19:56 -------
Confirmed, this might be a latent bug on the mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.0.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-11 19:56:04
               date|                            |
            Summary|ICE in                      |[4.0 Regression] ICE in
                   |coalesce_abnormal_edges     |coalesce_abnormal_edges
   Target Milestone|---                         |4.0.2


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-11 20:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-11 20:12 -------
Hmm, the reason why we cannot reproduce it on the mainline is because SRA thinks the variable a 
cannot be SRA'd because we still take the address of the variable even though that statement is dead.

-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-11 20:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-11 20:15 -------
I think adding another DCE pass right before SRA and we will be able to reproduce this on the mainline 
also.

Also note turning off PRE "fixes" the ICE.  It might be PRE moving a statement causing the conflict.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
  2005-07-11 19:51 [Bug tree-optimization/22415] New: ICE in coalesce_abnormal_edges jakub at redhat dot com
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-13 12:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-13 12:54 -------
(In reply to comment #3)
> I think adding another DCE pass right before SRA and we will be able to reproduce this on the 
mainline 
> also.

Nope, adding both DCE and MAY_ALIAS right before SRA does not cause this to happen on the 
mainline.

-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
  2005-07-11 19:51 [Bug tree-optimization/22415] New: ICE in coalesce_abnormal_edges jakub at redhat dot com
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 14+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-07-13 13:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-13 13:08 -------
PRE checks the SSA_NAME_OCCURS_IN_ABNORMAL_PHI flag everywhere, and we shouldn't
really be doing anything over abnormal edges.
(see compute_avail and compute_antic).



-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
  2005-07-11 19:51 [Bug tree-optimization/22415] New: ICE in coalesce_abnormal_edges jakub at redhat dot com
                   ` (4 preceding siblings ...)
  2005-07-13 13:12 ` dberlin at gcc dot gnu dot org
@ 2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:25 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-11-19 21:09 ` tbm at cyrius dot com
@ 2007-01-18 11:45 ` gdr at gcc dot gnu dot org
  6 siblings, 0 replies; 14+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-01-18 11:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from gdr at gcc dot gnu dot org  2007-01-18 11:45 -------
fixed in GCC-4.1.0
not release critical for GCC-4.0.x


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.0


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
@ 2006-11-19 21:09 ` tbm at cyrius dot com
  2007-01-18 11:45 ` gdr at gcc dot gnu dot org
  6 siblings, 0 replies; 14+ messages in thread
From: tbm at cyrius dot com @ 2006-11-19 21:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from tbm at cyrius dot com  2006-11-19 21:09 -------
(In reply to comment #9)
> That would fix it perfectly fine, i'll bootstrap and test it.

ping


-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-01-12 23:13 ` dberlin at gcc dot gnu dot org
@ 2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
  2006-11-19 21:09 ` tbm at cyrius dot com
  2007-01-18 11:45 ` gdr at gcc dot gnu dot org
  6 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.0.4


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-01-12 20:41 ` law at redhat dot com
@ 2006-01-12 23:13 ` dberlin at gcc dot gnu dot org
  2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2006-01-12 23:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dberlin at gcc dot gnu dot org  2006-01-12 23:13 -------
That would fix it perfectly fine, i'll bootstrap and test it.


-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
  2005-10-13 23:53 ` pinskia at gcc dot gnu dot org
  2006-01-12 20:30 ` law at redhat dot com
@ 2006-01-12 20:41 ` law at redhat dot com
  2006-01-12 23:13 ` dberlin at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: law at redhat dot com @ 2006-01-12 20:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from law at redhat dot com  2006-01-12 20:41 -------
Subject: Re:  [4.0 Regression] ICE in
        coalesce_abnormal_edges

On Thu, 2006-01-12 at 20:30 +0000, law at redhat dot com wrote:

> You should assign this bug to Daniel since he's the PRE expert.
I'll note that something like this seems to avoid the problem, but I
have no idea if it's correct.  It may (or may not) help Daniel in
tracking this down.

At this point I'm leaving this for Daniel to resolve since he's 
way more familiar with this code than I will ever be.



Index: tree-ssa-pre.c
===================================================================
*** tree-ssa-pre.c      (revision 109644)
--- tree-ssa-pre.c      (working copy)
*************** compute_avail (void)
*** 1903,1909 ****
        for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
        /* We have no need for virtual phis, as they don't represent
           actual computations.  */
!       if (is_gimple_reg (PHI_RESULT (phi)))
          add_to_sets (PHI_RESULT (phi), PHI_RESULT (phi), NULL,
                       PHI_GEN (block), AVAIL_OUT (block));

--- 1903,1910 ----
        for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
        /* We have no need for virtual phis, as they don't represent
           actual computations.  */
!       if (is_gimple_reg (PHI_RESULT (phi))
!           && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)))
          add_to_sets (PHI_RESULT (phi), PHI_RESULT (phi), NULL,
                       PHI_GEN (block), AVAIL_OUT (block));


-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
  2005-10-13 23:53 ` pinskia at gcc dot gnu dot org
@ 2006-01-12 20:30 ` law at redhat dot com
  2006-01-12 20:41 ` law at redhat dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: law at redhat dot com @ 2006-01-12 20:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from law at redhat dot com  2006-01-12 20:30 -------
Subject: Re:  [4.0 Regression] ICE in
        coalesce_abnormal_edges

On Thu, 2006-01-12 at 16:30 +0000, pinskia at gcc dot gnu dot org wrote:


Before PRE a$a_1 is live from the beginning of BB6 through the outgoing
edge into BB3, through BB3, including the outgoing edge from BB3 to BB7
where it dies in the PHI node at the start of BB7.

PRE inserts of use of a$a_1 in BB2, which extends the lifetime of a$a_1
to include BB1 and BB2.  Note that a$a_1 is used in an abnormal PHI
and is marked with SSA_NAME_OCCURS_IN_ABNORMAL_PHI, so PRE shouldn't be
messing with it in any way shape or form.

Anyway, a$a_1 now conflicts with a$a_52 which is live in BB1 and BB2
as well.  a$a_52 gets coalesced with a$a_5, but we're unable to then
coalesce a$a_1 into that set because of the conflict.

You should assign this bug to Daniel since he's the PRE expert.


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

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


-- 


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


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

* [Bug tree-optimization/22415] [4.0 Regression] ICE in coalesce_abnormal_edges
       [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
@ 2005-10-13 23:53 ` pinskia at gcc dot gnu dot org
  2006-01-12 20:30 ` law at redhat dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-13 23:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2005-10-13 23:53 -------
Actually I am wrong when saying this was caused by PRE, it is caused by DOM as
what PRE inserts is okay.  It is what DOM creates where we go wrong.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-01-18 11:45 UTC | newest]

Thread overview: 14+ 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
     [not found] <bug-22415-138@http.gcc.gnu.org/bugzilla/>
2005-10-13 23:53 ` pinskia at gcc dot gnu dot org
2006-01-12 20:30 ` law at redhat dot com
2006-01-12 20:41 ` law at redhat dot com
2006-01-12 23:13 ` dberlin at gcc dot gnu dot org
2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
2006-11-19 21:09 ` tbm at cyrius dot com
2007-01-18 11:45 ` gdr 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).