Live data from Hacker News

GCC 16 has been released

gcc.gnu.org

41–50 of 54 posts

Re: GCC 16 has been released

#41
post #34

Noob question - Does gcc use LLVM anywhere under the hood or it has its own code generation and optimization pipeline? How does it stack in comparison to LLVM?

Let me wikipedia that for you :-) Like people mentioned already, gcc predates LLVM by quite some years, ie. Wikipedia mentions March 22, 1987 for gcc, while LLVM's initial release was 2003.

A big difference between the 2 is also the license. GCC uses the GPL while LLVM uses Apache License, hence the projects don't share code.

Re: GCC 16 has been released

#42

I tried the unstable sources for a while, in the last ~3 months. I ran into some issues with some programs (could not compile them with recent GCC, but older GCC worked fine), so gcc 15.x works better for me in general (presently) - but from, say, +3000 programs to compile, the vast majority works well, and a few may need patches (which can often be found in LFS/BLFS by the way, they often use sed instructions to fix…

Did you file any bug reports for them?

Re: GCC 16 has been released

#43

Earlier quoted context omitted.

No, you're not. You're allowed to access any type via a char buffer. But the converse is not true (quoting https://eel.is/c++draft/expr#basic.lval-11 ): > An object of dynamic type Tobj is type-accessible through a glvalue of type Tref if Tref is similar ([conv.qual]) to: Tobj, a type that is the signed or unsigned type corresponding to Tobj, or a char, unsigned char, or std :: byte type. If a program attempts to acc…

I’m not a language lawyer but i think the part you are missing is about “type establishment”. (Is this a C vs C++ thing?) Malloc returns a buffer and then you cast it to the type you want. Similarly for all memory allocators. Punning the same region of char buffer as two different types is a bit different.

This gets to the heart of effective type rules, which are complex, confusing, and not properly implemented by compilers. C and C++ definitely diverge here, because C is less ambitious in its object model (which mean it just simply leaves so many details about it undiscussed).

Malloc returns memory that is uninitialized and has no type. The effective type of that memory is initialized on first use by C, whereas C++ relies on angelic nondeterminism to magically initialize the type at return type to whatever will work in the future.

Re: GCC 16 has been released

#44
post #21
post #18

Earlier quoted context omitted.

The Linux kernel is another example. The 2.5 development cycle (which led to the stable 2.6 series) was brutally long, and distros resorted to back-porting new features into their own kernels based on the stable 2.4 series that they provided to their users, creating all kinds of excitement. After 2.6.0 was released, Linus basically went nope, not gonna do that again.

Are there any large projects that are older than 25 years that didn't go through that? The time based release thing as been recommended for about 25 years (can anyone get real data?), so newer projects may just be using it without knowing the pain, but for older projects it seems like they all went through it at least once.

Arguably Perl. And it also shows the real risk of sidelining everything for one big bang release.

I think they are just now back on to a regular release cadence, but they weren't for a long time.

Re: GCC 16 has been released

#45
post #40
post #34

Noob question - Does gcc use LLVM anywhere under the hood or it has its own code generation and optimization pipeline? How does it stack in comparison to LLVM?

GCC far far far predates LLVM. They do not share code.

The libsanitizer library is imported from the LLVM sources into the GCC source tree. There are probably more examples of code sharing. Both projects are quite large.

Re: GCC 16 has been released

#46
post #34

Noob question - Does gcc use LLVM anywhere under the hood or it has its own code generation and optimization pipeline? How does it stack in comparison to LLVM?

The other answers (NO!) are correct, but... there was a gcc plug-in to use the llvm backend with gcc. Apple used llvm-gcc (circa 2012; gcc front end, llvm back end) while transitioning from gcc to llvm.

https://dragonegg.llvm.org

Re: GCC 16 has been released

#47
post #45
post #40

Earlier quoted context omitted.

GCC far far far predates LLVM. They do not share code.

The libsanitizer library is imported from the LLVM sources into the GCC source tree. There are probably more examples of code sharing. Both projects are quite large.

I would assume the code sharing is one-way only due to the licenses. I.e. a GPL project can use MIT licensed code, but not vice versa (AFAIK).

Re: GCC 16 has been released

#48

Earlier quoted context omitted.

No, you're not. You're allowed to access any type via a char buffer. But the converse is not true (quoting https://eel.is/c++draft/expr#basic.lval-11 ): > An object of dynamic type Tobj is type-accessible through a glvalue of type Tref if Tref is similar ([conv.qual]) to: Tobj, a type that is the signed or unsigned type corresponding to Tobj, or a char, unsigned char, or std :: byte type. If a program attempts to acc…

If the type is an implicit-lifetime type, then you can legally create an unsigned char array, and then reinterpret_cast a pointer to that to a pointer to the type. See https://eel.is/c++draft/intro.object#def:object,implicit_cre... . https://eel.is/c++draft/intro.object#15 is an example showing this with malloc; the subsequent paragraph further permits it to work with an unsigned char array.

1. You still need std::launder in that case.

2. It doesn't initialize the object that is implicitly created, even if the storage has initialized chars.

Re: GCC 16 has been released

#49
> The so-called "json" format for -fdiagnostics-format= has been removed in this release. Users seeking machine-readable diagnostics from GCC should use SARIF.

But:

> GCC can now output diagnostics in HTML form via -fdiagnostics-add-output=experimental-html

I wonder what drove the decision to remove JSON output and add HTML output?

Re: GCC 16 has been released

#50
post #49

> The so-called "json" format for -fdiagnostics-format= has been removed in this release. Users seeking machine-readable diagnostics from GCC should use SARIF. But: > GCC can now output diagnostics in HTML form via -fdiagnostics-add-output=experimental-html I wonder what drove the decision to remove JSON output and add HTML output?

It looks like SARIF is JSON, with a formal schema. I'm guessing the JSON they used to output used their own, non-standard schema.
Post reply on HN