The patch looked promising, but I'm sorry to say that it made no difference.
Is there a way of dumping out the generated instructions? Not that I understand assembly code (esp not arm64) but it might be of help to someone else. Thanks - Eric On Sat, Dec 20, 2025 at 11:56 AM Herman ten Brugge <[email protected]> wrote: > Try attached patch. > > I found some more bugs on other targets as well. > > Herman > > On 12/20/25 19:51, Eric Raible wrote: > > The "tcc -run" is irrelevant - I shouldn't have mentioned that. > The intent was to make the test case easy to reproduce. > > The bug I'm trying to report seems to be libtcc-specific. > I see the same thing when compiling to executable: > > tcc tcc-libtcc-address-bug.c -ltcc && ./a.out > clang tcc-libtcc-address-bug.c -ltcc && ./a.out > gcc tcc-libtcc-address-bug.c -ltcc && ./a.out > > In all cases test1() works but test2() dereference random values > (run-to-run return value is usually different and sometimes it crashes). > > For the record, I build in a subdirectory, after: ../configure > --source-path=/home/raible/tinycc > BTW this is not blocking me in any way but I did find it so I thought I'd > report it. > > Thanks - Eric > > > On Sat, Dec 20, 2025 at 12:55 AM Herman ten Brugge via Tinycc-devel < > [email protected]> wrote: > >> On 12/19/25 22:29, Eric Raible wrote: >> >> This is a libtcc issue: gcc and clang behave the same way. >> >> // libtcc mangles casts of hard-coded pointer values// Run with: tcc -run >> tcc-libtcc-address-bug.c// The 2nd call to 'test()' produces incorrect >> results, and often crashes with SIGSEGV.//// tcc version 0.9.28rc 2025-12-15 >> mob@85694274 (AArch64 Linux)// uname -a => Linux penguin >> 6.6.88-08646-g082267a5c5ac #1 SMP PREEMPT Fri, 29 Aug 2025 06:42:16 -0700 >> aarch64 GNU/Linux >> >> Did you configure tcc with '--disable-static'? >> Without this you will overwrite the tcc_new() of the current code. >> >> Herman >> _______________________________________________ >> Tinycc-devel mailing list >> [email protected] >> https://lists.nongnu.org/mailman/listinfo/tinycc-devel >> > >
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
