GCC 13.1 is out - Page 1
Forum section: electronics / general

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 29, 2023, 01:07:30 am
content: So I tried building it.I was kind of "looking forward" (well, that's probably too strong a word) to testing the Modula-2 front-end, but it fails to build on my platform.The culprit is there, in gcc/m2/mc-boot/GDynamicStrings.cc :Code:static void writeAddress (void * a){writeLongcard ((long unsigned int ) (a));}Nice one, isn't it?

author: brucehoult
author_rank: Super Contributor
timestamp: April 29, 2023, 02:41:39 am
content: I saw the Modula 2 announcement. 40 years later....Kind of interesting, but it's just a stepping stone on the way to Modula-3 on the one hand and Oberon on the other.As for the error ... I guess assuming long is the same size as a pointer is almost as bad as assuming int is. uintptr_t, anyone?Hmm ... IL32LLP64 or IP16L32 ? I don't think anyone has made an IP32L64 platform.Win64 seems more likely than PDP-11 :-)

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 29, 2023, 02:59:37 am
content: I'm just guessing this piece of code may have been pretty old, probably pre-C99, and was never refactored. It's unfortunate that it made it to GCC mainline, but oh well. I opened a ticket on bugzilla.The Modula-2 front-end is GNU Modula-2 that got finally included as an official front-end. It has been a relatively active development for years.Modula-3 is under "active" development as well, but given the very limited success it had, it probably will never make it to GCC. The fact gm2 was a GNU project probably helped a bit, here.https://github.com/modula3/cm3Many people may not know that Modula-2 has been used extensively in some areas, for instance in the russian aerospace industry. Current GLONASS satellites run on Modula-2 code, for instance. Not unlikely that there may be Modula-2 code in the Soyuz spacecrafts and rockets.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 29, 2023, 03:36:42 am
content: I thought I would have logically had more luck building it for arm32. Indeed this one above doesn't pose a problem here, but I ran into another compile error, in gm2 libs this time.Oh well. Maybe they rushed it a little bit.

author: eutectique
author_rank: Frequent Contributor
timestamp: April 30, 2023, 06:05:06 pm
content: Quote from: SiliconWizard on April 29, 2023, 02:59:37 amModula-2 was popular at one of the Soviet nuclear facilities. It was running on "Electronica 60" (LSI-11 clone) controlling ion mass spectrometers. Software development was done on SM-1420, clone of PDP-11/45.

author: DiTBho
author_rank: Super Contributor
timestamp: April 30, 2023, 08:39:11 pm
content: yeah, it's frustrating, I know, and trying to integrate ADA-core is even more frustrating, especially on non-x86 machines.damn, compiling my-c (even from gcc) is much faster and easier than compiling gcc from itself.Plus, if gcc-v12 has a catastrophic end on my mips tiny router (because it eats too much memory and provides ZERO clues), gcc-v13 is even worseWhen you see all of these "difficulties" with a compiler, when you see it take 20 years to "add" a valid language and still it has integration problems, well it's when you feel that there must be something wrong in computer science.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 01, 2023, 02:46:49 am
content: Quote from: DiTBho on April 30, 2023, 08:39:11 pmThere is something "wrong", but I don't know if we can blame "computer science" per se. All this is just the result of software systems being very complex really quick, and no amount of silver bullets (and there have been many over the last decades) have really been able to mitigate this.But I'm 100% in favor of simpler, in-house tools just like you did, when it's possible. It lowers the overall complexity of your projects dramatically (even if there's a steep curve in the beginning to develop said tools.)Something as complex, multi-target and multi-platform as GCC, with a relatively old architecture now (so probably not *initially* designed to become this versatile) is very difficult to maintain, and it's already almost a miracle that it support this many environments, even if building it is sometimes challenging (to impossible.)Regarding GCC 13 in particular, I've tried building it for different targets and different hosts and got issues in almost all cases. Hadn't run into this with GCC for years. This one version seems to have the most changes GCC had in a long time.

