public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13835] New: [tree-ssa] Several loops detected instead of a single one
@ 2004-01-23 18:18 spop at gcc dot gnu dot org
  2004-01-23 23:16 ` [Bug optimization/13835] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: spop at gcc dot gnu dot org @ 2004-01-23 18:18 UTC (permalink / raw)
  To: gcc-bugs

Hi, 

That's another bug I'm seeing after the merge of the tree-ssa to lno from 
2004-01-20.  I cannot fix the following testcast from the scalar evolution
analysis testsuite:

-----------------------------------------------
bool foo (int);

int main (void)
{
  int a = -100;
  int b = 2;
  int c = 3;
  
  while (a)
    {
      /* Exercises if-phi-nodes.  */
      if (foo (a))
	a += b;
      else
	a += c;
      
      b++;
      c++;
    }
}
-----------------------------------------------

because instead of having a single loop as everybody would have expected, 
for the above snipet, I get two nested loops.  I suspect the dom-pass, 
for having unsafely transformed the program, but that's just a guess.
I haven't investigated the real causes of this bug yet.  

The following representation has been dumped using the usual debug_loop_ir ()

loop_0
{
  bb_0 (preds = {bb_-1}, succs = {bb_2})
  {
  <bb 0>:
    goto <bb 2> (<L1>);

  }
  bb_5 (preds = {bb_4}, succs = {bb_-2})
  {
  <L5>:;
    return;

  }
  loop_1
  {
    bb_6 (preds = {bb_1}, succs = {bb_2})
    {
    <L6>:;

    }
    bb_2 (preds = {bb_6, bb_0}, succs = {bb_4})
    {
      # c_22 = PHI <3(0), c_35(6)>;
      # b_4 = PHI <2(0), b_34(6)>;
      # a_3 = PHI <-100(0), a_2(6)>;
    <L1>:;
      a_33 = a_3 + b_4;
      goto <bb 4> (<L3>);

    }
    loop_2
    {
      bb_1 (preds = {bb_4}, succs = {bb_3, bb_6})
      {
      <L0>:;
        if (a_2 <= 29) goto <L6>; else goto <L2>;

      }
      bb_3 (preds = {bb_1}, succs = {bb_4})
      {
      <L2>:;
        a_36 = a_2 + c_35;

      }
      bb_4 (preds = {bb_3, bb_2}, succs = {bb_5, bb_1})
      {
        # c_23 = PHI <c_22(2), c_35(3)>;
        # b_1 = PHI <b_4(2), b_34(3)>;
        # a_2 = PHI <a_33(2), a_36(3)>;
      <L3>:;
        b_34 = b_1 + 1;
        c_35 = c_23 + 1;
        if (a_2 != 0) goto <L0>; else goto <L5>;

      }
    }
  }
}

-- 
           Summary: [tree-ssa] Several loops detected instead of a single
                    one
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: spop at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2004-08-12  6:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-23 18:18 [Bug optimization/13835] New: [tree-ssa] Several loops detected instead of a single one spop at gcc dot gnu dot org
2004-01-23 23:16 ` [Bug optimization/13835] " pinskia at gcc dot gnu dot org
2004-01-24  3:37 ` pinskia at gcc dot gnu dot org
2004-03-07  9:28 ` pinskia at gcc dot gnu dot org
2004-03-16  0:21 ` pinskia at gcc dot gnu dot org
2004-08-12  6:43 ` [Bug tree-optimization/13835] " pinskia 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).