Dani (:cxx: modules addict) · @DanielaKEngert
318 followers · 1023 posts · Server hachyderm.io

@PeterSommerlad It does.

In this particular case, MSVC rejects one version of invalid code and incorrectly accepts the other. And I even totally understand why: the Modules TS had a different grammar.

Both Clang and gcc are even worse: they accept *both* ill-formed variants. And they don't have the "legacy" excuse.

#clang #gcc #msvc

Last updated 1 year ago

Kevin Karhan :verified: · @kkarhan
1490 followers · 108400 posts · Server mstdn.social

@argv_minus_one @retronianne and even the are replaceable - and that is a good thing.

In fact if / support would be where it should be, I'd even ditch for OS/1337...

os1337.com/

#os1337 #gcc #llvm #clang #GNUtils

Last updated 1 year ago

Javier Salcedo · @javier_salcedo
50 followers · 551 posts · Server mastodon.gamedev.place

My inner “clean” coder is very happy to see that making an already small function even smaller made it x4 faster because GCC started to inline it (“Other lessons learned” section).

On the other hand this is something I wouldn’t have expected and it horrifies me.

codingnest.com/the-little-thin

#cpp #gcc #cleancode

Last updated 1 year ago

Felix Palmen 📯 · @zirias
56 followers · 229 posts · Server techhub.social

@alexr If some "irrelevant" bits in some pointers used by the compiler at runtime change the compiled code, that's some strange compiler bug. Not that they're unheard of, sure, but I now see your question boils down to whether using the kernel instead of would trigger bugs in .

