https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so I think this is an overflow somewhere in data dependence compute ...

Creating dr for MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c][_2]
analyze_innermost: success.
        base_address: &c
        offset from base address: (ssizetype) ((sizetype) h_10 * 2)
        constant offset from base address: 0
        step: -3762939935406616984(OVF)
        base alignment: 2
        base misalignment: 0
        offset alignment: 2
        step alignment: 8
        base_object: MEM <short unsigned int[<unknown>]> [(const short unsigned
int &)&c]
        Access function 0: {{0, +, 3}_1, +, 7341902069151467316}_2
...
(Data Dep: 
#(Data Ref: 
#  bb: 4 
#  stmt: _25 = MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c][_2];
#  ref: MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c][_2];
#  base_object: MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c];
#  Access function 0: {{0, +, 3}_1, +, 7341902069151467316}_2
#)
#(Data Ref: 
#  bb: 5 
#  stmt: pretmp_28 = MEM[(const short unsigned int &)_3];
#  ref: MEM[(const short unsigned int &)_3];
#  base_object: MEM[(const short unsigned int &)&c];
#  Access function 0: {{0B, +, 6}_1, +, 14683804138302934632}_2
#)
  access_fn_A: {{0B, +, 6}_1, +, 14683804138302934632}_2
  access_fn_B: {{0B, +, 6}_1, +, 14683804138302934632}_2

 (subscript 
  iterations_that_access_an_element_twice_in_A: [0]
  last_conflict: scev_not_known
  iterations_that_access_an_element_twice_in_B: [0]
  last_conflict: scev_not_known
  (Subscript distance: 0 ))
  loop nest: (1 2 )
  distance_vector:   0   0 
  distance_vector: -1736083252   3 
  direction_vector:     =    =
  direction_vector:     -    +
)

the accesses are equal so the distance vector should be 0 0 which it is
for the inner loop but not for the outer it seems(!?).  We run into

  if (same_access_functions (ddr))
    {
      /* Save the 0 vector.  */
      dist_v = lambda_vector_new (DDR_NB_LOOPS (ddr));
      save_dist_v (ddr, dist_v);

      if (invariant_access_functions (ddr, loop_nest->num))
        add_distance_for_zero_overlaps (ddr);

      if (DDR_NB_LOOPS (ddr) > 1)
        add_other_self_distances (ddr);

      return true;

where invariant_access_functions is false and we eventually run into
add_multivariate_self_dist.

Ah, so the issue is lambda vector dumping is broken (truncates to int) and
unroll-and-jam also fails to use lambda_int ...

Reply via email to