Mercurial > hg > CbC > CbC_gcc
annotate CbC-memo.ja @ 42:9e4f9e20b8f1
add some examples.
author | kent@teto.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Mon, 25 Jan 2010 17:13:59 +0900 |
parents | cc07adb17855 |
children | ab0bcb71f44d |
rev | line source |
---|---|
29
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 [[configureオプションの追加]] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 $ cd gcc |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 $ vi configure.ac |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 ... |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 $ autoheader-2.59 # versionはconfigure.acの中に書いてある奴に合わせる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 $ autoconf-2.59 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 $ vi Makefile.in |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 これでconfigureスクリプトが完成するが、このautoconfはtarボールでは成功しない |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 svnリポジトリからチェックアウトしないと必要な関数が定義されてないのでエラーになる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 なのでチェックアウトしたものでconfigureを生成したあと、それだけコピーしてこればOK |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 TOPディレクトリでは |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 $ autogen Makefile.def |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 $ autoconf-2.59 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 ただしこれを使うことはないと思われる? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 [[fastcall i386]] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 1: %ecx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 2: %edx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 3: (%esp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 4: 4(%esp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 5: 8(%esp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 __attribute__((noreturn)): 今のところこれでは問題が出ない |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 __attribute__((fastcall)): こっちはいろいろ問題あり |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 fastcallで起こる問題: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 せっかく計算したebpが上書きされてしまっている |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 ecxに退避してそこにjmpすれば動く (これを直にかける?) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 expand_cbc_gotoを直す必要がある |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 08048714 <returner>: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 8048714: 53 push %ebx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 8048715: 83 ec 28 sub $0x28,%esp |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 8048718: 89 4c 24 0c mov %ecx,0xc(%esp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 804871c: 8b 44 24 0c mov 0xc(%esp),%eax |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 8048720: 89 44 24 1c mov %eax,0x1c(%esp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 8048724: 8b 44 24 1c mov 0x1c(%esp),%eax |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 8048728: 8b 00 mov (%eax),%eax |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 804872a: 01 44 24 0c add %eax,0xc(%esp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 804872e: 8b 44 24 1c mov 0x1c(%esp),%eax |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 8048732: 8b 58 08 mov 0x8(%eax),%ebx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 8048735: 8b 44 24 1c mov 0x1c(%esp),%eax |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 8048739: 8b 40 04 mov 0x4(%eax),%eax |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 804873c: 8b 54 24 0c mov 0xc(%esp),%edx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 8048740: 89 c1 mov %eax,%ecx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 8048742: 83 c4 28 add $0x28,%esp |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 8048745: 5b pop %ebx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 8048746: ff e3 jmp *%ebx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 これを手動で直すと-O0でも-O2でも動くことが確認できた |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 **PROJECT CVS** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 firefly.cr:~one/CVS_DB/CbC_Project/GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 -checkout |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 cvs co CbC_project/GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 -commit |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 cvs commit |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 -import from 3rdparty source |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 tar xzvf gcc-xxx.tgz |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 cd gcc-xxx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 cvs import -ko -m ".." CbC/project/GCC FSF_GCC REL_4_x_y |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 -merge |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 cd /temp |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 cvs checkout -jREL_4_2_1 -jREL_xxx CbC_project/GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 もしくはすでに本流をcheckoutしているディレクトリで |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 cvs update -jREL_4_2_1 -jREL_4_2_2 でもできる? (4_2_2に移行時はこれをしたけど...まだ分かんない ) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 cvs update -jREL_4_2_2 -jREL_4_2_3 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 コンパイル時に実行されるプログラムは主に3つ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 省略すると |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 cc1, as, collect2 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 /usr/libexec/gcc/i386/redhat-linux/4.1.1/cc1 test.c -o test.s |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 as -o test.o test.s |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 /usr/libexec/gcc/i386/redhat/linux/4.1.1/collect2 ..... test.o |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 cc1とcollect2は |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 gcc-core-4.2.0/gcc/内でコンパイルされるもの。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 必要なのはcc1だ。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 CbCの実装 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 tail callを使う。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 tail call |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 関数の末尾呼び出しを最適化して、callでなくjmpで関数に飛ぶようになる。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 gcc -O1 -foptimize-sibling-calls か |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 gcc -O2 でコンパイルすればこの最適化が行われる。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 最適化条件? (構造体未確認) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 (推測!!) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 返り値が同じ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 呼ばれる関数の引数サイズが呼び出し側関数の引数サイズより小さい |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 expand_gimple_basic_blockでstatement毎にRTLに変換されているが、 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 ほとんどのstmtはexpand_expr_stmtに送られるけど、 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 tail call の場合は expand_gimple_tailcallに直接送られる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 **TEST BUILD** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 mkdir build-test |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 cd build-test |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 ../GCC/configure --disable-nls --disable-bootstrap --enable-languages=c --prefix=$PWD/installed --enable-checking=tree,rtl,assert |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 デバグのため、下の(a)を実行 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 make |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 make install # これまでしないと処理系によってはerrorがいくつか... |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 (a). 全てのMakefileの-O2 を -O0 に変更 viで :%s/-O2/-O0/gってとこか? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 どうやら --prefix=...って、ちゃんとしないといけない? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 stdio.hをインクルードしてるとエラーが出る。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 これはオレが失敗したのか?それともconfigureが悪いのか? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 $ CFLAGS="-O0 -gdwarf-2 -g3" ../GCC/configure ... |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 stdio.hをインクルードしたらerrorが出る問題 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 firefly: --prefix=$PWD/USR-LOCALあり、別ディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 preinstall: NG postinstall: OK installed: OK |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 firefly: --prefixなし、別ディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 preinstall: NG postinstall: ?? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 firefly: --prefixあり、同ディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 preinstall: NG postinstall: OK installed: OK |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 firefly(nativePkg): --prefixなし、別ディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 preinstall: NG |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 chani: --prefix=$PWD/installedあり、同ディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 preinstall: OK |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 chani(nativePkg): --prefixなし、別ディレクトリ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 preinstall: OK |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 $PWD/installed/bin/gcc -O2 .... |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 $PWD/installed/libexec/gcc/i686-pc-linux-gnu/4.2.1/cc1 -O2 test01.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 browse_tree (tree) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 debug_rtx(rtl) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 **GCC DEBUG** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 gdb $BUILD-TEST/installed/libexec/gcc/i686-pc-linux-gnu/4.2.1/cc1 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 プログラム内で |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 p browse_tree (current_function_decl) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 cc1 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 main.c, toplev.c, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 main() in main.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 toplev_main() in toplev.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 general_init(argv[0]) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 signal設定 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 init_gcc() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 decode_options(argc, argv) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 randomize() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 do_compile() in toplev.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 timevar_start(TV_TOTAL) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 process_options() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 compile_file() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 struct lang_hooks lang_hooks |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 この構造体にパーサ等の関数ポインタが含まれている。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 これはlanghooks-def.hでLANG_HOOKS_INITIALIZERが定義されているが、 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 言語ごとの定義はcならc-objc-common.hで、各メンバの定義が入れ替えられる。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 options |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 decode_options -O?などのオプションを処理 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 handle_options その他のオプションを順番に走査 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 コンパイル対象のファイル名を main_input_filenameに入れる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 -で始まる引数があればhandle_optionを呼ぶ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 handle_option オプションを処理する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 compile_file() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 lang_hooks.parse_file() == c_common_parse_file |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 c_parse_file() in c-parser.c Parse a single source file. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 c_parser_translation_unit() in c-parser.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 c_parser_external_declaration() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 c_parser_external_declaration() in c-parser.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 CPPのtokenはここで処理して通常のはc_parser_declaration_or_fndefに渡す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 全体を通して、c_parser *parserという変数が関数の第一引数に渡される。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 これがファイルをparseする際の状態を保持しているっぽい |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 c_parser_declaration_or_fndef() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 こいつがglobalな関数、変数の宣言を処理する。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 c_parser_declspecs() 基本type (int, char, strcut...) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 declspecs_add_scspec(specs, tree) extern,inline,staticなどのstorageをspecsにおさめる(specsのフラグをたてる) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 declspecs_add_type(specs, c_typespec t) int, char, longなど第2引数が型名、第1引数にそれを格納 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 finish_declspecs() Complexやunsignedなどの後に来る型名の処理? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 shadow_tag(specs) 名前無しのstructやunionを処理。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 c_parser_declarator() 名前の前の*の処理 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 c_parser_direct_declarator() idを取得 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 c_parser_direct_declarator_inner() idの後の[]や()をパース |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 c_parser_parms_declarator() 引数リストもしくはidリスト(これはoldSTYLEのため) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 c_parser_parms_list_declarator() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 c_parser_parameter_declaration() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 通常の変数なら |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 start_decl() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 start_init() c_parser_initializer() finish_init() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 finish_decl() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 関数パラメータ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 start_function() 関数のdeclaration treeを作成する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 treeはcurrent_function_declに保存 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223 old-styleパラメータ(while c_parser_declaration_or_fndef(parser, f, f, t, f) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 fnbody = c_parser_compound_statement(parser) 関数本体の定義 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 add_stmt(fnbody) fnbodyを専用のstatement listに追加する gimplifyに使われる? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 finish_function() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 current_function_declからfndeclを取得 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 ...(fndecl) = pop_stmt_list(....(fndecl)) statement listからbodyを取得しfndeclにつなげる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 c_genericize(fndecl) convert LD-tree to LI-tree |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 c_gimple_diagnostics_recursively(fndecl) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 cgraph_finalize_function(fndecl,false) ファイルにアセンブラを出力? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 cgraph_assemble_pending_functions() in cgraphunit.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 関数とcode segment |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 code segmentはパース中の型はcts_CbC_codeとしてdeclspecsに保持している |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 finish_declspecsにおいて、treeを構成する際に型をvoid_type_nodeで格納 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 このvoid_typeになんらかのフラグをつける?それともfunction_typeにつける? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
240 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 IDの取得 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 c_parser_declarator() 名前の前の*の処理 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 c_parser_direct_declarator() id or (.id)をパース |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
244 c_parser_direct_declarator_inner() idの後の[]や()をパース fnTreeを生成 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
245 c_parser_parms_declarator() 型なしidリスト(これはoldSTYLEのため) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
246 c_parser_parms_list_declarator() 型付き引数リストのパース 可変長かもみる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
247 c_parser_parameter_declaration() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 build_function_declarator() パースした引数とdelcで関数の宣言をつくる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 c_declarator->u.arg_infoに引数を保持 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
250 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
251 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
252 **expand_* treeをパースしてRTLを出力する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 tree_expand_cfg() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 expand_used_vars() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
255 expand_function_start(current_function_decl) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
256 cfunの値を設定して行く |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 assign_parms() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
258 ここでcfun->args_sizeが設定されている |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
259 expand_gimple_basic_block() in for-loop |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 expand_expr_stmt() in stmt.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
261 expand_expr() in expr.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
262 expand_expr_real() expr.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
263 expand_expr_real_1() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
264 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
265 expand_expr_real_1() expr.c:8210 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
266 expand_mult() expmed.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
267 expand_binop() optabs.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
268 GEN_FCN (icode) (temp, xop0, xop1); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
269 下の感じのRTLが返される |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
270 (set (reg:DF 67) (mult:DF (reg:DF 66) (reg/v:DF 64 [ d ]))) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
271 が、この関数が返すのは (reg:DF 67)だけ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 emit_insn(rtx) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 RTLをDL-listに追加する. rtxはinsnでなければinsnでラッピングされる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
274 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
275 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
276 **PASS LIST** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
277 関数ごとに出力する場合、 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
278 cgraph_assemble_pending_functions() flag_unit_at_a_timeが真なら実行 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
279 cgraph_expand_function() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
280 tree_rest_of_compilation |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
281 execute_pass_list |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
282 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
283 まとめて出力する場合 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
284 compile_file |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
285 lang_hooks.decls.final_write_globals = c_write_global_declarations flag_unit_at_a_timeが偽なら実行 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
286 cgraph_optimize |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
287 cgraph_expand_all_functions |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
288 cgraph_expand_function |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
289 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
290 GIMPLE treeから RTL への変換 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
291 pass.execute = tree_expand_cfg() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 RTLからアセンブラへの変換pass final.cで定義 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294 pass_final.execute == rest_of_handle_final in final.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 最終的な RTL=>"文字列" 変換する pass |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 execute_one_pass() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299 rest_of_handle_final() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
300 assemble_start_function() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
301 final_start_function() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
302 final() # insnリストを出力 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
303 final_scan_insn() # 与えられたinsnのアセンブラを出力 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
304 recog_memoized() # insn_data[code]のcode 決定 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
305 get_insn_template() # 出力するアセンブラのchar*文字列を返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
306 output_asm_insn() # 文字列の%..を修正してファイルに出力 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 final_end_function() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 assemble_end_function() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 RTLの仮想レジスタを物理レジスタに置き換える pass |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 execute_one_pass() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 instantiate_virtual_regs() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 instantiate_virtual_regs_in_insn() for each instruction |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 extract_insn() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
315 recog_memoized() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
316 insn_extract() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
317 ppcではこのrecog_memoizedで-1しか返ってこないことで落ちる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
318 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 下のmdのmatch_operand 0がaddressにしか対応してないのが問題だと思う |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
320 ;; sibling call patterns |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
321 (define_expand "sibcall" |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
322 [(parallel [(call (mem:SI (match_operand 0 "address_operand" "")) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
323 (match_operand 1 "" "")) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
324 (use (match_operand 2 "" "")) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
325 (use (reg:SI LR_REGNO)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 (return)])] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
327 "" |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
328 " |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
329 { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 #if TARGET_MACHO |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 if (MACHOPIC_INDIRECT) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
332 operands[0] = machopic_indirect_call_target (operands[0]); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
333 #endif |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
334 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
335 gcc_assert (GET_CODE (operands[0]) == MEM); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
336 gcc_assert (GET_CODE (operands[1]) == CONST_INT); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
337 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
338 operands[0] = XEXP (operands[0], 0); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
339 }") |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
340 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
341 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
342 targetm.asm_outから出力 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 ターゲットマシンによってtargetm構造体の内容が変わる。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
347 /* In all nodes that are expressions, this is the data type of the expression. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 In POINTER_TYPE nodes, this is the type that the pointer points to. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 In ARRAY_TYPE nodes, this is the type of the elements. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 In VECTOR_TYPE nodes, this is the type of the elements. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 #define TREE_TYPE(NODE) ((NODE)->common.type) // in tree.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
352 このnodeの型を表す(functionなら関数の型、pointerならそいつのさしている型.. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 /* The tree-code says what kind of node it is. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 Codes are defined in tree.def. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 #define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code) // in tree.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 このnodeがどんなtreeなのかを表す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
358 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
359 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
360 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
361 c_parser_compound_statement() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
362 c_begin_compound_stmt() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
363 c_parser_compund_statement_nostart() __label__, lvarの処理 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
364 c_parser_statement_after_labels() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
365 c_end_compound_stmt() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
366 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
367 c_parser_if_statement() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
368 c_parser_do_statement() |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
369 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
370 c_parser_paren_condition() ifやwhileの'()'の中をparseする |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
371 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
372 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
373 parse expressions |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
374 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
375 c_parser_unary_expression() increment,decrement, &, *ポインタ、アドレスの処理 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
376 c_parser_postfix_expression() 数字や変数、文字列などの処理(TCCのunary()か) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
377 c_parser_postfix_expression_after_primary() 変数とかの後ろの'[]'や'()'の処理(関数や配列の添字) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
378 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
379 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
380 c_parser_* Cのパーサ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
381 build_* treeの生成 (Cパーサから呼ばれる) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
382 expand_* tree(gimple)のパーサ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
383 emit_* rtlの生成 (treeパーサから呼ばれる) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
384 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
385 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
386 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
387 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
388 宣言時の新しい識別子 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
389 token->type==CPP_NAME |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
390 build_id_declarator |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
391 XOBNEWを使って parser_obstackに作られる => gcc_obstack_init in default.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
392 変数名等を格納するc_declaratorはparser_obstack上に作られ、 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
393 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
394 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
395 tree.def |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
396 tree.[ch] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
397 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
398 union tree_node GTY((ptr_alias (union lang_tree_node), |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
399 desc ("tree_node_structure (&%h)"))) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
400 { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
401 struct tree_common GTY ((tag ("IS_COMMON"))) common; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
402 struct tree_int_cst GTY ((tag ("IS_INT_CST"))) common; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
403 struct tree_real_cst GTY ((tag ("IS_REAL_CST"))) common; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
404 .. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
405 .. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
406 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
407 c-tree.h: |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
408 struct c_expr{ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
409 tree value; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
410 enum tree_code original_code; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
411 } |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
412 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
413 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
414 tokenizer |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
415 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
416 c_parser_peek_token() int c-parser.c 現在参照すべきtoken を返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
417 c_lex_one_token() in c-parser.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
418 c_lex_with_flags() in c-lex.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
419 cpp_get_token() in libcpp(macro.c) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
420 c_parser_next_token_is( parser, token0) tokenを取得し、それがtoken0ならtrue |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
421 c_parser_consume_token( parser) 次のtokenを取ってくる |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
422 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
423 parser->tokens[0,1] (c_token) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
424 この[0]に現在のtokenの情報がある。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
425 [1]はnext? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
426 新たなtokenはlibcppのcpp_get_tokenによって取得する。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
427 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
428 cppでは'!'や'*'などの一つ一つのtokenとなんらかの文字列を返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
429 予約語等の処理はgccがやる. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
430 token |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
431 struct c_token{ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
432 enum cpp_ttype type: 8; /* libcppで得られるtokenのtype, '<','==', name, '['などなど */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
433 enum c_id_kind id_kind: 8; /* type==CPP=NAMEの時のみ */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
434 enum rid keyword: 8; /* Cの予約語(int, if, typedef, gotoなど) */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
435 pragma_kind: 7; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
436 in_systemheader: 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
437 tree value; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
438 location_t location; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
439 } |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
440 enum cpp_ttype in libcpp/include/cpplib.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
441 { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
442 TTYPE_TABLE ==>> CPP_EQ, CPP_NOT, ... , CPP_NAME, ..., CPP_PADDING, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
443 N_TTYPES, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
444 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
445 /* Positions in the table. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
446 CPP_LAST_EQ = CPP_LSHIFT, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
447 CPP_FIRST_DIGRAPH = CPP_HASH, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
448 CPP_LAST_PUNCTUATOR= CPP_ATSIGN, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
449 CPP_LAST_CPP_OP = CPP_LESS_EQ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
450 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
451 本来予約語もCPP_NAMEに含まれるが、無理矢理CPP_KEYWORDを作っている |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
452 CPP_KEYWORDはc-parser.cで独自に定義、N_TTYPES+1 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
453 typedef enum c_id_kind { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
454 C_ID_ID, /* An ordinary identifier. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
455 C_ID_TYPENAME, /* An identifier declared as a typedef name. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
456 C_ID_CLASSNAME, /* An identifier declared as an Objective-C class name. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
457 C_ID_NONE /* Not an identifier. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
458 } c_id_kind; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
459 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
460 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
461 enum c_declarator_kind { /* in c-tree.h */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
462 cdk_id, /* An identifier. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
463 cdk_function, /* A function. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
464 cdk_array, /* An array. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
465 cdk_pointer, /* A pointer. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
466 cdk_attrs /* Parenthesized declarator with nested attributes. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
467 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
468 struct c_declarator { /* in c-tree.h */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
469 enum c_declarator_kind kind; /* The kind of declarator. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
470 struct c_declarator *declarator; /* Except for cdk_id, the contained declarator. For cdk_id, NULL. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
471 location_t id_loc; /* Currently only set for cdk_id. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
472 union { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
473 tree id; /* For identifiers, an IDENTIFIER_NODE or NULL_TREE if an abstract declarator. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
474 struct c_arg_info *arg_info; /* For functions. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
475 struct { /* For arrays. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
476 tree dimen; /* The array dimension, or NULL for [] and [*]. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
477 int quals; /* The qualifiers inside []. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
478 tree attrs; /* The attributes (currently ignored) inside []. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
479 BOOL_BITFIELD static_p : 1; /* Whether [static] was used. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
480 BOOL_BITFIELD vla_unspec_p : 1; /* Whether [*] was used. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
481 } array; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
482 int pointer_quals; /* For pointers, the qualifiers on the pointer type. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
483 tree attrs; /* For attributes. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
484 } u; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
485 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
486 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
487 /* A type specifier keyword "void", "_Bool", "char", "int", "float", |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
488 "double", or none of these. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
489 enum c_typespec_keyword { //でも使われてるのはdeclspec |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
490 cts_none, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
491 cts_void, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
492 cts_CbC_code, いる? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
493 cts_bool, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
494 cts_char, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
495 cts_int, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
496 cts_float, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
497 cts_double, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
498 cts_dfloat32, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
499 cts_dfloat64, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
500 cts_dfloat128 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
501 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
502 enum c_typespec_kind { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
503 ctsk_resword, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
504 ctsk_tagref, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
505 ctsk_tagfirstref, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
506 /* A definition of a tag such as "struct foo { int a; }". */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
507 ctsk_tagdef, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
508 ctsk_typedef, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
509 ctsk_objc, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
510 ctsk_typeof |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
511 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
512 struct c_typespec { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
513 enum c_typespec_kind kind; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
514 tree spec; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
515 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
516 struct c_declspecs { /* c-tree.c */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
517 /* The type specified, if a single type specifier such as a struct, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
518 union or enum specifier, typedef name or typeof specifies the |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
519 whole type, or NULL_TREE if none or a keyword such as "void" or |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
520 "char" is used. Does not include qualifiers. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
521 tree type; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
522 /* The attributes from a typedef decl. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
523 tree decl_attr; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
524 /* When parsing, the attributes. Outside the parser, this will be |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
525 NULL; attributes (possibly from multiple lists) will be passed |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
526 separately. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
527 tree attrs; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
528 /* Any type specifier keyword used such as "int", not reflecting |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
529 modifiers such as "short", or cts_none if none. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
530 enum c_typespec_keyword typespec_word; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
531 /* The storage class specifier, or csc_none if none. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
532 enum c_storage_class storage_class; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
533 BOOL_BITFIELD declspecs_seen_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
534 BOOL_BITFIELD type_seen_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
535 BOOL_BITFIELD typedef_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
536 BOOL_BITFIELD default_int_p; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
537 BOOL_BITFIELD long_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
538 BOOL_BITFIELD long_long_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
539 BOOL_BITFIELD short_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
540 BOOL_BITFIELD signed_p : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
541 : |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
542 } |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
543 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
544 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
545 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
546 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
547 **TAIL CALL OPTIMIZATION** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
548 execute_tail_calls in tree-tailcall.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
549 tree_optimize_tail_calls_1(true) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
550 たいした調査もせず、簡単にフラグCALL_EXPR_TAILCALLをたててるだけ。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
551 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
552 expand_call 1834-3115 in calls.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
553 initialize_argument_information(); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
554 引数処理 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
555 引数をレジスタやスタックのどこに保存するかを決める |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
556 tree actparmsで示された引数をargs, args_sizeに格納する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
557 1011行目 We can't use sibcalls if a callee-copied argument is stored in the current function's frame. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
558 if statement 2200行目: try_tail_call=0 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
559 targetm.function_ok?for?sibcall(fndecl, exp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
560 args_size.constant > (current_function_args_size - current_function_pretend_args_size) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
561 emit_call_1(); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
562 SIBLING_CALL_P(..) = ( (ecf_flag & ECF_SIBLING) != 0); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
563 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
564 expand_callでtailcall可能かどうかの判定を詳しく行っているようだ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
565 bool try_tail_call = CALL_EXPR_TAILCALL(exp); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
566 2252あたりのfor文が怪しいが、900行ある。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
567 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
568 2252 in calls.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
569 for(pass = try_tail_call ? 0:1; pass<2; pass++) 2253-3087 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
570 2回ループ。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
571 1回目はtailcall用。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
572 2回目は普通のcalling |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
573 生成後にどちらかを選ぶ? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
574 2227 args_size.constant > (current_function_args_size - current_function_pretend_args_size) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
575 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
576 hard_function_value |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
577 check_sibcall_argument_overlap |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
578 prepare_call_address |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
579 load_register_parameters |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
580 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
581 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
582 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
583 Language Dependent Tree |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
584 v |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
585 GENERIC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
586 v |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
587 GIMPLE |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
588 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
589 GENERIC trees + LD trees |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
590 v |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
591 GIMPLE |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
592 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
593 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
594 **RTL** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
595 RTL expression |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
596 クラス: RTX_OBJ, RTX_CONST_OBJ, _COMPARE _COMM_COMPARE _UNARY ... in rtx.def |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
597 オペランド: e(expression), i(integer), w, s, E, ... |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
598 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
599 RTLへのアクセス |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
600 GET_CODE (RTX) (enum rtx_code) (RTX)->code |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
601 RTXのコード(種類)を返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
602 GET_RTX_CLASS (code) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
603 このrtxコードのクラスを返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
604 GET_RTX_LENGTH (code) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
605 このrtxコードのオペランドの数を返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
606 GET_RTX_FORMAT (code) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
607 オペランドの種類を文字列で返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
608 i.e. "iuuBieieee" on CALL_INSN |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
609 XEXP(RTX, N) X->u.fld[N].rt_rtx |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
610 RTX のN番目のオペランドをexpressionとして取得する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
611 XINT(RTX, N) X->u.fld[N].rt_int |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
612 RTX のN番目のオペランドをintegerとして取得する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
613 XVEC(RTX, N) X->u.fld[N].rt_rtvec |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
614 RTX のN番目のオペランドをrtvectorとして取得する |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
615 XVECEXP(RTX, N, M) XVEC(RTX,N)->elem[M] |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
616 RTX のN番目のオペランドをrtvectorとし、その M番目の要素を返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
617 XVECLEN(RTX, N) XVEC(RTX,N)->num_elem |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
618 RTX のN番目のオペランドをrtvectorとし、そのサイズを返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
619 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
620 struct rtvec_def GTY(()) { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
621 int num_elem; /* number of elements */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
622 rtx GTY ((length ("%h.num_elem"))) elem[1]; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
623 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
624 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
625 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
626 typedef struct trx_def *rtx; //gcc/coretypes.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
627 struct rtx_def; //gcc/rtl.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
628 struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
629 chain_prev ("RTX_PREV (&%h)"))) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
630 { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
631 /* The kind of expression this is. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
632 ENUM_BITFIELD(rtx_code) code: 16; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
633 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
634 /* The kind of value the expression has. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
635 ENUM_BITFIELD(machine_mode) mode : 8; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
636 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
637 /* 1 in a MEM if we should keep the alias set for this mem unchanged |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
638 when we access a component. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
639 1 in a CALL_INSN if it is a sibling call. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
640 1 in a SET that is for a return. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
641 In a CODE_LABEL, part of the two-bit alternate entry field. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
642 unsigned int jump : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
643 /* In a CODE_LABEL, part of the two-bit alternate entry field. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
644 1 in a MEM if it cannot trap. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
645 unsigned int call : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
646 /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
647 1 in a SUBREG if it references an unsigned object whose mode has been |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
648 from a promoted to a wider mode. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
649 1 in a SYMBOL_REF if it addresses something in the per-function |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
650 constants pool. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
651 1 in a CALL_INSN, NOTE, or EXPR_LIST for a const or pure call. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
652 1 in a JUMP_INSN, CALL_INSN, or INSN of an annulling branch. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
653 unsigned int unchanging : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
654 /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
655 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
656 if it has been deleted. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
657 1 in a REG expression if corresponds to a variable declared by the user, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
658 0 for an internally generated temporary. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
659 1 in a SUBREG with a negative value. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
660 1 in a LABEL_REF or in a REG_LABEL note for a non-local label. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
661 In a SYMBOL_REF, this flag is used for machine-specific purposes. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
662 unsigned int volatil : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
663 /* 1 in a MEM referring to a field of an aggregate. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
664 0 if the MEM was a variable or the result of a * operator in C; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
665 1 if it was the result of a . or -> operator (on a struct) in C. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
666 1 in a REG if the register is used only in exit code a loop. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
667 1 in a SUBREG expression if was generated from a variable with a |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
668 promoted mode. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
669 1 in a CODE_LABEL if the label is used for nonlocal gotos |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
670 and must not be deleted even if its count is zero. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
671 1 in an INSN, JUMP_INSN or CALL_INSN if this insn must be scheduled |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
672 together with the preceding insn. Valid only within sched. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
673 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
674 from the target of a branch. Valid from reorg until end of compilation; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
675 cleared before used. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
676 unsigned int in_struct : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
677 /* At the end of RTL generation, 1 if this rtx is used. This is used for |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
678 copying shared structure. See `unshare_all_rtl'. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
679 In a REG, this is not needed for that purpose, and used instead |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
680 in `leaf_renumber_regs_insn'. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
681 1 in a SYMBOL_REF, means that emit_library_call |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
682 has used it as the function. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
683 unsigned int used : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
684 /* 1 in an INSN or a SET if this rtx is related to the call frame, |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
685 either changing how we compute the frame address or saving and |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
686 restoring registers in the prologue and epilogue. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
687 1 in a REG or MEM if it is a pointer. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
688 1 in a SYMBOL_REF if it addresses something in the per-function |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
689 constant string pool. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
690 unsigned frame_related : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
691 /* 1 in a REG or PARALLEL that is the current function's return value. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
692 1 in a MEM if it refers to a scalar. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
693 1 in a SYMBOL_REF for a weak symbol. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
694 unsigned return_val : 1; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
695 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
696 /* The first element of the operands of this rtx. |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
697 The number of operands and their types are controlled |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
698 by the `code' field, according to rtl.def. */ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
699 union u { |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
700 rtunion fld[1]; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
701 HOST_WIDE_INT hwint[1]; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
702 struct block_symbol block_sym; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
703 struct real_value rv; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
704 } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
705 }; |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
706 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
707 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
708 FUNCTION_TYPEの実態はtree_type |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
709 make_node_stat(FUNCTION_TYPE)で作成される |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
710 TREE_TYPE |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
711 TYPE_ARG_TYPES ->type.values |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
712 TYPE_UID ->type.uid |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
713 TYPE_ALIGN ->type.align |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
714 TYPE_USER_ALIGN ->type.user_align |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
715 TYPE_MAIN_VARIANT ->type.main_variant |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
716 TYPE_ATTRIBUTES ->type.attributes |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
717 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
718 こいつの lang_flag_6 ビットフィールドをcode segmentかどうかのフラグとする。 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
719 #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5) //tree.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
720 #define CbC_IS_CODE_SEGMENT(TYPE) TYPE_LANG_FLAG_5 (TYPE) //c-tree.h |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
721 code segmentを作ったらCbC_IS_CODE_SEGMENT(type) = 1 でセット できる? |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
722 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
723 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
724 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
725 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
726 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
727 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
728 **GENERIC TREE** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
729 関数の型 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
730 <function_type 0xb7b7d9b4 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
731 type <real_type 0xb7b72a6c double DF |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
732 size <integer_cst 0xb7b60528 constant invariant 64> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
733 unit size <integer_cst 0xb7b60540 constant invariant 8> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
734 align 64 symtab 0 alias set -1 precision 64 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
735 pointer_to_this <pointer_type 0xb7b72b80>> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
736 QI |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
737 size <integer_cst 0xb7b601f8 type <integer_type 0xb7b7205c bit_size_type> constant invariant 8> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
738 unit size <integer_cst 0xb7b60210 type <integer_type 0xb7b72000 unsigned int> constant invariant 1> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
739 align 8 symtab 0 alias set -1 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
740 arg-types <tree_list 0xb7b7c8a0 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
741 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
742 関数の宣言 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
743 <function_decl |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
744 type <function_type ... >> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
745 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
746 関数の引数 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
747 <tree_list |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
748 value <integer_type |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
749 size <integer_cst ...> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
750 unit size <integer_cst ...> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
751 align 32 .... <integer_cst ...> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
752 chain <tree_list ...>> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
753 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
754 配列 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
755 <array_type 0xb7f04170 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
756 type <integer_type 0xb7e7f284 int public SI ... > |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
757 BLK |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
758 size <integer_cst 0xb7f02f18 type <integer_type 0xb7e7f05c bit_size_type> constant invariant 320> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
759 unit size <integer_cst 0xb7f05030 type <integer_type 0xb7e7f000 unsigned int> constant invariant 40> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
760 align 32 symtab 0 alias set -1 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
761 domain <integer_type 0xb7f04114 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
762 type <integer_type 0xb7e7f000 unsigned int public unsigned sizetype SI size <integer_cst 0xb7e6d3f0 32> unit size <integer_cst 0xb7e6d180 4> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
763 align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0xb7e6d468 0> max <integer_cst 0xb7e6d9f0 -1>> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
764 SI size <integer_cst 0xb7e6d3f0 32> unit size <integer_cst 0xb7e6d180 4> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
765 align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0xb7e6d198 0> max <integer_cst 0xb7f02fc0 9>>> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
766 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
767 関数呼び出し |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
768 <call_expr 0xb7e52078 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
769 type <real_type 0xb7e55a6c double DF ...> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
770 side-effects arg 0 <addr_expr 0xb7ed2080 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
771 type <pointer_type 0xb7eda170 type <function_type 0xb7ecff18> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
772 unsigned SI |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
773 size <integer_cst 0xb7e433f0 constant invariant 32> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
774 unit size <integer_cst 0xb7e43180 constant invariant 4> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
775 align 32 symtab 0 alias set -1> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
776 constant invariant |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
777 arg 0 <function_decl 0xb7ed15b0 test type <function_type 0xb7ecff18> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
778 addressable used public external decl_5 QI defer-output file test_tree.c line 2>> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
779 arg 1 <tree_list 0xb7edb138 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
780 value <integer_cst 0xb7edb030 constant invariant 97> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
781 chain <tree_list 0xb7edb168 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
782 value <integer_cst 0xb7edb060 constant invariant 98> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
783 chain <tree_list 0xb7edb180 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
784 value <integer_cst 0xb7edb090 constant invariant 10> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
785 chain <tree_list 0xb7edb198 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
786 value <real_cst 0xb7edb0c0 type <real_type 0xb7e55a6c double> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
787 constant invariant 2.5e+0>>>>>> |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
788 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
789 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
790 build_function_call(tree fndecl, tree exprlist) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
791 FUNCTION_DECLとEXPRのリストからCALL_EXPRを作って返す |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
792 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
793 convert_arguments(arglist, params, function, fundecl); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
794 check_function_arguments(); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
795 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
796 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
797 配列の作り方 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
798 icst : INTEGER_CST |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
799 itype: INTEGER_TYPE |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
800 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
801 icst = build_int_cst (NULL_TREE, size-1); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
802 itype = build_index_type (icst); |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
803 array = build_array_type |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
804 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
805 //build_range_type(size_type, integer_zero_node, exp) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
806 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
807 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
808 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
809 **PPC** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
810 http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/ASMIntroduction/chapter_1_section_1.html |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
811 http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/Articles/32bitPowerPC.html#//apple_ref/doc/uid/TP40002438-SW17 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
812 http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
813 http://www.freescale.co.jp/pdf/MPCFPE32BJ_R1a.pdf |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
814 http://www.nk.rim.or.jp/~jun/ppcasm/ppcasm01.html |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
815 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
816 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
817 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
818 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
819 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
820 **ソースコード読み会 準備** |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
821 cd ~/public_html |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
822 mkdir gcc; cd gcc |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
823 checkout CbC_project/GCC; CbC_project/GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
824 ./configure --... |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
825 make |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
826 gtags |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
827 htags -Ffx -t 'GCC source tour' |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
828 cd ../../ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
829 tar -czv CbC_project --exclude **/CVS -f GCC-source-....tar.gz |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
830 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
831 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
832 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
833 normal tail call |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
834 (call_insn/j 24 23 0 (parallel [ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
835 (call (mem:SI (symbol_ref:SI ("cs0") [flags 0x403] <function_decl 0x42e03980 cs0>) [0 S4 A8]) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
836 (const_int 256 [0x100])) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
837 (use (const_int 0 [0x0])) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
838 (use (reg:SI 125)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
839 (return) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
840 ]) -1 (nil) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
841 (expr_list:REG_EH_REGION (const_int 0 [0x0]) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
842 (nil)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
843 (expr_list:REG_DEP_TRUE (use (reg:SI 6 r6)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
844 (expr_list:REG_DEP_TRUE (use (reg:SI 5 r5)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
845 (expr_list:REG_DEP_TRUE (use (reg:SI 4 r4)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
846 (expr_list:REG_DEP_TRUE (use (reg:SI 3 r3)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
847 (nil)))))) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
848 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
849 indirect tail call |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
850 (call_insn/j 25 24 0 (parallel [ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
851 (call (mem:SI (reg/f:SI 129) [0 S4 A8]) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
852 (const_int 256 [0x100])) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
853 (use (const_int 0 [0x0])) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
854 (use (reg:SI 130)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
855 (return) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
856 ]) -1 (nil) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
857 (nil) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
858 (expr_list:REG_DEP_TRUE (use (reg:SI 6 r6)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
859 (expr_list:REG_DEP_TRUE (use (reg:SI 5 r5)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
860 (expr_list:REG_DEP_TRUE (use (reg:SI 4 r4)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
861 (expr_list:REG_DEP_TRUE (use (reg:SI 3 r3)) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
862 (nil)))))) |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
863 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
864 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
865 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
866 CFLAGS='-O0 -gdwarf-2 -g3' ../GCC/configure --disable-nls --disable-bootstrap --enable-languages=c --prefix=$PWD/INSTALL-DIR --enable-checking=tree,rtl,assert --disable-shared --disable-threads --with-headers --with-system-zlib --with-newlib --enable-version-specific-runtime-libs --disable-libssp --target=spu |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
867 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
868 ../toolchain/gcc/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-shared --disable-threads --disable-checking --with-headers --with-system-zlib --with-newlib --enable-languages=c,c++,fortran --disable-nls --enable-version-specific-runtime-libs --disable-libssp --program-prefix=spu- --target=spu |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
869 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
870 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
871 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
872 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
873 $ cvs checkout CbC_project/GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
874 $ mkdir tmp; cd tmp |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
875 $ wget http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk3.0/SRPMS/spu-gcc-4.1.1-107.src.rpm |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
876 $ rpm2cpio spu-gcc--4.1.1-107.src.rpm | cpio -i -v |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
877 $ tar xjvf gcc-r886.tar.bz2 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
878 $ cat *.diff | patch -d ../CbC_project/GCC -p2 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
879 $ cp toolchain/gcc/config.sub ../CbC_project/GCC/ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
880 $ cp toolchain/gcc/gcc/config.gcc ../CbC_project/GCC/gcc/ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
881 $ cd ../CbC_project/GCC |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
882 $ |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
883 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
884 |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
885 change bit_merge to vec_merge in gcc/config/spu/spu.md |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
886 split0_completed; in recog.c, rtl.h, final.c |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
887 SPU_FLOAT_FORMAT |
cc07adb17855
deleting old commented out code.
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
888 : |