Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 885 lines (812 sloc) 41.187 kB
5fcf01c @hiyuh Update TODO.
authored
1 -----------------------------------
2 Port to clang/clang++ on cygwin
3 -----------------------------------
4 Bad news, clang/clang++ doesn't support -I-.
20cbd60 @hiyuh Update TODO.
authored
5 It's time to override by DEFAULT_INCLUDES.
6
c183dac @hiyuh Update TODO.
authored
7 After setting DEFAULT_INCLUDES by -iquote, "make -k" shows:
8
5fcf01c @hiyuh Update TODO.
authored
9 $ uname -a
10 CYGWIN_NT-5.1 lion 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin
11
12 $ clang --version
13 clang version 3.0 (tags/RELEASE_30/final)
14 Target: i386-pc-cygwin
15 Thread model: posix
16
17 $ clang++ --version
18 clang version 3.0 (tags/RELEASE_30/final)
19 Target: i386-pc-cygwin
20 Thread model: posix
21
22 $ CC=clang CXX=clang++ ./configure
23 [SNIP]
24
c183dac @hiyuh Update TODO.
authored
25 $ make -k
26 [SNIP]
27 make[4]: Entering directory `/home/hiyuh/git-repos/nvc/src/rt'
28 clang -DHAVE_CONFIG_H -iquote ../.. -iquote . -iquote . -iquote ../../src -iquote ../../src -Wall -Werror -g -O2 -MT shell.o -MD -MP -MF .deps/shell.Tpo -c -o shell.o shell.c
29 shell.c:226:10: error: implicit declaration of function 'add_history' is invalid in C99
30 [-Werror,-Wimplicit-function-declaration]
31 add_history(buf);
32 ^
33 1 error generated.
34 Makefile:256: recipe for target `shell.o' failed
35 make[4]: *** [shell.o] Error 1
36 clang -DHAVE_CONFIG_H -iquote ../.. -iquote . -iquote . -iquote ../../src -iquote ../../src -Wall -Werror -I/usr/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -g -O2 -MT libjit_a-jit.o -MD -MP -MF .deps/libjit_a-jit.Tpo -c -o libjit_a-jit.o `test -f 'jit.c' || echo './'`jit.c
37 jit.c:67:14: error: use of undeclared identifier 'PATH_MAX'
38 char path[PATH_MAX];
39 ^
40 1 error generated.
41 Makefile:270: recipe for target `libjit_a-jit.o' failed
42 make[4]: *** [libjit_a-jit.o] Error 1
43 make[4]: Target `all' not remade because of errors.
44 make[4]: Leaving directory `/home/hiyuh/git-repos/nvc/src/rt'
45 make[4]: Entering directory `/home/hiyuh/git-repos/nvc/src'
46 clang -DHAVE_CONFIG_H -iquote .. -iquote . -iquote . -iquote ../src -iquote ../src -Wall -Werror -g -O2 -MT lib.o -MD -MP -MF .deps/lib.Tpo -c -o lib.o lib.c
47 In file included from lib.c:28:
48 In file included from /usr/include/dirent.h:6:
49 /usr/include/sys/dirent.h:28:15: error: use of undeclared identifier 'NAME_MAX'
50 char d_name[NAME_MAX + 1];
51 ^
52 lib.c:41:25: error: use of undeclared identifier 'PATH_MAX'
53 char path[PATH_MAX];
54 ^
55 lib.c:107:13: error: use of undeclared identifier 'PATH_MAX'
56 char dir[PATH_MAX];
57 ^
58 lib.c:117:16: error: use of undeclared identifier 'PATH_MAX'
59 char marker[PATH_MAX];
60 ^
61 lib.c:127:20: error: use of undeclared identifier 'PATH_MAX'
62 static char buf[PATH_MAX];
63 ^
64 lib.c:256:13: error: use of undeclared identifier 'PATH_MAX'
65 char buf[PATH_MAX];
66 ^
67 lib.c:307:16: error: unused variable 'search' [-Werror,-Wunused-variable]
68 const char *search = istr(ident);
69 ^
70 7 errors generated.
71 Makefile:384: recipe for target `lib.o' failed
72 [SNIP]
20cbd60 @hiyuh Update TODO.
authored
73
5fcf01c @hiyuh Update TODO.
authored
74 These errors may be cygwin specific and are caused by clang/clang++'s bug, I think.
75
e54889b @hiyuh Update TODO.
authored
76 ------------------------------------------------------------------------------------------
77 Fix "*** glibc detected *** path/to/nvc : double free or corruption (out): 0xXXXXXXXX ***"
593c5ae @hiyuh Update TODO.
authored
78 ------------------------------------------------------------------------------------------
56c1c76 @hiyuh Update TODO.
authored
79 This "double free or corruption" occurs on Gentoo/PowerPC.
80
81 Investigating w/ LLVM-3.0 and svn trunk and great helping by NAKAMURA Takumi AKA chapuni,
82 I finally realized that this problem can be reproduced when using altivec on ppc32-linux.
8867831 @hiyuh Update TODO.
authored
83 The point is, LLVM has incomplete support for altivec on ppc32-linux, even w/ svn trunk.
56c1c76 @hiyuh Update TODO.
authored
84 And the workaround is, don't enable altivec when compiling LLVM.
85
86 So appending "-mno-altivec -mabi=no-altivec" to CFLAGS and CXXFLAGS can avoid this issue.
87 Note, -mcpu and -mtune does enable/disable altivec related flags too, so just replacing
8867831 @hiyuh Update TODO.
authored
88 only "-maltivec -mabi=altivec" to "-mno-altivec -mabi=no-altivec" may not work as expected
89 if you used -mcpu and -mtune.
56c1c76 @hiyuh Update TODO.
authored
90
64cb078 @hiyuh Update TODO.
authored
91 FYI, I filed a bug also for TEXTREL and Anton Korobeynikov AKA asl fixed in r15398:
56c1c76 @hiyuh Update TODO.
authored
92
93 https://bugs.gentoo.org/show_bug.cgi?id=403519
94
95 Anyway, for real fix, I should fix LLVM's lib/Target/PowerPC/PPCJITInfo.cpp or so...
96
e6e3daa @hiyuh Update TODO.
authored
97 See more detail:
98
99 $ uname -a
100 Linux wombat 3.2.5-gentoo #1 Thu Feb 9 14:47:53 JST 2012 ppc 7447A, altivec supported PowerMac10,2 GNU/Linux
101
102 $ eix -Ic sys-devel/llvm
103 [I] sys-devel/llvm (3.0-r1@02/17/12): Low Level Virtual Machine
56c1c76 @hiyuh Update TODO.
authored
104 [NOTE: This sys-devel/llvm-3.0-r1 is compiled w/;
931c873 @hiyuh Update TODO.
authored
105 CFLAGS="-O2 -mtune=G4 -mcpu=G4 -maltivec -mabi=altivec -Wall -ggdb"
106 CXXFLAGS="-O2 -mtune=G4 -mcpu=G4 -maltivec -mabi=altivec -Wall -ggdb"
107 LDFLAGS="-Wl,-O1 -Wl,--as-needed"]
e6e3daa @hiyuh Update TODO.
authored
108
109 $ llvm-config --version
110 3.0
111
112 $ git clone git://github.com/hiyuh/nvc.git
113 [SNIP]
8867831 @hiyuh Update TODO.
authored
114 $ cd nvc
e6e3daa @hiyuh Update TODO.
authored
115 $ ./autogen.sh
116 [SNIP]
117 $ ./configure
118 [SNIP]
56c1c76 @hiyuh Update TODO.
authored
119 [NOTE: Prepare lib/ieee before make. :P]
e6e3daa @hiyuh Update TODO.
authored
120 $ make
121 [SNIP]
122 $ make check
123 [SNIP]
124 make[2]: Entering directory `/home/hiyuh/git-repos/nvc/test'
125 Running suite(s): lib
126 [gc: freed 0 trees; 35 allocated]
127 100%: Checks: 3, Failures: 0, Errors: 0
128 PASS: test_lib
129 Running suite(s): ident
130 100%: Checks: 9, Failures: 0, Errors: 0
131 PASS: test_ident
132 Running suite(s): parse
133 100%: Checks: 19, Failures: 0, Errors: 0
134 PASS: test_parse
135 Running suite(s): sem
136 100%: Checks: 16, Failures: 0, Errors: 0
137 PASS: test_sem
138 Running suite(s): simplify
139 100%: Checks: 2, Failures: 0, Errors: 0
140 PASS: test_simp
141 Running suite(s): elab
142 100%: Checks: 3, Failures: 0, Errors: 0
143 PASS: test_elab
144 Running suite(s): heap
145 100%: Checks: 3, Failures: 0, Errors: 0
146 PASS: test_heap
147 wait1 : ok
148 assert1 : ok
149 assign1 : ok
150 wait2 : ok
151 arith1 : ok
152 signal1 : ok
153 attr1 : ok
154 signal2 : ok
155 signal3 : ok
156 assign2 : ok
157 assign3 : ok
158 signal4 : ok
159 wait3 : ok
160 wait4 : ok
161 wait5 : ok
162 elab1 : ok
163 image : ok
164 cond1 : ok
165 counter : ok
166 last_value : ok
167 cond2 : ok
168 vecorder : ok
169 elab2 : ok
170 func1 : ok
171 signal5 : ok
172 while1 : ok
173 signal6 : ok
174 slice1 : ok
175 logical1 : ok
176 lfsr : ok
177 link1 : ok
178 for1 : ok
179 operator1 : ok
180 fact : ok
181 func2 : ok
182 alias1 : ok
183 alias2 : ok
184 func3 : ok
185 func4 : ok
186 operator2 : ok
187 array1 : ok
188 agg1 : ok
189 agg2 : ok
190 case1 : ok
191 func5 : ok
192 ieee1 : *** glibc detected *** /home/hiyuh/git-repos/nvc/src/nvc: double free or corruption (out): 0x10d16f78 ***
193 ======= Backtrace: =========
194 /lib/libc.so.6(+0x81d20)[0xfa5ad20]
195 /lib/libc.so.6(cfree+0x8c)[0xfa60054]
196 /home/hiyuh/git-repos/nvc/src/nvc[0x104cc09c]
197 /home/hiyuh/git-repos/nvc/src/nvc[0x104dcf8c]
198 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm13LPPassManager13runOnFunctionERNS_8FunctionE+0x5d8)[0x106c5fd0]
199 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x250)[0x10872168]
200 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm23FunctionPassManagerImpl3runERNS_8FunctionE+0x74)[0x108722e4]
201 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm19FunctionPassManager3runERNS_8FunctionE+0x88)[0x10872440]
202 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm3JIT14jitTheFunctionEPNS_8FunctionERKNS_10MutexGuardE+0x60)[0x1030f780]
203 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm3JIT24runJITOnFunctionUnlockedEPNS_8FunctionERKNS_10MutexGuardE+0x58)[0x1030fb04]
204 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm3JIT20getPointerToFunctionEPNS_8FunctionE+0x1b4)[0x1030fcf8]
205 /home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm15ExecutionEngine18getPointerToGlobalEPKNS_11GlobalValueE+0x224)[0x10330df4]
206 /home/hiyuh/git-repos/nvc/src/nvc(LLVMGetPointerToGlobal+0x24)[0x103368c4]
207 /home/hiyuh/git-repos/nvc/src/nvc(jit_fun_ptr+0x54)[0x10140814]
208 /home/hiyuh/git-repos/nvc/src/nvc[0x1013d0ac]
209 /home/hiyuh/git-repos/nvc/src/nvc(rt_batch_exec+0x60)[0x1013dd20]
210 /home/hiyuh/git-repos/nvc/src/nvc(main+0x8e4)[0x1010e384]
211 /lib/libc.so.6(+0x23110)[0xf9fc110]
212 /lib/libc.so.6(+0x232a0)[0xf9fc2a0]
213 ======= Memory map: ========
214 00100000-00103000 r-xp 00000000 00:00 0 [vdso]
215 0f977000-0f9b5000 r-xp 00000000 08:06 1480582 /lib/libncurses.so.5.9
216 0f9b5000-0f9c5000 ---p 0003e000 08:06 1480582 /lib/libncurses.so.5.9
217 0f9c5000-0f9c8000 r--p 0003e000 08:06 1480582 /lib/libncurses.so.5.9
218 0f9c8000-0f9c9000 rw-p 00041000 08:06 1480582 /lib/libncurses.so.5.9
219 0f9d9000-0fb3d000 r-xp 00000000 08:06 1740830 /lib/libc-2.14.1.so
220 0fb3d000-0fb4d000 ---p 00164000 08:06 1740830 /lib/libc-2.14.1.so
221 0fb4d000-0fb51000 r--p 00164000 08:06 1740830 /lib/libc-2.14.1.so
222 0fb51000-0fb52000 rw-p 00168000 08:06 1740830 /lib/libc-2.14.1.so
223 0fb52000-0fb55000 rw-p 00000000 00:00 0
224 0fb65000-0fb7a000 r-xp 00000000 08:06 267158 /lib/libgcc_s.so.1
225 0fb7a000-0fb8a000 ---p 00015000 08:06 267158 /lib/libgcc_s.so.1
226 0fb8a000-0fb8b000 r--p 00015000 08:06 267158 /lib/libgcc_s.so.1
227 0fb8b000-0fb8c000 rw-p 00016000 08:06 267158 /lib/libgcc_s.so.1
228 0fb9c000-0fc41000 r-xp 00000000 08:06 1740232 /lib/libm-2.14.1.so
229 0fc41000-0fc51000 ---p 000a5000 08:06 1740232 /lib/libm-2.14.1.so
230 0fc51000-0fc54000 r--p 000a5000 08:06 1740232 /lib/libm-2.14.1.so
231 0fc54000-0fc55000 rw-p 000a8000 08:06 1740232 /lib/libm-2.14.1.so
232 0fc65000-0fd6c000 r-xp 00000000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
233 0fd6c000-0fd7b000 ---p 00107000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
234 0fd7b000-0fd80000 r--p 00106000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
235 0fd80000-0fd82000 rw-p 0010b000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
236 0fd82000-0fd88000 rw-p 00000000 00:00 0
237 0fd98000-0fdcc000 r-xp 00000000 08:06 1203034 /lib/libreadline.so.6.2
238 0fdcc000-0fddb000 ---p 00034000 08:06 1203034 /lib/libreadline.so.6.2
239 0fddb000-0fddd000 r--p 00033000 08:06 1203034 /lib/libreadline.so.6.2
240 0fddd000-0fde0000 rw-p 00035000 08:06 1203034 /lib/libreadline.so.6.2
241 0fde0000-0fde2000 rw-p 00000000 00:00 0
242 0fdf2000-0fee6000 r-xp 00000000 08:06 1593415 /usr/lib/libtcl8.5.so
243 0fee6000-0fef5000 ---p 000f4000 08:06 1593415 /usr/lib/libtcl8.5.so
244 0fef5000-0fefa000 r--p 000f3000 08:06 1593415 /usr/lib/libtcl8.5.so
245 0fefa000-0fefe000 rw-p 000f8000 08:06 1593415 /usr/lib/libtcl8.5.so
246 0fefe000-0feff000 rw-p 00000000 00:00 0
247 0ff0f000-0ff55000 r-xp 00000000 08:06 1480465 /lib/libncursesw.so.5.9
248 0ff55000-0ff64000 ---p 00046000 08:06 1480465 /lib/libncursesw.so.5.9
249 0ff64000-0ff67000 r--p 00045000 08:06 1480465 /lib/libncursesw.so.5.9
250 0ff67000-0ff68000 rw-p 00048000 08:06 1480465 /lib/libncursesw.so.5.9
251 0ff78000-0ff7b000 r-xp 00000000 08:06 1740289 /lib/libdl-2.14.1.so
252 0ff7b000-0ff8a000 ---p 00003000 08:06 1740289 /lib/libdl-2.14.1.so
253 0ff8a000-0ff8b000 r--p 00002000 08:06 1740289 /lib/libdl-2.14.1.so
254 0ff8b000-0ff8c000 rw-p 00003000 08:06 1740289 /lib/libdl-2.14.1.so
255 0ff9c000-0ffa3000 r-xp 00000000 08:06 1204137 /usr/lib/libffi.so.5.0.10
256 0ffa3000-0ffb3000 ---p 00007000 08:06 1204137 /usr/lib/libffi.so.5.0.10
257 0ffb3000-0ffb4000 r--p 00007000 08:06 1204137 /usr/lib/libffi.so.5.0.10
258 0ffb4000-0ffb5000 rw-p 00008000 08:06 1204137 /usr/lib/libffi.so.5.0.10
259 0ffc5000-0ffdc000 r-xp 00000000 08:06 1740593 /lib/libpthread-2.14.1.so
260 0ffdc000-0ffec000 ---p 00017000 08:06 1740593 /lib/libpthread-2.14.1.so
261 0ffec000-0ffed000 r--p 00017000 08:06 1740593 /lib/libpthread-2.14.1.so
262 0ffed000-0ffee000 rw-p 00018000 08:06 1740593 /lib/libpthread-2.14.1.so
263 0ffee000-0fff0000 rw-p 00000000 00:00 0
264 10000000-10956000 r-xp 00000000 08:06 841761 /home/hiyuh/git-repos/nvc/src/nvc
265 10966000-1097d000 r--p 00956000 08:06 841761 /home/hiyuh/git-repos/nvc/src/nvc
266 1097d000-10988000 rw-p 0096d000 08:06 841761 /home/hiyuh/git-repos/nvc/src/nvc
267 10988000-1098f000 rwxp 00000000 00:00 0
268 10c7c000-10d63000 rwxp 00000000 00:00 0 [heap]
269 48000000-48020000 r-xp 00000000 08:06 1740829 /lib/ld-2.14.1.so
270 48020000-48021000 rw-p 00000000 00:00 0
271 48021000-48022000 r--p 00021000 08:06 1740829 /lib/ld-2.14.1.so
272 48022000-48023000 rw-p 00022000 08:06 1740829 /lib/ld-2.14.1.so
273 48023000-48025000 rw-p 00000000 00:00 0
274 4802d000-48031000 rw-p 00000000 00:00 0
275 48031000-480d1000 rwxp 00000000 00:00 0
276 bfdab000-bfdcc000 rw-p 00000000 00:00 0 [stack]
277 failed
278 /home/hiyuh/git-repos/nvc/src/nvc -a /home/hiyuh/git-repos/nvc/test/regress/ieee1.vhd
279 [gc: freed 682 trees; 675 allocated]
280 /home/hiyuh/git-repos/nvc/src/nvc -e ieee1
281 [gc: freed 0 trees; 726 allocated]
282 IEEE.STD_LOGIC_1164
283 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/logs/ieee1/work/_WORK.IEEE1.final.bc /home/hiyuh/git-repos/nvc/test/logs/ieee1/work/_WORK.IEEE1.elab.bc /home/hiyuh/git-repos/nvc/lib/ieee/ieee/_IEEE.STD_LOGIC_1164-body.bc
284 /home/hiyuh/git-repos/nvc/src/nvc -r ieee1
285 Stack dump:
286 0. Running pass 'Loop Pass Manager' on function '@"IEEE.STD_LOGIC_1164.\22or\22$IEEE.STD_LOGIC_1164.STD_LOGIC_VECTOR$IEEE.STD_LOGIC_1164.STD_LOGIC_VECTOR"'
287 1. Running pass 'Loop Strength Reduction' on basic block '%while'
288
289 ieee2 : ok
290 cond3 : ok
291 concat1 : ok
292 concat2 : ok
293 null1 : ok
294 FAIL: run_regr.rb
295 ==============================================
296 1 of 8 tests failed
297 Please report to Nick Gasson <nick@nick.me.uk>
298 ==============================================
299 make[2]: *** [check-TESTS] Error 1
300 make[2]: Leaving directory `/home/hiyuh/git-repos/nvc/test'
301 [SNIP]
302
303 On the above log, "double free or corruption" occurs w/ ieee1 regression only.
304 But this symptoms looks not deterministic.
305 IIRC, I've got same error w/ other regression and also ieee1 regression finishes successfully sometimes.
306 And it looks the problem is in LLVM internal.
307
308 Try ieee1 regression again, and w/ valgrind:
309
310 $ cd test
311 $ ./run_regr.sh each ieee1
312 > analyze
313 >> analyze regress/ieee1.vhd
314 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -a regress/ieee1.vhd
315 [gc: freed 682 trees; 675 allocated]
316 > elaborate
317 >> elaborate ieee1
318 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -e ieee1
319 [gc: freed 0 trees; 726 allocated]
320 IEEE.STD_LOGIC_1164
321 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/work/_WORK.IEEE1.final.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.IEEE1.elab.bc /home/hiyuh/git-repos/nvc/lib/ieee/ieee/_IEEE.STD_LOGIC_1164-body.bc
322 > run
323 >> run ieee1
324 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r ieee1
325 *** glibc detected *** ../src/nvc: double free or corruption (!prev): 0x1106d8b0 ***
326 ======= Backtrace: =========
327 /lib/libc.so.6(+0x81d20)[0xfa5ad20]
328 /lib/libc.so.6(cfree+0x8c)[0xfa60054]
329 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6(_ZdlPv+0x2c)[0xfd2fc98]
330 ../src/nvc[0x104cc210]
331 ../src/nvc[0x104dcf8c]
332 ../src/nvc(_ZN4llvm13LPPassManager13runOnFunctionERNS_8FunctionE+0x5d8)[0x106c5fd0]
333 ../src/nvc(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x250)[0x10872168]
334 ../src/nvc(_ZN4llvm23FunctionPassManagerImpl3runERNS_8FunctionE+0x74)[0x108722e4]
335 ../src/nvc(_ZN4llvm19FunctionPassManager3runERNS_8FunctionE+0x88)[0x10872440]
336 ../src/nvc(_ZN4llvm3JIT14jitTheFunctionEPNS_8FunctionERKNS_10MutexGuardE+0x60)[0x1030f780]
337 ../src/nvc(_ZN4llvm3JIT24runJITOnFunctionUnlockedEPNS_8FunctionERKNS_10MutexGuardE+0x58)[0x1030fb04]
338 ../src/nvc(_ZN4llvm3JIT20getPointerToFunctionEPNS_8FunctionE+0x1b4)[0x1030fcf8]
339 ../src/nvc(_ZN4llvm15ExecutionEngine18getPointerToGlobalEPKNS_11GlobalValueE+0x224)[0x10330df4]
340 ../src/nvc(LLVMGetPointerToGlobal+0x24)[0x103368c4]
341 ../src/nvc(jit_fun_ptr+0x54)[0x10140814]
342 ../src/nvc[0x1013d0ac]
343 ../src/nvc(rt_batch_exec+0x60)[0x1013dd20]
344 ../src/nvc(main+0x8e4)[0x1010e384]
345 /lib/libc.so.6(+0x23110)[0xf9fc110]
346 /lib/libc.so.6(+0x232a0)[0xf9fc2a0]
347 ======= Memory map: ========
348 00100000-00103000 r-xp 00000000 00:00 0 [vdso]
349 0f977000-0f9b5000 r-xp 00000000 08:06 1480582 /lib/libncurses.so.5.9
350 0f9b5000-0f9c5000 ---p 0003e000 08:06 1480582 /lib/libncurses.so.5.9
351 0f9c5000-0f9c8000 r--p 0003e000 08:06 1480582 /lib/libncurses.so.5.9
352 0f9c8000-0f9c9000 rw-p 00041000 08:06 1480582 /lib/libncurses.so.5.9
353 0f9d9000-0fb3d000 r-xp 00000000 08:06 1740830 /lib/libc-2.14.1.so
354 0fb3d000-0fb4d000 ---p 00164000 08:06 1740830 /lib/libc-2.14.1.so
355 0fb4d000-0fb51000 r--p 00164000 08:06 1740830 /lib/libc-2.14.1.so
356 0fb51000-0fb52000 rw-p 00168000 08:06 1740830 /lib/libc-2.14.1.so
357 0fb52000-0fb55000 rw-p 00000000 00:00 0
358 0fb65000-0fb7a000 r-xp 00000000 08:06 267158 /lib/libgcc_s.so.1
359 0fb7a000-0fb8a000 ---p 00015000 08:06 267158 /lib/libgcc_s.so.1
360 0fb8a000-0fb8b000 r--p 00015000 08:06 267158 /lib/libgcc_s.so.1
361 0fb8b000-0fb8c000 rw-p 00016000 08:06 267158 /lib/libgcc_s.so.1
362 0fb9c000-0fc41000 r-xp 00000000 08:06 1740232 /lib/libm-2.14.1.so
363 0fc41000-0fc51000 ---p 000a5000 08:06 1740232 /lib/libm-2.14.1.so
364 0fc51000-0fc54000 r--p 000a5000 08:06 1740232 /lib/libm-2.14.1.so
365 0fc54000-0fc55000 rw-p 000a8000 08:06 1740232 /lib/libm-2.14.1.so
366 0fc65000-0fd6c000 r-xp 00000000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
367 0fd6c000-0fd7b000 ---p 00107000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
368 0fd7b000-0fd80000 r--p 00106000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
369 0fd80000-0fd82000 rw-p 0010b000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
370 0fd82000-0fd88000 rw-p 00000000 00:00 0
371 0fd98000-0fdcc000 r-xp 00000000 08:06 1203034 /lib/libreadline.so.6.2
372 0fdcc000-0fddb000 ---p 00034000 08:06 1203034 /lib/libreadline.so.6.2
373 0fddb000-0fddd000 r--p 00033000 08:06 1203034 /lib/libreadline.so.6.2
374 0fddd000-0fde0000 rw-p 00035000 08:06 1203034 /lib/libreadline.so.6.2
375 0fde0000-0fde2000 rw-p 00000000 00:00 0
376 0fdf2000-0fee6000 r-xp 00000000 08:06 1593415 /usr/lib/libtcl8.5.so
377 0fee6000-0fef5000 ---p 000f4000 08:06 1593415 /usr/lib/libtcl8.5.so
378 0fef5000-0fefa000 r--p 000f3000 08:06 1593415 /usr/lib/libtcl8.5.so
379 0fefa000-0fefe000 rw-p 000f8000 08:06 1593415 /usr/lib/libtcl8.5.so
380 0fefe000-0feff000 rw-p 00000000 00:00 0
381 0ff0f000-0ff55000 r-xp 00000000 08:06 1480465 /lib/libncursesw.so.5.9
382 0ff55000-0ff64000 ---p 00046000 08:06 1480465 /lib/libncursesw.so.5.9
383 0ff64000-0ff67000 r--p 00045000 08:06 1480465 /lib/libncursesw.so.5.9
384 0ff67000-0ff68000 rw-p 00048000 08:06 1480465 /lib/libncursesw.so.5.9
385 0ff78000-0ff7b000 r-xp 00000000 08:06 1740289 /lib/libdl-2.14.1.so
386 0ff7b000-0ff8a000 ---p 00003000 08:06 1740289 /lib/libdl-2.14.1.so
387 0ff8a000-0ff8b000 r--p 00002000 08:06 1740289 /lib/libdl-2.14.1.so
388 0ff8b000-0ff8c000 rw-p 00003000 08:06 1740289 /lib/libdl-2.14.1.so
389 0ff9c000-0ffa3000 r-xp 00000000 08:06 1204137 /usr/lib/libffi.so.5.0.10
390 0ffa3000-0ffb3000 ---p 00007000 08:06 1204137 /usr/lib/libffi.so.5.0.10
391 0ffb3000-0ffb4000 r--p 00007000 08:06 1204137 /usr/lib/libffi.so.5.0.10
392 0ffb4000-0ffb5000 rw-p 00008000 08:06 1204137 /usr/lib/libffi.so.5.0.10
393 0ffc5000-0ffdc000 r-xp 00000000 08:06 1740593 /lib/libpthread-2.14.1.so
394 0ffdc000-0ffec000 ---p 00017000 08:06 1740593 /lib/libpthread-2.14.1.so
395 0ffec000-0ffed000 r--p 00017000 08:06 1740593 /lib/libpthread-2.14.1.so
396 0ffed000-0ffee000 rw-p 00018000 08:06 1740593 /lib/libpthread-2.14.1.so
397 0ffee000-0fff0000 rw-p 00000000 00:00 0
398 10000000-10956000 r-xp 00000000 08:06 841761 /home/hiyuh/git-repos/nvc/src/nvc
399 10966000-1097d000 r--p 00956000 08:06 841761 /home/hiyuh/git-repos/nvc/src/nvc
400 1097d000-10988000 rw-p 0096d000 08:06 841761 /home/hiyuh/git-repos/nvc/src/nvc
401 10988000-1098f000 rwxp 00000000 00:00 0
402 10fa7000-1108e000 rwxp 00000000 00:00 0 [heap]
403 48000000-48020000 r-xp 00000000 08:06 1740829 /lib/ld-2.14.1.so
404 48020000-48021000 rw-p 00000000 00:00 0
405 48021000-48022000 r--p 00021000 08:06 1740829 /lib/ld-2.14.1.so
406 48022000-48023000 rw-p 00022000 08:06 1740829 /lib/ld-2.14.1.so
407 48023000-48025000 rw-p 00000000 00:00 0
408 4802d000-48031000 rw-p 00000000 00:00 0
409 48031000-480d1000 rwxp 00000000 00:00 0
410 bf88a000-bf8ab000 rw-p 00000000 00:00 0 [stack]
411 Stack dump:
412 0. Running pass 'Loop Pass Manager' on function '@"IEEE.STD_LOGIC_1164.\22or\22$IEEE.STD_LOGIC_1164.STD_LOGIC_VECTOR$IEEE.STD_LOGIC_1164.STD_LOGIC_VECTOR"'
413 1. Running pass 'Loop Strength Reduction' on basic block '%while'
414 ./run_regr.sh: line 43: 15499 Aborted NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r ieee1
415
416 $ NVC_LIBPATH=../lib/std:../lib/ieee valgrind --leak-check=full ../src/nvc -r ieee1
417 ==15534== Memcheck, a memory error detector
418 ==15534== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
419 ==15534== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
420 ==15534== Command: ../src/nvc -r ieee1
421 ==15534==
422 ==15534==
423 ==15534== HEAP SUMMARY:
424 ==15534== in use at exit: 191,901 bytes in 2,664 blocks
425 ==15534== total heap usage: 13,884 allocs, 11,220 frees, 1,927,036 bytes allocated
426 ==15534==
427 ==15534== 8,640 bytes in 15 blocks are possibly lost in loss record 447 of 449
428 ==15534== at 0xFFB6EB4: operator new(unsigned int) (vg_replace_malloc.c:282)
429 ==15534== by 0x1087F69F: llvm::User::operator new(unsigned int, unsigned int) (in /home/hiyuh/git-repos/nvc/src/nvc)
430 ==15534== by 0x107F3C7B: llvm::ConstantUniqueMap<std::vector<llvm::Constant*, std::allocator<llvm::Constant*> >, llvm::ArrayRef<llvm::Constant*>, llvm::ArrayType, llvm::ConstantArray, true>::Create(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>, std::_Rb_tree_iterator<std::pair<std::pair<llvm::ArrayType*, std::vector<llvm::Constant*, std::allocator<llvm::Constant*> > > const, llvm::ConstantArray*> >) (in /home/hiyuh/git-repos/nvc/src/nvc)
431 ==15534== by 0x107F40C3: llvm::ConstantUniqueMap<std::vector<llvm::Constant*, std::allocator<llvm::Constant*> >, llvm::ArrayRef<llvm::Constant*>, llvm::ArrayType, llvm::ConstantArray, true>::getOrCreate(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>) (in /home/hiyuh/git-repos/nvc/src/nvc)
432 ==15534== by 0x107E8C43: llvm::ConstantArray::get(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>) (in /home/hiyuh/git-repos/nvc/src/nvc)
433 ==15534== by 0x101604BF: llvm::BitcodeReader::ParseConstants() (in /home/hiyuh/git-repos/nvc/src/nvc)
434 ==15534== by 0x1016265F: llvm::BitcodeReader::ParseModule() (in /home/hiyuh/git-repos/nvc/src/nvc)
435 ==15534== by 0x101635BF: llvm::BitcodeReader::ParseBitcodeInto(llvm::Module*) (in /home/hiyuh/git-repos/nvc/src/nvc)
436 ==15534== by 0x1016385B: llvm::getLazyBitcodeModule(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) (in /home/hiyuh/git-repos/nvc/src/nvc)
437 ==15534== by 0x1016390B: llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) (in /home/hiyuh/git-repos/nvc/src/nvc)
438 ==15534== by 0x10158B0F: LLVMParseBitcodeInContext (in /home/hiyuh/git-repos/nvc/src/nvc)
439 ==15534== by 0x10158C07: LLVMParseBitcode (in /home/hiyuh/git-repos/nvc/src/nvc)
440 ==15534==
441 ==15534== LEAK SUMMARY:
442 ==15534== definitely lost: 0 bytes in 0 blocks
443 ==15534== indirectly lost: 0 bytes in 0 blocks
444 ==15534== possibly lost: 8,640 bytes in 15 blocks
445 ==15534== still reachable: 183,261 bytes in 2,649 blocks
446 ==15534== suppressed: 0 bytes in 0 blocks
447 ==15534== Reachable blocks (those to which a pointer was found) are not shown.
448 ==15534== To see them, rerun with: --leak-check=full --show-reachable=yes
449 ==15534==
450 ==15534== For counts of detected and suppressed errors, rerun with: -v
451 ==15534== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 7 from 5)
ae49d14 @hiyuh Update TODO.
authored
452
ae593d5 @hiyuh Update TODO.
authored
453 ------------------------
454 Support make -j* in lib/
455 ------------------------
456 SSIA, at least lib/ieee/Makefile.am works properly only when make -j1.
931c873 @hiyuh Update TODO.
authored
457
458 -----------------------
459 Fix SIGSEGV on _image()
460 -----------------------
461 Even if I W/A LLVM altivec bug, NVC vomits SIGSEGV on _image() on ppc32-linux.
462
463 See more detail:
464
465 $ uname -a
466 Linux wombat 3.3.0-gentoo #1 Wed Mar 21 11:48:23 JST 2012 ppc 7447A, altivec supported PowerMac10,2 GNU/Linux
467
468 $ eix -Ic sys-devel/llvm
4af28d0 @hiyuh Update TODO.
authored
469 [I] sys-devel/llvm (9999@04/04/12): Low Level Virtual Machine
931c873 @hiyuh Update TODO.
authored
470 [NOTE: This sys-devel/llvm-9999 is compiled w/;
471 CFLAGS="-O2 -mtune=G4 -mcpu=G4 -maltivec -mabi=altivec -Wall -fno-strict-aliasing -mno-altivec -mabi=no-altivec -ggdb"
472 CXXFLAGS="-O2 -mtune=G4 -mcpu=G4 -maltivec -mabi=altivec -Wall -fno-strict-aliasing -mno-altivec -mabi=no-altivec -ggdb"
473 LDFLAGS="-Wl,-O1 -Wl,--as-needed"
474 to workaround LLVM's altivec bug.]
475
476 $ llvm-config --version
477 3.1svn
478 [NOTE: This sys-devel/llvm-999 is live svn ebuild.
4af28d0 @hiyuh Update TODO.
authored
479 ATM, used svn trunk tells me it is r153997.]
931c873 @hiyuh Update TODO.
authored
480
481 $ git clone git://github.com/hiyuh/nvc.git
482 [SNIP]
4af28d0 @hiyuh Update TODO.
authored
483 $ cd nvc
931c873 @hiyuh Update TODO.
authored
484 $ ./autogen.sh
485 [SNIP]
486 $ CFLAGS="-O0 -ggdb" CXXFLAGS="-O0 -ggdb" ./configure
487 [SNIP]
488 [NOTE: Prepare lib/ieee before make. :P]
489 $ make
490 [SNIP]
491 $ make check
492 [SNIP]
493 image : failed
494 /home/hiyuh/git-repos/nvc/src/nvc -a /home/hiyuh/git-repos/nvc/test/regress/image.vhd
495 /home/hiyuh/git-repos/nvc/src/nvc -e image
496 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/logs/image/work/_WORK.IMAGE.final.bc /home/hiyuh/git-repos/nvc/test/logs/image/work/_WORK.IMAGE.elab.bc /home/hiyuh/git-repos/nvc/test/logs/image/work/_WORK.P-body.bc
497 /home/hiyuh/git-repos/nvc/src/nvc -r image
498
4af28d0 @hiyuh Update TODO.
authored
499 *** Caught signal 11 (SIGSEGV) [address=(nil), ip=0xed9a110] ***
931c873 @hiyuh Update TODO.
authored
500
501 -------- STACK TRACE --------
4af28d0 @hiyuh Update TODO.
authored
502 /lib/libc.so.6(strlen+0xc) [0xed9a110]
931c873 @hiyuh Update TODO.
authored
503 [0x2cd]
4af28d0 @hiyuh Update TODO.
authored
504 /home/hiyuh/git-repos/nvc/src/nvc() [0x100073a0]
505 /home/hiyuh/git-repos/nvc/src/nvc(lib_find+0x30) [0x10007b10]
506 /home/hiyuh/git-repos/nvc/src/nvc() [0x100516f8]
507 /home/hiyuh/git-repos/nvc/src/nvc() [0x100518c0]
508 /home/hiyuh/git-repos/nvc/src/nvc(_image+0x74) [0x1004f574]
931c873 @hiyuh Update TODO.
authored
509 [0x480320b0]
4af28d0 @hiyuh Update TODO.
authored
510 /home/hiyuh/git-repos/nvc/src/nvc() [0x10050770]
511 /home/hiyuh/git-repos/nvc/src/nvc() [0x10051348]
512 /home/hiyuh/git-repos/nvc/src/nvc(rt_batch_exec+0x60) [0x10051fe0]
513 /home/hiyuh/git-repos/nvc/src/nvc() [0x10006df4]
514 /home/hiyuh/git-repos/nvc/src/nvc(main+0x1c0) [0x10007314]
515 /lib/libc.so.6(+0x23110) [0xed32110]
516 /lib/libc.so.6(+0x232a0) [0xed322a0]
931c873 @hiyuh Update TODO.
authored
517 -----------------------------
518 [SNIP]
519
520 $ cd test
521 $ ./run_regr.sh all image
522 > analyze
523 >> analyze regress/image.vhd
524 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -a regress/image.vhd
525 > elaborate
526 >> elaborate image
527 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -e image
528 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/work/_WORK.IMAGE.final.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.IMAGE.elab.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.P-body.bc
529 > run
530 >> run image
531 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r image
532
4af28d0 @hiyuh Update TODO.
authored
533 *** Caught signal 11 (SIGSEGV) [address=(nil), ip=0xed9a110] ***
931c873 @hiyuh Update TODO.
authored
534
535 -------- STACK TRACE --------
4af28d0 @hiyuh Update TODO.
authored
536 /lib/libc.so.6(strlen+0xc) [0xed9a110]
931c873 @hiyuh Update TODO.
authored
537 [0x2cd]
4af28d0 @hiyuh Update TODO.
authored
538 ../src/nvc() [0x100073a0]
539 ../src/nvc(lib_find+0x30) [0x10007b10]
540 ../src/nvc() [0x100516f8]
541 ../src/nvc() [0x100518c0]
542 ../src/nvc(_image+0x74) [0x1004f574]
931c873 @hiyuh Update TODO.
authored
543 [0x480320b0]
4af28d0 @hiyuh Update TODO.
authored
544 ../src/nvc() [0x10050770]
545 ../src/nvc() [0x10051348]
546 ../src/nvc(rt_batch_exec+0x60) [0x10051fe0]
547 ../src/nvc() [0x10006df4]
548 ../src/nvc(main+0x1c0) [0x10007314]
549 /lib/libc.so.6(+0x23110) [0xed32110]
550 /lib/libc.so.6(+0x232a0) [0xed322a0]
551 -----------------------------
552
553 Try reduced regression again,
554
555 $ ./run_regr.sh all reduced_image
556 > analyze
557 >> analyze regress/reduced_image.vhd
558 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -a regress/reduced_image.vhd
559 > elaborate
560 >> elaborate reduced_image
561 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -e reduced_image
562 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/work/_WORK.REDUCED_IMAGE.final.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.REDUCED_IMAGE.elab.bc
563 > run
564 >> run reduced_image
565 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r reduced_image
566
567 *** Caught signal 11 (SIGSEGV) [address=(nil), ip=0xed9a110] ***
568
569 -------- STACK TRACE --------
570 /lib/libc.so.6(strlen+0xc) [0xed9a110]
571 [0x2cd]
572 ../src/nvc() [0x100073a0]
573 ../src/nvc(lib_find+0x30) [0x10007b10]
574 ../src/nvc() [0x100516f8]
575 ../src/nvc() [0x100518c0]
576 ../src/nvc(_image+0x74) [0x1004f574]
577 [0x4803206c]
578 ../src/nvc() [0x10050770]
579 ../src/nvc() [0x10051348]
580 ../src/nvc(rt_batch_exec+0x60) [0x10051fe0]
581 ../src/nvc() [0x10006df4]
582 ../src/nvc(main+0x1c0) [0x10007314]
583 /lib/libc.so.6(+0x23110) [0xed32110]
584 /lib/libc.so.6(+0x232a0) [0xed322a0]
585 -----------------------------
586
587 $ EXTRA_RFLAGS="--trace" ./run_regr.sh run reduced_image
588 > run
589 >> run reduced_image
590 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r --trace reduced_image
591 TRACE (init): process :reduced_image(test):_proc at 0x48032010
592 TRACE (init): reset process :reduced_image(test):_proc
593 TRACE (init): _sched_process delay=0ms
594 TRACE 0ms+0: begin cycle
595 0ms process :reduced_image(test):_proc
596 TRACE 0ms+0: run process :reduced_image(test):_proc
597 TRACE 0ms+0: _image val=c8480b2010 where=1208754184 module="(null)"
598
599 *** Caught signal 11 (SIGSEGV) [address=(nil), ip=0xed9a110] ***
600
601 -------- STACK TRACE --------
602 /lib/libc.so.6(strlen+0xc) [0xed9a110]
603 /lib/libc.so.6(__overflow+0x74) [0xed8defc]
604 ../src/nvc() [0x100516c8]
605 ../src/nvc() [0x100518c0]
606 ../src/nvc(_image+0x74) [0x1004f574]
607 [0x4803206c]
608 ../src/nvc() [0x10050770]
609 ../src/nvc() [0x10051348]
610 ../src/nvc(rt_batch_exec+0x60) [0x10051fe0]
611 ../src/nvc() [0x10006df4]
612 ../src/nvc(main+0x1c0) [0x10007314]
613 /lib/libc.so.6(+0x23110) [0xed32110]
614 /lib/libc.so.6(+0x232a0) [0xed322a0]
931c873 @hiyuh Update TODO.
authored
615 -----------------------------
616
4af28d0 @hiyuh Update TODO.
authored
617 I don't know why modele is null, and nickg also has no idea.
618
619 https://github.com/hiyuh/nvc/commit/931c8731d53ac925aa3c5a3703d622db6166cc34#commitcomment-1126798
620
4765178 @hiyuh Update TODO.
authored
621 Also, on i686-cygwin, it works fine.
622
623 $ uname -a
624 CYGWIN_NT-5.1 lion 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin
625
626 $ EXTRA_RFLAGS="--trace" ./run_regr.sh run reduced_image
627 > run
628 >> run reduced_image
629 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r --trace reduced_image
630 TRACE (init): process :reduced_image(test):_proc at 0x7ff30010
631 TRACE (init): reset process :reduced_image(test):_proc
632 TRACE (init): _sched_process delay=0ms
633 TRACE 0ms+0: begin cycle
634 0ms process :reduced_image(test):_proc
635 TRACE 0ms+0: run process :reduced_image(test):_proc
636 TRACE 0ms+0: _image val=4 where=200 module="WORK.REDUCED_IMAGE.elab"
637 TRACE 0ms+0: _assert_fail msg=4 msg_len=1 severity=0 where=2 module=WORK.REDUCED_IMAGE.elab
638 ** Note: 0ms+0: Report Note: 4
639 File regress/reduced_image.vhd, Line 9
640
4af28d0 @hiyuh Update TODO.
authored
641 So I'd have to say this is a LLVM bug itself.
642 To investigate more detail, do llvm-dis reduced regression's bitcode,
643
644 $ llvm-dis work/_WORK.REDUCED_IMAGE.final.bc
645
646 Now we get following LLVM IR named work/_WORK.REDUCED_IMAGE.final.ll,
647
648 1 ; ModuleID = 'work/_WORK.REDUCED_IMAGE.final.bc'
649 2
650 3 @module_name = private global [24 x i8] c"WORK.REDUCED_IMAGE.elab\00"
651 4 @":reduced_image(test):_proc__state.0" = internal unnamed_addr global i32 undef, align 8
652 5
653 6 declare void @_sched_process(i64)
654 7
655 8 declare void @_assert_fail(i8*, i32, i8, i32, i8*)
656 9
657 10 declare { i8*, i32, i32, i8 } @_image(i64, i32, i8*)
658 11
659 12 define void @":reduced_image(test):_proc"(i32) {
660 13 entry:
661 14 %1 = icmp eq i32 %0, 0
662 15 %2 = load i32* @":reduced_image(test):_proc__state.0", align 8
663 16 %switch = icmp ult i32 %2, 2
664 17 %or.cond = and i1 %1, %switch
665 18 br i1 %or.cond, label %start, label %init
666 19
667 20 init: ; preds = %entry
668 21 call void @_sched_process(i64 0)
669 22 store i32 0, i32* @":reduced_image(test):_proc__state.0", align 8
670 23 ret void
671 24
672 25 start: ; preds = %entry
673 26 %3 = call { i8*, i32, i32, i8 } @_image(i64 4, i32 200, i8* getelementptr inbounds ([24 x i8]* @module_name, i64 0, i64 0))
674 27 %aptr = extractvalue { i8*, i32, i32, i8 } %3, 0
675 28 %dir = extractvalue { i8*, i32, i32, i8 } %3, 3
676 29 %downto = icmp eq i8 %dir, 1
677 30 %left = extractvalue { i8*, i32, i32, i8 } %3, 1
678 31 %right = extractvalue { i8*, i32, i32, i8 } %3, 2
679 32 %4 = sub i32 %left, %right
680 33 %5 = sub i32 %right, %left
681 34 %diff = select i1 %downto, i32 %4, i32 %5
682 35 %len = add i32 %diff, 1
683 36 %negative = icmp slt i32 %len, 0
684 37 %len_clamp = select i1 %negative, i32 0, i32 %len
685 38 call void @_assert_fail(i8* %aptr, i32 %len_clamp, i8 0, i32 2, i8* getelementptr inbounds ([24 x i8]* @module_name, i64 0, i64 0))
686 39 store i32 1, i32* @":reduced_image(test):_proc__state.0", align 8
687 40 ret void
688 41 }
689
690 Where something goes wrong is line 26, I guess.
4765178 @hiyuh Update TODO.
authored
691 ppc32-linux has completely unexpected TRACE output, maybe "call" is broken?
4af28d0 @hiyuh Update TODO.
authored
692
4765178 @hiyuh Update TODO.
authored
693 ppc32-linux > TRACE 0ms+0: _image val=c8480b2010 where=1208754184 module="(null)"
694 i686-cygwin > TRACE 0ms+0: _image val=4 where=200 module="WORK.REDUCED_IMAGE.elab"
bb92972 @hiyuh Update TODO.
authored
695
696 -----------------------------------------------------------------------
697 Fix "nvc: tree.c:372: tree_ident: Assertion `t != ((void *)0)' failed."
698 -----------------------------------------------------------------------
699 Like above _image() issue, _inst_name() doesn't work on ppc32-linux.
700
701 See more detail:
702
703 $ uname -a
704 Linux wombat 3.3.1-gentoo #1 Thu Apr 5 17:30:06 JST 2012 ppc 7447A, altivec supported PowerMac10,2 GNU/Linux
705
706 $ eix -Ic sys-devel/llvm
707 [I] sys-devel/llvm (9999@04/06/12): Low Level Virtual Machine
708 [NOTE: This sys-devel/llvm-9999 is compiled w/;
709 CFLAGS="-O2 -mtune=G4 -mcpu=G4 -maltivec -mabi=altivec -Wall -fno-strict-aliasing -mno-altivec -mabi=no-altivec -ggdb"
710 CXXFLAGS="-O2 -mtune=G4 -mcpu=G4 -maltivec -mabi=altivec -Wall -fno-strict-aliasing -mno-altivec -mabi=no-altivec -ggdb"
711 LDFLAGS="-Wl,-O1 -Wl,--as-needed"
712 to workaround LLVM's altivec bug.]
713
714 $ llvm-config --version
715 3.1svn
716 [NOTE: This sys-devel/llvm-999 is live svn ebuild.
717 ATM, used svn trunk tells me it is r154158.]
718
719 $ git clone git://github.com/hiyuh/nvc.git
720 [SNIP]
721 $ cd nvc
722 $ ./autogen.sh
723 [SNIP]
724 $ CFLAGS="-O0 -ggdb" CXXFLAGS="-O0 -ggdb" ./configure
725 [SNIP]
726 [NOTE: Prepare lib/ieee before make. :P]
727 $ make
728 [SNIP]
729 $ make check
730 [SNIP]
731 elab3 : failed
732 /home/hiyuh/git-repos/nvc/src/nvc -a /home/hiyuh/git-repos/nvc/test/regress/elab3.vhd
733 /home/hiyuh/git-repos/nvc/src/nvc -e elab3
734 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/logs/elab3/work/_WORK.ELAB3.final.bc /home/hiyuh/git-repos/nvc/test/logs/elab3/work/_WORK.ELAB3.elab.bc
735 /home/hiyuh/git-repos/nvc/src/nvc -r elab3
736 nvc: tree.c:372: tree_ident: Assertion `t != ((void *)0)' failed.
737 Aborted
738 [SNIP]
739
740 $ cd test
741 $ EXTRA_RFLAGS="--trace" ./run_regr.sh all elab3
742 > analyze
743 >> analyze regress/elab3.vhd
744 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -a regress/elab3.vhd
745 > elaborate
746 >> elaborate elab3
747 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -e elab3
748 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/work/_WORK.ELAB3.final.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.ELAB3.elab.bc
749 > run
750 >> run elab3
751 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r --trace elab3
752 TRACE (init): signal :elab3(test):x at 0x480b2010
753 TRACE (init): signal :elab3(test):s@sub(test):p at 0x480b2040
754 TRACE (init): signal :elab3(test):b:y at 0x480b2070
755 TRACE (init): process :elab3(test):s@sub(test):_proc at 0x48032010
756 TRACE (init): process :elab3(test):b:_proc0 at 0x48032140
757 TRACE (init): process :elab3(test):_proc1 at 0x48032270
758 TRACE (init): reset process :elab3(test):s@sub(test):_proc
759 TRACE (init): _sched_process delay=0ms
760 TRACE (init): reset process :elab3(test):b:_proc0
761 TRACE (init): _sched_process delay=0ms
762 TRACE (init): reset process :elab3(test):_proc1
763 TRACE (init): _sched_process delay=0ms
764 TRACE 0ms+0: begin cycle
765 0ms process :elab3(test):s@sub(test):_proc
766 0ms process :elab3(test):b:_proc0
767 0ms process :elab3(test):_proc1
768 TRACE 0ms+0: run process :elab3(test):s@sub(test):_proc
769 TRACE 0ms+0: _sched_process delay=2ns
770 TRACE 0ms+0: run process :elab3(test):_proc1
771 nvc: tree.c:372: tree_ident: Assertion `t != ((void *)0)' failed.
772 Aborted
773
774 Try reduced regression again,
775
776 $ EXTRA_RFLAGS="--trace" ./run_regr.sh all reduced_elab3
777 > analyze
778 >> analyze regress/reduced_elab3.vhd
779 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -a regress/reduced_elab3.vhd
780 > elaborate
781 >> elaborate reduced_elab3
782 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -e reduced_elab3
783 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/work/_WORK.REDUCED_ELAB3.final.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.REDUCED_ELAB3.elab.bc
784 > run
785 >> run reduced_elab3
786 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r --trace reduced_elab3
787 TRACE (init): signal :reduced_elab3(test):x at 0x480b2010
788 TRACE (init): process :reduced_elab3(test):_proc at 0x48032010
789 TRACE (init): reset process :reduced_elab3(test):_proc
790 TRACE (init): _sched_process delay=0ms
791 TRACE 0ms+0: begin cycle
792 0ms process :reduced_elab3(test):_proc
793 TRACE 0ms+0: run process :reduced_elab3(test):_proc
794 nvc: tree.c:372: tree_ident: Assertion `t != ((void *)0)' failed.
795 Aborted
796
21a12ad @hiyuh Add run result of reduced_elab3 on i686-cygwin.
authored
797 Also on i686-cygwin, it works fine.
798
799 $ uname -a
800 CYGWIN_NT-5.1 lion 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin
801
802 $ EXTRA_RFLAGS="--trace" ./run_regr.sh all reduced_elab3
803 > analyze
804 >> analyze regress/reduced_elab3.vhd
805 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -a regress/reduced_elab3.vhd
806 > elaborate
807 >> elaborate reduced_elab3
808 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -e reduced_elab3
809 /usr/bin/llvm-ld -r -b /home/hiyuh/git-repos/nvc/test/work/_WORK.REDUCED_ELAB3.final.bc /home/hiyuh/git-repos/nvc/test/work/_WORK.REDUCED_ELAB3.elab.bc
810 > run
811 >> run reduced_elab3
812 NVC_LIBPATH=../lib/std:../lib/ieee ../src/nvc -r --trace reduced_elab3
813 TRACE (init): signal :reduced_elab3(test):x at 0x7ff20010
814 TRACE (init): process :reduced_elab3(test):_proc at 0x7ff30010
815 TRACE (init): reset process :reduced_elab3(test):_proc
816 TRACE (init): _sched_process delay=0ms
817 TRACE 0ms+0: begin cycle
818 0ms process :reduced_elab3(test):_proc
819 TRACE 0ms+0: run process :reduced_elab3(test):_proc
820 TRACE 0ms+0: _inst_name sig=:reduced_elab3(test):x
821 TRACE 0ms+0: _assert_fail msg=:reduced_elab3(test):x msg_len=23 severity=0 where=198 module=WORK.REDUCED_ELAB3.elab
822 ** Note: 0ms+0: Report Note: :reduced_elab3(test):x
823 File regress/reduced_elab3.vhd, Line 10
824
bb92972 @hiyuh Update TODO.
authored
825 To investigate more detail, do llvm-dis reduced regression's bitcode,
826
827 $ llvm-dis work/_WORK.REDUCED_ELAB3.final.bc
828
829 Now we get following LLVM IR named work/_WORK.REDUCED_ELAB3.final.ll,
830
831 1 ; ModuleID = 'work/_WORK.REDUCED_ELAB3.final.bc'
832 2
833 3 %signal_s = type { i64, i64, i8*, i8, i8, i16, i8*, i8*, i8* }
834 4
835 5 @module_name = private global [24 x i8] c"WORK.REDUCED_ELAB3.elab\00"
836 6 @":reduced_elab3(test):x" = global %signal_s zeroinitializer
837 7 @":reduced_elab3(test):_proc__state.0" = internal unnamed_addr global i32 undef, align 8
838 8
839 9 declare void @_sched_process(i64)
840 10
841 11 declare void @_assert_fail(i8*, i32, i8, i32, i8*)
842 12
843 13 declare { i8*, i32, i32, i8 } @_inst_name(i8*)
844 14
845 15 define void @":reduced_elab3(test):_proc"(i32) {
846 16 entry:
847 17 %1 = icmp eq i32 %0, 0
848 18 %2 = load i32* @":reduced_elab3(test):_proc__state.0", align 8
849 19 %switch = icmp ult i32 %2, 2
850 20 %or.cond = and i1 %1, %switch
851 21 br i1 %or.cond, label %start, label %init
852 22
853 23 init: ; preds = %entry
854 24 call void @_sched_process(i64 0)
855 25 store i32 0, i32* @":reduced_elab3(test):_proc__state.0", align 8
856 26 ret void
857 27
858 28 start: ; preds = %entry
859 29 %3 = call { i8*, i32, i32, i8 } @_inst_name(i8* bitcast (%signal_s* @":reduced_elab3(test):x" to i8*))
860 30 %aptr = extractvalue { i8*, i32, i32, i8 } %3, 0
861 31 %dir = extractvalue { i8*, i32, i32, i8 } %3, 3
862 32 %downto = icmp eq i8 %dir, 1
863 33 %left = extractvalue { i8*, i32, i32, i8 } %3, 1
864 34 %right = extractvalue { i8*, i32, i32, i8 } %3, 2
865 35 %4 = sub i32 %left, %right
866 36 %5 = sub i32 %right, %left
867 37 %diff = select i1 %downto, i32 %4, i32 %5
868 38 %len = add i32 %diff, 1
869 39 %negative = icmp slt i32 %len, 0
870 40 %len_clamp = select i1 %negative, i32 0, i32 %len
871 41 call void @_assert_fail(i8* %aptr, i32 %len_clamp, i8 0, i32 198, i8* getelementptr inbounds ([24 x i8]* @module_name, i64 0, i64 0))
872 42 store i32 1, i32* @":reduced_elab3(test):_proc__state.0", align 8
873 43 ret void
874 44 }
875
876 Where something goes wrong is line 29, I guess.
e89cf20 @hiyuh Update TODO.
authored
877 ppc32-linux has completely unexpected assertion, maybe "call" is broken?
878
879 ppc32-linux > nvc: tree.c:372: tree_ident: Assertion `t != ((void *)0)' failed.
880 i686-cygwin > TRACE 0ms+0: _inst_name sig=:reduced_elab3(test):x
881
882 This assertion is triggered by tree_ident() that called by fmt_sig() for TRACE()
883 in _inst_name().
884 Maybe, the given argument to _inst_name(), _sig is invalid b/c "call" is broken?
Something went wrong with that request. Please try again.