toge's diary

コンピュータ関連の趣味をつらつらと。

Graphiteが使えないなんてっ

gcc 4.4では最適化オプションが少し追加されています。
中でも大きいのがGraphiteの追加・・・のはずなのですが、gcc -fgraphiteとかすると

sorry, unimplemented: Graphite loop optimizations cannot be used

と出てしまう。うーん・・・とソース(gcc/graphite.c)を見てみるとcloogというライブラリが必要らしい。

#ifdef HAVE_cloog
#include "cloog/cloog.h"
#include "graphite.h"

static VEC (scop_p, heap) *current_scops;
...中略...
}

#else /* If Cloog is not available: #ifndef HAVE_cloog.  */

void
graphite_transform_loops (void)
{
  sorry ("Graphite loop optimizations cannot be used");
}

#endif

エラーメッセージ不親切だよなぁ。「cloogライブラリが必要だよ!」ぐらい書いてくれても良いのに。なんか未実装の機能に見えちゃうじゃん。

で、問題のcloogですがUbuntu的にはlibcloog-ppl-devらしいのでapt-get installしました。
それでは早速configure...

checking for version 0.10 of PPL... yes   
checking for correct version of CLooG... yes

問題なさげですね。次はコンパイル・・・一度configure.cacheとか消すの忘れずに・・・で1時間強待ってコンパイルも無事終了。
いざ使ってみると・・・

/usr/local/gcc/4.4.0/include/g++-v3/bits/stl_uninitialized.h:321: internal compiler error: in build_graphite_scops, at graphite.c:1852
完全なバグ報告を送って下さい。
適切ならばプリプロセス後のソースをつけてください。
<http://gcc.gnu.org/bugs.html> を見れば方法が書いてあります。

(T_T) 途中まではうまく行ってんだけどな。gcc 4.3のマイナー最適化オプション同様、まだまだ不安定そうです。