I think I might have an idea about the cause of this error now. If you read the CodingStyle file located at the root of tcc directory it mentions: " - Test with Valgrind to detect some uses of uninitialised values: make clean ./configure make # On Intel, because Valgrind does floating-point arithmetic differently: ( cd tests && gcc -I.. tcctest.c && valgrind -q ./a.out > test.ref ) make test TCC="valgrind -q --leak-check=full `pwd`/tcc -B`pwd` -I`pwd`" (Because of how VLAs are implemented, invalid reads are expected with 79_vla_continue.)"
This file has not been updated in 6 years, but I know for a fact that there have been some patches and fixes applied to VLAs in that time. My code does make extensive use of VLA and that might be the offending root cause here. But now I am 100% sure what the problem is. If I replace the VLA with malloc the error vanishes. So the question is up for debate: tcc generates VLA code that seems wrong in the eyes of valgrind. Though this code is not necessarily invalid. If the code is not invalid then it must be valgrind fault and not tcc. _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users