Here is a small program that shows how bounds check fails with literals too, due to what we've been discussing do far:
../tcc -B.. -I.. -I.. -I../include -b -DCONFIG_LDDIR="\"lib\"" -DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -b -DCONFIG_LDDIR="\"lib\"" -DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -b -DCONFIG_LDDIR="\"lib\"" -DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -b -run bcheck-test.c
Runtime error: bad pointer in strlen()
at 0xb75037a0 __bound_strlen()
../libtcc.c:1452: by 0xb74fb232 tcc_set_lib_path() (included from ../tcc.c)
../libtcc.c:1880: by 0xb74fc1b9 tcc_parse_args() (included from ../tcc.c)
../tcc.c:355: by 0xb74fd411 main()
By the way on my linux 32 bits it always never pass make test because of bounds check others pass fine when using "make test -i":
make test
make -C tests test 'PROGS_CROSS=x86_64-linux-gnu-tcc i386-w64-mingw32-tcc x86_64-w64-mingw32-tcc arm-linux-fpa-tcc arm-linux-fpa-ld-tcc arm-linux-gnu-tcc arm-linux-gnueabi-tcc c67-tcc'
make[1]: Entering directory `/home/mingo/dev/tinycc-dad/tests'
------------ hello-exe ------------
../tcc -B.. -I.. -I.. -I../include ../examples/ex1.c -o hello || (../tcc -vv; exit 1) && ./hello
Hello World
------------ hello-run ------------
../tcc -B.. -I.. -I.. -I../include -run ../examples/ex1.c
Hello World
------------ libtest ------------
./libtcc_test lib_path=..
Hello World!
fib(32) = 2178309
add(32, 64) = 96
------------ test3 ------------
../tcc -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib\"" -DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib\"" -DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib\"" -DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -run tcctest.c > test.out3
Auto Test3 OK
------------ test1b ------------
../tcc -B.. -I.. -I.. -I../include -b -run tcctest.c > test.out1
--- test.ref 2014-03-30 09:47:52.834804132 +0100
+++ test.out1 2014-03-30 10:01:30.806812775 +0100
@@ -538,7 +538,7 @@
Test C99 VLA 2 (ptrs substract): PASSED
Test C99 VLA 3 (ptr add): PASSED
Test C99 VLA 4 (ptr access): PASSED
-Test C99 VLA 5 (bounds checking (might be disabled)): PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED
+Test C99 VLA 5 (bounds checking (might be disabled)): FAILED PASSED FAILED PASSED FAILED PASSED FAILED PASSED
sizeof(int) = 4
sizeof(unsigned int) = 4
sizeof(long) = 4
make[1]: *** [test1b] Error 1
make[1]: Leaving directory `/home/mingo/dev/tinycc-dad/tests'
make: *** [test] Error 2