This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/17552] [4.0 Regression] Infinite recursion in analyze_scalar_evolution


------- Additional Comments From jgrimm2 at us dot ibm dot com  2004-10-07 19:15 -------
FWIW, I've reproduced this on linux ppc64 (both -m32 & -m64) too. Besides seeing
with the testcase, I believe I"m seeing in the wild when building busybox
(1.00rc3).  

Looking at the sc-ev code (woefully ignorant of scalar evolution & details of
its implementation): 

Is there a need for some check over in analyze_scalar_1()? I see the same cycle
of vars getting looked at again and again. 

---------- test.c.t26.tailr---------------
;; Function foo (foo)

foo ()
{
  int k;
  int j;
  int i;

<bb 0>:
  if (k_3 > i_4) goto <L0>; else goto <L8>;

<L0>:;
  if (i_4 != 0) goto <L1>; else goto <L3>;

<L1>:;
  j_9 = i_4 + 1;
  goto <bb 4> (<L4>);

  # j_12 = PHI <i_4(1), j_11(4)>;
<L3>:;
  j_8 = j_12 + 1;

  # j_11 = PHI <j_9(2), j_8(3)>;
<L4>:;
  if (k_3 >= j_11) goto <L3>; else goto <L7>;

<L6>:;
  k_7 = k_1 + 1;

  # k_1 = PHI <i_4(4), k_7(5)>;
<L7>:;

<L8>:;
  return;

}
--------- end test.c.t26.tailr --------------



--------- excerpt from dump --------------
....
....
(instantiate_parameters
  (loop_nb = 1)
  (chrec = j_11 == -2147483648)
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_11)
(get_scalar_evolution
  (scalar = j_11)
  (scalar_evolution = ))
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_9)
(get_scalar_evolution
  (scalar = j_9)
  (scalar_evolution = ))
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = i_4)
(get_scalar_evolution
  (scalar = i_4)
  (scalar_evolution = ))
)
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = 1)
(get_scalar_evolution
  (scalar = 1)
  (scalar_evolution = 1))
)
(set_scalar_evolution
  (scalar = j_9)
  (scalar_evolution = i_4 + 1))
)
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_8)
 (get_scalar_evolution
  (scalar = j_8)
  (scalar_evolution = ))
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_12)
(get_scalar_evolution
  (scalar = j_12)
  (scalar_evolution = ))
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = i_4)
(get_scalar_evolution
  (scalar = i_4)
  (scalar_evolution = ))
)
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_11)
(get_scalar_evolution
  (scalar = j_11)
  (scalar_evolution = ))
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_9)
(get_scalar_evolution
  (scalar = j_9)
  (scalar_evolution = i_4 + 1))
(set_scalar_evolution
  (scalar = j_9)
  (scalar_evolution = i_4 + 1))
)
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_8)
(get_scalar_evolution
  (scalar = j_8)
  (scalar_evolution = ))
(analyze_scalar_evolution
  (loop_nb = 0)
  (scalar = j_12)

..... and keeps cycling through the same vars ..........


Posting in case this triggers an A-HA in folks that understand this code and
theories that back it.  Please ignore if the above is worthless detail/comments. 

Either way, I'm willing to test any patches to see if affects the busybox compile.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jgrimm2 at us dot ibm dot
                   |                            |com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]