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: Thu, 27 Jun 2024 15:45:59 -0700 Organization: None to speak of Lines: 39 Message-ID: <87pls2xavs.fsf@nosuchdomain.example.com> References: <20240624160941.0000646a@yahoo.com> <667af5ce$0$2873002$882e4bbb@reader.netnews.com> <874j9gu6fu.fsf@nosuchdomain.example.com> <87zfr7s5yn.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 28 Jun 2024 00:46:00 +0200 (CEST) Injection-Info: dont-email.me; posting-host="6806d4f1a7ac43603fc89328bbed09d0"; logging-data="3098489"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kqYGFUx4p9oQB6yqwJeZM" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:c33bD42fP8CP23b7t3wOtAc2i8A= sha1:YGIMgurSjZT3mUyL18e+YWGJfds= Bytes: 3155 Keith Thompson writes: > 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. I got a reply from Matt Godbolt. The assembly listing is objdump output. The web client filters it and displays it as if it were regular output. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */