This page has been incorporated into another. If you are not redirected automatically, click here. For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help. Comments on these web pages and the development of GCC are welcome on our developer list at gcc@gcc.gnu.org. All of our lists have public archi
How does the gcc compiler get written? Who works on it and why? It seems to puzzle some people. There are vast numbers of free software projects these days, far more than I try to keep track of. Among these, gcc is unusual in several respects. gcc is more than 20 years old as an active free software project. gcc has a large number of active contributors. gcc is not associated with any single compa
GCC やっぱすごいなぁという話 まぁコード生成する類のものは全部メタプログラミングだと考えるとします。当時のkinaba先生世界観。例としては C のコードを cpp で C にするとか、 C のコードを gcc で asm にするとか autotools でほげほげとか。 それはともかく最近思いついた(全然コードを読まない)コードリーディング技法として make してみてその標準出力をゆっくり眺めるというものがあります。ファイルの依存関係がわかれば割と内容は予測がついたりします。あと GCC のコード眺める技法として gdb で適当に break しかけてバックトレースを見ると普通に追うよりラクというのがあるのですがそれは別の話。 でまぁ make の出力とか見てると GCC ってすごいメタプログラミングの宝庫だなぁと思ったのでした。特にフロントエンド側よりバックエンド側がにんともかん
_ switchの展開 http://alohakun.blog7.fc2.com/blog-entry-878.html を見てたしかにどういう感じなのかなーと。 たぶん stmt.c の expand_case @gcc-4.2.2 。 最初に unique ならラベルの数とか適当に調べて、 default 以外ターゲットなかったらそこに jump とか。 んで bit なんちゃらがどうこうってのが入ってんだけど、 よくわからんかったからぐぐったら これ面白いな。 http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01733.html int main(int i) { switch (i) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '
Demystifying GCC Under the Hood of the GNU Compiler Collection (An OOPSLA 2006 Tutorial) Resources for tutorial participants: Main handout for the tutorial Extra slides on RTL/machine descriptions that didn't make it into the handouts Code used in the exercises GNU FTP Mirror List for downloading GCC sources (external link) Useful links: GCC home page Wikipedia entry for GCC, containing histor
上のエントリで、 私は、結構、確認のためだけのコードを書くことが多いので、Makefile など用意せずに compile することが多いです。そのため、make コマンドだけでは物足りません。 などと書いていますが、実は、確認のためだけのコードの場合は、 #ifdef COMPILES_AND_PERFORMS_THIS_FILE ### Type "sh FILENAME" out=`echo $0|sed 's/.[^.]*$//g'` CC="gcc -g -Wall" ${CC:-cc} $0 -o $out && ./$out && rm -f $out exit #endif #include <stdio.h> #include <stdlib.h> int main (int argc, char * argv[]) { printf ("%s executed.\n",
今回は最適化オプションのまとめとLINK関連のオプションの補足,および出力の種類の制御オプションの補足,またIntel386とAMD x86-64オプションについて説明する. (筆者) 本来は最適化オプションを付けなくとも理想的なコードを生成することがコンパイラの役目です.しかしそのようなレベルに達していない以上,使う側が理解して最適化オプションを付加してやらなければなりません. 特にこだわらないのであれば,普遍的な最適化をコマンド・オプション一つで行うことが可能です. ● -O この最適化オプションを付けることで,無理のない最適化を行うことができます.あまりコンパイル時間をかけず,メモリも消費しない程度に,コード・サイズと実行時間を減らす最適化を行います.なお,フレーム・ポインタなしでもデバッグをサポートできる機種では,-fomit-frame-pointerをオンにします. -O1オプ
GCC の最適化で printf が puts になる場合 GCC の最適化により printf の呼び出しが puts に置き換わることがある、と 先日、教えてもらったので試してみました。 次のような hello.c をまず最適化なしでコンパイルします。 #include <stdio.h> int main () { printf("hello, world\n"); return 0; } % gcc -o hello hello.c そして、実行可能ファイル hello を readelf コマンドで覗いてみると、 printf という文字列が見つかります。 puts は見あたりません。 % readelf -a hello | egrep 'printf|puts' 080495d0 00000207 R_386_JUMP_SLOT 00000000 printf 2: 0000
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く