[Tinycc-devel] unexpected warning when returning from compound expression

2022-01-08 Thread Yakov
test.c - - - 8<- - - - - - - - - - - - - int f() { ({ return 0; }); } int main(int argc, char**argv) { } - - - 8<- - - - - - - - - - - - - hello the above program gives me: test.c:5 warning: function might return no value: 'f' although obviously the function will

Re: [Tinycc-devel] manually inlining functions

2021-04-30 Thread Yakov
Stone : > On Sat, 1 May 2021, Yakov wrote: > > > having to write macros for performance feels so obsolete, double > > evaluation hiding in dark corners etc. And function calls are so > > expensive in tight loops. > > Calls are fairly cheap, on modern architec

Re: [Tinycc-devel] manually inlining functions

2021-04-30 Thread Yakov
} int main() { int T; T = time1000(); test_loop(); T = time1000() - T; printf("<%i ms test_loop>\n", (int)T); } сб, 1 мая 2021 г. в 10:51, Elijah Stone : > On Sat, 1 May 2021, Yakov wrote: > > > having to write macros for performance feels so obsolete, d

Re: [Tinycc-devel] manually inlining functions

2021-04-30 Thread Yakov
: > > Yakov wrote: > > > Manual inlining seems to be a straightforward thing, just clone the > > node into the ast and rename all variables to something unique so I > > thought maybe that's what tcc supports with some pragma or what not. > > If you create such a tool which ca

[Tinycc-devel] manually inlining functions

2021-04-30 Thread Yakov
I know TinyC does not optimize (that's why it's fast and that's what I love) but having to write macros for performance feels so obsolete, double evaluation hiding in dark corners etc. And function calls are so expensive in tight loops. Is there a way in Tiny to tell the compiler always to inline

[Tinycc-devel] __LINE__ and #line undelying type

2021-04-15 Thread Yakov
I remember #line was limited to 65535 on tcc recently, but now it is limited to 294967295 (max int32), when this was changed? Also I think it should be 42949672965 instead (max uint32) as in GCC and Clang. ___ Tinycc-devel mailing list

[Tinycc-devel] crash with -b

2021-04-04 Thread Yakov
this coredumps with latest pull from mob if compiled with -b on ubuntu 20. took me half a day to boil it down from my large program. 8< - #include #include void mm(char *d, const char *s) { d[0] = s[0]; } int main(int argc, char**argv) { char *b =

Re: [Tinycc-devel] zero length last member

2021-02-23 Thread Yakov
gt; > Are you running the latest version? What architecture are you on? Your > code compiles and runs without issue on my machine (amd64 linux, latest > git). > > On Tue, 23 Feb 2021, Yakov wrote: > > > https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html > > > > I

[Tinycc-devel] zero length last member

2021-02-22 Thread Yakov
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html I have tried the last zero length member extension in tcc and compilation succeeded but the program crashes, is this a bug or a different implementation? Btw if you do not know this is a super useful extension. typedef struct { int size;

[Tinycc-devel] MacOS anyone?

2019-01-13 Thread Yakov
What's the current state of affairs with tcc on mac? I can't either find the working compiler nor the explanation on why it is not found. There must be something to proprietary binary format prolly. Please share if you know anything. ___ Tinycc-devel

[Tinycc-devel] getting debug info for stack dumps

2018-05-25 Thread Yakov
Hi, I am using TCC as a backend for another programming language (my own), I need a stack trace functionality. I already ranted that backtrace and backtrace_symbols do not work with TCC for me, so I ended up writing my own backtrace() to get a list of return adresses, and then I am calling

Re: [Tinycc-devel] TCC and ARM instruction set

2018-05-07 Thread Yakov
I read OP's question differently, it seemed he wanted to know more about the intrinsics of TinyCC in regards to various instruction set supports rather than to know more about ARM technology in general? OR maybe "how advanced is the support of ARM in TCC"? If it was worded as "how do you add a new

[Tinycc-devel] #line directive with file name

2018-04-12 Thread Yakov
It works as expected for GCC, but TinyC will always print prog.c ignoring the argument. Latest tcc from git. Ubuntu. x86_64. Musl. (Because GNU LibC does not work with addr2line). Thanks, Yakov ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org ht

Re: [Tinycc-devel] backtrace() on Linux

2018-03-09 Thread Yakov
_start_main+0xf0) [0x7fe80c15c830] ./gcc-bt(main+0xe) [0x400a03] ./gvc-bt(a+0xe) [0x4009f2] ./gcc-bt(b+0xe) [0x4009e1] ./gcc-bt(c+0xe) [0x4009d0] ./gcc-bt(show_bt+0x2e) [0x400944] 2018-03-09 17:24 GMT+05:45 Yakov <exeb...@gmail.com>: > Just installed 0.27, issue stands. > > > 2018

Re: [Tinycc-devel] backtrace() on Linux

2018-03-09 Thread Yakov
Just installed 0.27, issue stands. 2018-03-09 15:25 GMT+05:45 Yakov <exeb...@gmail.com>: > I had to write this code to be able to get the stack trace under TinyC: > > > #ifdef __TINYC__int backtrace(void **buffer, int size) { > extern uint64_t *__libc_stack_end; >

Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

2018-03-09 Thread Yakov
Quick search gave me these links: https://github.com/graalvm/sulong https://www.infoworld.com/article/3193078/java/azul-introduces-llvm-compiler-to-java-runtime.html https://stackoverflow.com/questions/4934707/is-it-possible-to-transform-llvm-bytecode-into-java-bytecode I am not a Java guy, so

[Tinycc-devel] backtrace() on Linux

2018-03-09 Thread Yakov
*#include* *#include* *void* show_bt*() {* *int* n; *void* *buffer*[**111];* *char* **strings*;* n *=* backtrace*(*buffer*,* *111);* strings *=* backtrace_symbols*(*buffer*,* n*);* *while* *(*strings *&&* n*)* printf("%s\n"*,* strings*[*n*---*1*]);* *}* *void* c*()* *{*

Re: [Tinycc-devel] backtrace() on Linux

2018-03-09 Thread Yakov
eturn i;}#endif 2018-03-09 15:24 GMT+05:45 Yakov <exeb...@gmail.com>: > > > *#include* > *#include* > > *void* show_bt*() {* > *int* n; > *void* *buffer*[**111];* > *char* **strings*;* > n *=* backtrace*(*buffer*,* *111);* > strings *=*

[Tinycc-devel] Get addr2line working with TinyCC

2018-02-24 Thread Yakov
] exec(obj_serialize+0x120) [0x41577e] exec(main+0x2e8) [0x41716a] $ addr2line -e exec 0x41716a -i -p -s -f main at ??:? --- Any idea why I get ??:? instead of a line number? Thank you, Yakov ___ Tinycc-devel mailing list Tinycc-devel