Re: [PPL-devel] [Bug middle-end/40981] aermod.f90 ICEs on -O2 -fgraphite-identity -floop-strip-mine

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) + { + ppl_Coefficient_to_mpz_t (num, nv); + ppl_Coefficient_to_mpz_t (denom, dv); + gcc_assert (value_notzero_p (dv)); + value_division (res, nv, dv); + } + + value_clear (nv); + value_clear (dv); + ppl_delete_Coefficient (num); + ppl_delete_Coefficient (denom); +}
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
Program exited with code 04. (gdb) bt No stack.
so I am no longer able to get a back trace.
That's because you do not load the gdbinit.in from the gcc dir, where you have the following breakpoints:
# Put breakpoints at exit and fancy_abort in case abort is mapped # to either fprintf/exit or fancy_abort. b fancy_abort
# Put a breakpoint on internal_error to help with debugging ICEs. b internal_error

Sebastian Pop wrote:
Roberto, could you please look at the bug http://gcc.gnu.org/PR40981 ?
Done. I have posted my suggestions there. Cheers,
Roberto

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-ht...
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.
participants (3)
-
Enea Zaffanella
-
Roberto Bagnara
-
Sebastian Pop