3 ms·
It's not great news. GCC is basically better in every way. People promote Clang because it has a permissive license and opens the door for Google and Apple to
by otabdeveloper2 7y ago
It's not great news. GCC is basically better in every way.
People promote Clang because it has a permissive license and opens the door for Google and Apple to inject proprietary crap into Linux.
- justinclift 7y agoDoes GCC have a decent WebAssembly backend? Looking around just now, there's what seems like an initial experiment from someone, but it doesn't seem to have gone anywhere. :( https://sourceware.org/ml/binutils/2017-03/msg00044.html https://sourceware.org/ml/binutils/2017-03/msg00044.html Asking because with the LLVM 8.0.0 release (a few months ago) it's one of the standard supported architectures.
- viraptor 7y ago> opens the door for Google and Apple to inject proprietary crap into Linux This doesn't make sense. You can compile proprietary code with gcc without problems already. Clang doesn't enable anything new here.
- rurban 7y agoNo, GCC has serious shortcomings in certain areas. -flto=thin is better, autofdo/bolt is better, the jit is better, but the most important point are C constexpr which are implemented as in C++, but with GCC you cannot decide at compile-time if a constexpr is constant, so it misses out on many optimizations. It only has _Static_assert, but no usable __builtin_constant_p. With GCC it errors at compile-time, with clang it returns 0. clang also has diagnose_if, e.g. to match user-defined compile-time warnings with user-defined run-time warnings. e.g. the clang memcpy can be 100x faster than the gcc memcpy, when the size and alignment is known. And gcc-9 added serious regressions on some platforms, that you need to blacklist it. gcc-10 probably not being better.
- astrange 7y agoWhere do clang and gcc implement memcpy? That's part of the C library.
- BurningCycles 7y agoI have to disagree, -flto=thin is faster in compile time, but in performance I get better results with -flto=n in GCC. Also with FDO I get better results with GCC over Clang/LLVM, my main test subjects are rendering (Blender), archivers, encoders and emulation. However with straight up -O2/-O3 I very often get better performance with Clang/LLVM. I haven't benchmarked on ARM though, my results may be very different there.