fun with C: - CompCert-compiled program segfaults - GCC-compiled program takes 300 us to run - Clang-compiled program takes 0.3 us to run
-
-
maybe? I suspect some of it is coming from Clang optimizing away a loop or something (it's a benchmark) but the CompCert divergence is... not exactly giving me a lot of confidence here.
-
Do you have a reasonably minimal example? I'm curious. (And I assume you know about http://godbolt.org , which is always so helpful)
-
Oh it's not minimal by any means lol. The code is here but I'd have to pare it down a LOT to figure out what the problem was :)https://github.com/vmchale/ats-bench …
-
Unfortunately I suspect the Clang/GCC divergence comes from the benchmarking itself... which might be hard to simplify :|
-
Can you make the compiler generate a single standalone C file? If it's a benchmark, it should be possible to zoom into the loop, and ignore the rest.
-
Yeah, it gives a nice big 10000 line file :o. I'm trying to hopefully work it down to a smaller example.
-
is the C file accessible directly somewhere?
-
nope, but if you build it should put it in `.atspkg/c/test/bench.c` if you really want lol
- 1 more reply
New conversation -
-
-
You seem to be right. Compiling with GCC/Clang and -O0 also causes an immediate segfault. Weird.
-
So an ATS compiler bug then?
-
Not sure! I have some included C, and it mostly binds to libc. But it definitely seems most likely.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.