Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Baby X is bor nagain Date: Wed, 26 Jun 2024 15:18:56 -0700 Organization: None to speak of Lines: 34 Message-ID: <87zfr7s5yn.fsf@nosuchdomain.example.com> References: <20240624160941.0000646a@yahoo.com> <667af5ce$0$2873002$882e4bbb@reader.netnews.com> <874j9gu6fu.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 27 Jun 2024 00:18:57 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2dc86e450632c25820fa91c1ec368267"; logging-data="2469342"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RigPSm9YmX2WaUqmhcKDF" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:Ac9pwBSr91ETdD/O1+pWEmF3j0k= sha1:jd31xo/QInnFAoR6tcbbqxI/sGw= Bytes: 2898 David Brown writes: > On 25/06/2024 22:13, Keith Thompson wrote: >> DFS writes: >> [...] >>> Can you use tcc to generate assembly from a .c source file? >>> >>> similar to: >>> >>> $ gcc -S sourcefile.c >> No, tcc has no such option. >> I was able to get an assembly listing by running `tcc -c >> sourcefile.c` >> followed by `objdump -d sourcefile.o`. > > has tcc on its list of C compilers, and it shows > the generated assembly. I don't know how it does this - perhaps using > this same method. If people are interested in looking at the code > generated by tcc (or vast numbers of other compilers, versions and > targets), then godbolt is usually the easiest way to get it. > > And if anyone wants to know how they get the nice assembly out of the > compilers, the source code for godbolt is also freely available. https://godbolt.org/z/3b18qno37 The assembly listing doesn't look like objdump output, and the output window on the lower right looks like tcc itself generated "/app/output.s". A quick look at the source code was unhelpful. I've emailed Matt Goldbolt and asked him about this. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */