On Sat, Jan 9, 2016 at 7:26 AM, Gerald Pfeifer <ger...@pfeifer.com> wrote:
> Hi Sebastian,
>
> On Fri, 25 Dec 2015, Sebastian Pop wrote:
>>> on December 17th 2015, my nightly bootstrap (on i386-unknown-freebsd10.1,
>>> but I don't think this is material) started to fail as follows:
>>>
>>> /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-scop-detection.c:1892:17:
>>> note: in instantiation of member function 'vec<dr_info, va_heap,
>>> vl_ptr>::safe_push'
>>> requested here
>>> scop->drs.safe_push (dr_info (dr, pbb));
>> I do not see what the error is. Do you happen to have
>> the few lines with the error before this note?
>
> thanks for the quick response. My Internet (non-)connectivity the
> last two weeks did not allow me to debug this further. Now I'm back
> to normal, and here is what I found:
>
> When I remove the isl package, GCC bootstraps just fine. As soon as
> I add the package again, things fail again.
>
> From the configure log:
>
> checking for isl 0.15 (or deprecated 0.14)... yes
> checking Checking for isl_options_set_schedule_serialize_sccs... no
>
> And here is the actual failure, which is different from my original
> report (probably due to forcing serial building). Invocation:
>
> c++ -std=gnu++98 -fno-PIE -c -g -DIN_GCC -fno-strict-aliasing
> -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
> -Wno-narrowing -Wwrite-string s -Wcast-qual -Wno-format
> -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
> -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H
> :
> -o graphite-dependences.o -MT graphite-dependences.o -MMD -MP -MF
> ./.deps/graphite-dependences.TPo
> /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-dependences.c
>
> Error:
>
> /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-dependences.c:240:3: error: no
> matching function for call to 'isl_union_map_foreach_map'
> isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max);
> ^~~~~~~~~~~~~~~~~~~~~~~~~
> /home/gerald/10-i386/include/isl/union_map.h:204:10: note: candidate
> function not viable: no known conversion from 'int (isl_map *, void *)'
> to 'isl_stat (*)(isl_map *, void *)' for 2nd argument
> isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,
>
>
> At first I thought this is related to FreeBSD now using clang as the
> system compiler, but the same happens using a current GCC 6 build.
>
> Then I started digging into this, wondering why apparently it had
> as the return type for the second argument as opposed to "isl_stat".
>
> My .../include/isl/union_map.h has
>
> isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,
> isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user);
>
> whereas graphite_dependences.c has
>
> static isl_stat
> max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
>
> so everything should be fine, shouldn't it?
>
> Turns out gcc/graphite.h is causing all this:
>
> #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> /* isl 0.15 or later. */
> #include <isl/schedule_node.h>
>
> #else
> /* isl 0.14 or 0.13. */
> # define isl_stat int
> # define isl_stat_ok 0
> #endif
>
> So, despite actually _having_ type isl_stat we #define isl_stat to int
> and do so after having all the isl/ include files use the proper type.
>
> Digging deeper, there appear to be two issues:
>
> 1. Instead of a feature test (for isl_stat) we use a version check
> based on another feature test (isl_options_set_schedule_serialize_sccs).
>
> 2. That feature test for isl_options_set_schedule_serialize_sccs does
> not work properly.
>
> It would be great could you look into issue 1 in any case, but for the
I will have a look.
In general I do not like the current status of having that many
#ifdefs in graphite: it makes the code hard to read and to maintain.
> time being let's focus on issue 2. Here is what gcc/config.log shows:
>
> configure:28943: checking Checking for
> isl_options_set_schedule_serialize_sccs
> configure:28956: /home/gerald/gcc-ref10-i386/bin/g++ -std=gnu++98 -o
> conftest -g
> -static-libstdc++ -static-libgcc conftest.cpp -lisl
> -L/home/gerald/10-i386 /lib -lmpc -lmpfr -lgmp >&5
> conftest.cpp:258:26: fatal error: isl/schedule.h: No such file or directory
> #include <isl/schedule.h>
> compilation terminated.
> configure:28956: $? = 1
>
> Note the -L option pointing to /home/gerald/10-i386 (where I have my
> local packages for this kind of testing), whereas the associated -I
> option is missing. And indeed, that's it: We use GMPLIB in that
> configure test, but not GMPINC.
>
> (For MPFR and MPC, the include and library paths for GMP are always
> included as well, by the way. It is only necessary to use --with-gmp=
> if one has a non-standard tree structure.)
>
> With the patch allow, my bootstraps in that environment succeed again,
> so I went ahead and applied it.
>
> Gerald
>
>
> 2016-01-09 Gerald Pfeifer <ger...@pfeifer.com>
>
> * configure.ac (isl_options_set_schedule_serialize_sccs): Also
> use GMPINC.
> * configure: Regenerate.
>
> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac (revision 232188)
> +++ gcc/configure.ac (working copy)
> @@ -5918,7 +5918,7 @@
> # it's new in isl 0.15.
> if test "x${ISLLIBS}" != "x" ; then
> saved_CXXFLAGS="$CXXFLAGS"
> - CXXFLAGS="$CXXFLAGS $ISLINC"
> + CXXFLAGS="$CXXFLAGS $ISLINC $GMPINC"
The change looks good to me. Thanks for fixing this problem.
Sebastian