Again, checking this would be a *huge* amount of work. You might think you could at least compare the object-code files easily, but even these are influenced by library headers, they might pull in types with sizes changed between versions, they might even use conditional compilation based on library versions, etc (and yes, that's all "changed compiler input").

To really do this check reliably, you'd have to create the exact same toolchain and used libraries on both systems.

I'll rather focus on getting more software to build/work, so I can finally test some closed-source software... time is limited 😉

#freebsd #linux #gcc

Last updated 1 year ago

Giovanni Crisalfi · @gicrisf
87 followers · 323 posts · Server fosstodon.org

I never wrote Assembly in my life, but tonight (for some reason) I thought of disassembling simple C code snippets with Ghidra. So, I started with a hello world and was very surprised to find a much more extensive and complex result compared to my original assembly (obtained with GCC).

I mean, it's a Hello World!

#ghidra #gcc #clang #assembly #asm

Last updated 1 year ago

Free Software Foundation · @fsf
23650 followers · 7637 posts · Server hostux.social

Assigning your copyright to the FSF helps defend the GPL and keep software free. Thanks to Gene Goykhman, Sergey Alexandrovich Bugaev, Wang Diancheng, Warren Thomas Everett Wilkinson, and Xinyuan Zhang for assigning their copyright to the FSF! Learn more at u.fsf.org/3ht

#gnu #emacs #glibc #gdb #gnustep #gnuhurd #gnumach #gcc #CopyrightAssignments

Last updated 1 year ago

Sherifa Zuhur · @Sherifazuhur
1126 followers · 5842 posts · Server sfba.social

#gcc

Last updated 1 year ago

Skyglobe · @skyglobe
42 followers · 608 posts · Server hostux.social

I love that they put "usually" in this sentence:

"Humans usually are not as good writing machine code as they are at writing Fortran"

--
About GNU Fortran

gcc.gnu.org/onlinedocs/gcc-13.

#gcc #gfortran #fortran

Last updated 1 year ago

ilias :night_ablobcat_wink: · @DM_Ronin
294 followers · 110 posts · Server mstdn.social

Nicely written article about compiler's optimisation tricks, particularly with pointers

"GCC always assumes aligned pointer accesses" trust-in-soft.com/blog/2020/04

#gcc #Programming #C #Embedded

Last updated 1 year ago

Felix Palmen 📯 · @zirias
46 followers · 201 posts · Server techhub.social

Added these symlinks.

needs some "convincing" to install *everything* to /usr, but it works.

It solves the issue on and (which both install the program interpreter to /lib by default).

It does NOT solve the issue on , where the program interpreter is installed to /lib64, but *something* during build insists on finding it in /usr/lib instead. 🤯

Trying a hack with a hardlink now (after learning that glibc's ldconfig just deletes symlinks to the program interpreter).

#glibc #aarch64 #i386 #amd64 #gcc

Last updated 1 year ago

Felix Palmen 📯 · @zirias
45 followers · 198 posts · Server techhub.social

And I still have NO idea where these errors regarding the ELF program interpreter come from when building and its libstdc++. They do NOT appear in the build log, they are somehow just spit to the controlling terminal of . And I didn't find anything not working in these packages so far ... 🤯

#gcc #poudriere

Last updated 1 year ago

comex · @comex
2400 followers · 714 posts · Server mas.to

Compilers Mastodon, does anyone know of examples where major C compilers exploit UB of misaligned loads/stores to produce silent misbehavior?

That's excluding
- Generating instructions that trap if misaligned (e.g. x86 movdqa), because that's not silent.
- Exploiting code that does more than just making misaligned loads/stores, such as calling __builtin_assume_aligned.

(cc @regehr... hmm, who else should I cc. I wish Mastodon had search. )

#gcc #llvm #compilers

Last updated 1 year ago

Sergei Trofimovich · @trofi
65 followers · 111 posts · Server fosstodon.org

Today's `gcc` bug gcc.gnu.org/PR111051 is a case where `gcc` stopped recognizing some `avx2` primitives on `avx512` code (all on `highway-1.0.6` code again):

<immintrin.h>

GCC target("avx512vl,avx512dq")

void bug(__m256i i) {
volatile auto v1 = _mm256_cvtepi64_pd(i);
}

and failed as `error: inlining failed in call to 'always_inline' '__m256d _mm256_setzero_pd()': target specific option mismatch`

#include #pragma #gcc #bug

Last updated 1 year ago

Sergei Trofimovich · @trofi
65 followers · 111 posts · Server fosstodon.org

Today's `gcc` bug is gcc.gnu.org/PR111048 where `gcc` generated wrong code for `highway-1.0.6` library in `-mavx2` mode.

When handling the following loop:

u8 in_lanes[32];
for (unsigned i = 0; i < 32; i += 2) {
in_lanes[i + 0] = 0;
in_lanes[i + 1] = ((u8)0xff) >> (i & 7);
}

`gcc` broke `i =12` iteration and instead of `i[13] = 0xf;` (`0xff >> 4`) stored something like `i[13] = 0xef;` there.

#gcc #bug

Last updated 1 year ago

Lawrence Murray · @lawmurray
170 followers · 137 posts · Server fosstodon.org

This idea of instantiating C++ templates with std::variant turns out to be more complicated than I thought once compiler optimizations are enabled, but function attributes provide the fix. The example code now looks like this. Full write up here: indii.org/blog/revisited-combi

#cpp #cplusplus #programming #clang #gcc

Last updated 1 year ago

Tunahead · @Neurodancer
16 followers · 244 posts · Server mstdn.social

Heute hab ich mal wieder gelernt, das ich nichts weiß.

...werde ich es genauer erklären? Nein.

#ARM #gcc #makefile #C

Last updated 1 year ago

Felix Palmen 📯 · @zirias
42 followers · 194 posts · Server techhub.social

How often do you have to build to have a *native* version for when building on ?

The answer is: 3 times. First a minimal cross-version without , required to actually *build* glibc. Then, a "full" cross-version using that glibc. And finally, using this full cross-version, the *native* version.

How often do you have to build GCC to find and fix issues in your FreeBSD ports for these 3 stages? The answer is: *countless* times. And it really takes time to build 😞

#gcc #linux #freebsd #glibc

Last updated 1 year ago

Felix Palmen 📯 · @zirias
42 followers · 194 posts · Server techhub.social

@thindil That's what I assume as well, once I'm done with the toolchain, architecture-specific differences should be rare (if encountered at all). 🙏

Just finished the cross-version of for all archs. Two more ( and ) to go for the FULL cross-toolchain. That will be the goal for today, the native toolchain maybe tomorrow 😎

#glibc #binutils #gcc

Last updated 1 year ago

Felix Palmen 📯 · @zirias
42 followers · 194 posts · Server techhub.social

Well ... no, building with didn't help.

Turns out the issue were relocation types. I have no idea why needs them *just* to build the headers (which is all I need for , cause the actual will *still* be ), but yep, one type is named slightly differently: R_X86_64_JUMP_SLOT on Linux, R_X86_64_JMP_SLOT on FreeBSD. It has the same value, 7, so for now I just hardcoded it in the port Makefile for the Linux headers. 🙈 (hey, it works 🤷‍♂️)

#gcc #elf #linux #linuxulator #kernel #freebsd

Last updated 1 year ago

Felix Palmen 📯 · @zirias
39 followers · 183 posts · Server techhub.social

Trying to get this to the other archs supported by 's (amd64 and i386), I'm hitting yet another wall: headers fail to build there. Oh freakin hell, I expected to do quite some adaptions to support all 3 archs, but I didn't expect it to fail at *this* stage 🤯

Already tried to understand what happens in Linux' build system. Well, it's not exactly easy to understand 🙄

Shot in the dark, trying it with (instead of the base ) now... (which will take a while cause my test machine has to *build* this gcc first, bah ....)

#freebsd #linuxulator #linux #gcc #clang

Last updated 1 year ago