Thank you for your advice! I've started working on a fix.
--
Roman Gareev
I've found out that this bug appeared in revision 189156 (svn://gcc.gnu.org/svn/gcc/trunk) and similar error message appeared in revision 191757 (svn://gcc.gnu.org/svn/gcc/trunk) (maybe it's because of changes in diagnostic.c). If subtract_commutative_associative_deps, a function located in gcc/graphite-dependences.c, is commented out, the error will disappear . I am trying to find a bug in this function now. Could you please answer a few questions about it?
1) Where can I find the algorithm for finding associative commutative reduction, which was used in subtract_commutative_associative_deps?
2) What is the number returned by isl_union_map_compute_flow? (I haven't found its description in “Integer Set Library: Manual”)
3) I've found the following terms in subtract_commutative_associative_deps: “may accesses”, “must access”. “Integer Set Library: Manual” gives the following definition: «If any of the source accesses are marked as being may accesses, then there will be a dependence to the last must access and to any may access that follows this last must access». Could you please describe their meaning? Are they related to transitively-covered dependences?
--
Roman Gareev
Hi Tobias,
thanks for the answer!
I think that the segfault is being caused by NULL arguments being passed to compute_deps by loop_level_carries_dependences. This is causing an assignment of NULL values to the following parameters of compute_deps: must_raw_no_source, may_raw_no_source, must_war_no_source, may_war_no_source, must_waw_no_source, may_waw_no_source. They are being passed to subtract_commutative_associative_deps and dereferenced in the following statements:
*must_raw_no_source = isl_union_map_subtract (*must_raw_no_source, x_must_raw_no_source);
*may_raw_no_source = isl_union_map_subtract (*may_raw_no_source, x_may_raw_no_source);
*must_war_no_source = isl_union_map_subtract (*must_war_no_source, x_must_war_no_source);
*may_war_no_source = isl_union_map_subtract (*may_war_no_source, x_may_war_no_source);
*must_waw_no_source = isl_union_map_subtract (*must_waw_no_source, x_must_waw_no_source);
*may_waw_no_source = isl_union_map_subtract (*may_waw_no_source, x_may_waw_no_source);
This is the reason of segfault. (All functions mentioned above are located in gcc/graphite-dependences.c)
I think that this can be solved by the addition to subtract_commutative_associative_deps of NULL checking of the following variables: must_raw_no_source, may_raw_no_source, must_war_no_source, may_war_no_source, must_waw_no_source, may_waw_no_source. I've implemented this in the patch, which can be found below.
Tested x86_64-unknown-linux-gnu, applying to revisions 189156, 207802 (svn://gcc.gnu.org/svn/gcc/trunk) and 207802 (svn://gcc.gnu.org/svn/gcc/branches/ibm/gcc-4_8-branch)
Thanks for your answers and advice, Sven!
--
Roman Gareev
Yes, this would be a 'solution'. However, I am in fact surprised that
those variables are NULL at all. Do you have an idea why this is the
case? Understanding this would help to understand if the patch you
propose is actually the right solution or if it is just hiding a
previous bug.
In my understanding, it is sufficient to guard the no_source statements, no?