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 middle-end/40981] aermod.f90 ICEs on -O2 -fgraphite-identity -floop-strip-mine



------- Comment #25 from zaffanella at cs dot unipr dot it  2009-08-15 05:48 -------
Subject: Re: [PPL-devel]  aermod.f90 ICEs on -O2        -fgraphite-identity
 -floop-strip-mine

Sebastian Pop wrote:
>> Actually the error in gdb has changed with 1677_max.diff...
>>
> 
> As expected: see the gcc_assert in the patch
> 
> +/* Return in RES the maximum of the linear expression LE on polyhedron PS.  */
> +
> +void
> +ppl_max_for_le (ppl_Pointset_Powerset_C_Polyhedron_t ps,
> +		ppl_Linear_Expression_t le, Value res)
> +{
> +  ppl_Coefficient_t num, denom;
> +  Value dv, nv;
> +  int maximum;
> +
> +  value_init (nv);
> +  value_init (dv);
> +  ppl_new_Coefficient (&num);
> +  ppl_new_Coefficient (&denom);
> +  ppl_Pointset_Powerset_C_Polyhedron_maximize (ps, le, num, denom, &maximum);
> +
> +  if (maximum)

[...]

> What worries me is that PPL finds a maximum, but that is not a valid
> max, as the denominator is zero.  Roberto, could you please look at
> the bug http://gcc.gnu.org/PR40981 ?
> 
> Thanks,
> Sebastian

Hello, Sebastian.

It seems you have misunderstood the behavior of this function, which is 
meant to be similar to the corresponding function defined on simple 
(i.e., not powerset) polyhedra, whose documentation can be found here:

http://www.cs.unipr.it/ppl/Documentation/user/ppl-user-c-interface-0.10.2-html/interfaceppl__Polyhedron__tag.html#93cee014592562084126f06fe47efbba


int ppl_Polyhedron_maximize_with_point
(ppl_const_Polyhedron_t ph, ppl_const_Linear_Expression_t le,
  ppl_Coefficient_t sup_n, ppl_Coefficient_t sup_d, int *pmaximum,
  ppl_Generator_t point)
Returns a positive integer if ph is not empty and le is bounded from 
above in ph, in which case the supremum value and a point where le 
reaches it are computed.


So, in order to see if there is maximization succeeded, you should check 
the return value of the function call, not the value of variable 
`maximum' (the latter is meant to distinguish between supremum/maximum 
in NNC computations).

Now, in the dump of the example provided by Howarth, it can be seen that 
we are trying to maximize the first dimension (let us call it A) of a 
11-dimensions polyhedron defined by constraints:

   A >= 0, A <= B - 1

Since the polyhedron is unbounded from above in dimension A, the 
function should return 0 and leave num, den, maximum untouched (this is 
why the denominator is zero).


Anyway, I think that your problem has pointed our attention to what 
seems to be a (unrelated) bug in the current implementation, whereby in 
powerset computations only we are wrongly returning a positive integer 
even when the powerset happens to be empty.

Cheers,
Enea Zaffanella.


-- 


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


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