author: DiTBho
author_rank: Super Contributor
timestamp: May 01, 2023, 10:44:02 am
content: Quote from: SiliconWizard on May 01, 2023, 02:46:49 amCode:. aarch64-unknown-linux-gnu-6.5.0 aarch64-unknown-linux-gnu-9.3.0 * armv5tel-softfloat-linux-gnueabi-6.5.0 * armv5tel-softfloat-linux-gnueabi-9.3.0 armv7a-unknown-linux-gnueabihf-6.5.0 armv7a-unknown-linux-gnueabihf-8.4.0 armv7a-unknown-linux-gnueabihf-9.3.0 * hppa-unknown-linux-gnu-6.5.0 hppa-unknown-linux-gnu-9.3.0 * hppa64-unknown-linux-gnu-6.5.0 hppa64-unknown-linux-gnu-9.3.0 * i686-pc-linux-gnu-4.9.4-gnat2016 i686-pc-linux-gnu-6.5.0 i686-pc-linux-gnu-7.3.1-gnat2018 i686-pc-linux-gnu-7.5.0 i686-pc-linux-gnu-8.3.1-gnat2019 i686-pc-linux-gnu-8.4.0 i686-pc-linux-gnu-9.3.0 * i686-pc-linux-gnu-10.2.0 mips-unknown-linux-gnu-4.1.2-legacy mips-unknown-linux-gnu-4.5.3-legacy mips-unknown-linux-gnu-6.5.0 mips-unknown-linux-gnu-9.3.0 * mips64-unknown-linux-gnu-6.5.0 mips64-unknown-linux-gnu-9.3.0 * mipsel-unknown-linux-gnu-4.5.3-legacy mipsel-unknown-linux-gnu-6.5.0 mipsel-unknown-linux-gnu-9.3.0 * powerpc-unknown-linux-gnu-6.5.0 powerpc-unknown-linux-gnu-9.3.0 * powerpc64-unknown-linux-gnu-9.3.0 * sparc64-unknown-linux-gnu-6.5.0 * sparc64-unknown-linux-gnu-9.3.0 x86_64-pc-linux-gnu-10.2.0 * x86_64-pc-linux-gnu-12.0.0 *v12 and v13 fail on Catalyst and/or don't correctly work (see my topic about Gcc-v12 on mipsel ... still unsolved), so this is currently my working environment for production, and there are tons of patches applied, some are architecture-{ target, host }-specific.Since gcc >=v4.1.2, I haven't seen the situation improve, but on the contrary, I see things getting messed up at every new release.OK, here's a Gentoo problem with ebuilds, eclasses and EAPIs, and policies (e.g. we don't wantlanguage+=ada, nor do we wantlanguage+=modula2, onlylanguage=c, c++, fortran) ...... but hey? thesys-devel/gcc-*ebuildsare - always have been - the hardest in the world to maintainwith still so critical that it even has two dedicated eclasses to build and make sure it is built correctlyand despite everything and after 13 big releases gcc still needs a laaaarrrrgggggeeeee number of patchesthat are constantly being requested to "tame" or "cheat" the host environmentcross-compiling gcc is ... frustrating (indeed I native compile it under QEMU/$arch)adapting gcc is ... frustrating (indeed I savagely hack it)getting your hands on it to simply move working directories or add functions is ... frustrating, and the gcc C code itself is written so bad that trying to analyze the project with Stood or AAL ... is impossible as the tool explode in thousand error messages.This is *very* frustrating on Catalyst as never know if it will fail or succeed, everything is always very random, and it's always so fail-prone that costs a lot of human power to maintain.On the top of it, I think this reflectshow badly structuregcc is as a project.GNU Gcc ---> gccnew GNU Gcc ---> ngccThey would have to re-engineer it and rewrite it from scratch, at least ... in the form of a parallel branch.

author: cfbsoftware
author_rank: Regular Contributor
timestamp: May 06, 2023, 03:25:11 am
content: Quote from: SiliconWizard on April 29, 2023, 02:59:37 amModula-2 was also used successfully for chip design.Read the chapter "The Chip Company that made $100M with MODULA-2" in the book The School of Niklaus Wirth, "The Art of Simplicity", László Böszörményi, Jürg Gutknecht, Gustav Pomberger (Eds.): Morgan-Kaufmann 2000, ISBN 3-932588-85-1QuoteGoogle books has a preview of all the pages, except one, of this chapter:https://books.google.com.au/books?id=6kHs4s-79bkC&pg=PA219

author: brucehoult
author_rank: Super Contributor
timestamp: May 06, 2023, 03:55:51 am
content: That's very cool, but the early 1980s were a loooong time ago in the chip-making world.In 1984 as a grad student at Waikato university I worked on a project to make compilers for a number of languages (some developed by students for their thesis e.g. "Peano" by Lawrence D'Oliviero) and back-ends for various machines including VAX and Z8000, all using a common intermediate language. Everything was written in Modula-2. I don't recall now whether we modified Modula's M-code as the intermediate language, or made a completely custom one. We certainly *talked* a lot about a design for our own intermediate language. M-code didn't have sufficient features for some of the languages we wanted to implement.

author: DiTBho
author_rank: Super Contributor
timestamp: May 06, 2023, 10:00:53 am
content: Quote from: brucehoult on May 06, 2023, 03:55:51 amlet's imagine that with 8086 intel went bankrupt, what if Intel x86 never existed and our PCs evolved on z8k?Modula2 on Z8K = Sweet DreamSweet Dreams are made of this.

author: cfbsoftware
author_rank: Regular Contributor
timestamp: May 06, 2023, 11:05:04 am
content: Quote from: DiTBho on May 06, 2023, 10:00:53 amNot just a dream - even in 1990:https://compilers.iecc.com/comparch/article/90-08-059

author: brucehoult
author_rank: Super Contributor
timestamp: May 06, 2023, 11:49:31 am
content: Quote from: DiTBho on May 06, 2023, 10:00:53 amZ8000 avoids some of the more ugly parts of the 8086, but it shares its problems of being essentially a 16 bit machine, with the most efficient arithmetic being on 16 bit quantities and a 64k address space plus segments.It is better than 8086 in at least having sixteen general purpose 16 bit registers vs eight weirdly specialised ones for the 8086.But the Motorola 68000 came only six months later with sixteen full 32 bit registers, and a natively 32 bit ISA including 32 bit pointers and address arithmetic (the first chip only brought out 24 address lines, of course. The 68020 brought out a full 32 bit address bus). It was also twice as fast.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 07, 2023, 08:25:02 pm
content: Just to let you know that the issue got taken care of pretty quickly after I submitted the report. So that should be fixed in the next release. (I didn't get to check the patch yet.)

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 07, 2023, 08:28:02 pm
content: Quote from: cfbsoftware on May 06, 2023, 03:25:11 amMuch later on (1995), Wirth came up with Lola (and then Lola-2), some HDL based on his programming languages (Pascal/Modula/...)