Re: C++ exception handling on PPC with gcc 6.4.0 doesn't work

2024-06-26 Thread Dave Horsfall
In this case, I was running Unify (an old RDBMS) on a 386, and it kept failing in mysterious ways. So, I bought a book on programming the 386 (ugh!), inspected the assembler code before and after "-O", and noticed that a crucial instruction had been optimised right out of existence... Hey,

Re: C++ exception handling on PPC with gcc 6.4.0 doesn't work

2024-06-25 Thread Richard L. Hamilton
Optimizers definitely are not perfect. Making alterations for efficiency that are always identical in well defined meaning to the original code is bound to be difficult to get right. Think of it as a challenge on the order of translating poetry in a way that preserves all of meaning,

Re: C++ exception handling on PPC with gcc 6.4.0 doesn't work

2024-06-25 Thread Dave Horsfall
On Tue, 25 Jun 2024, Andreas Falkenhahn wrote: [...] > So the good news is that I've found a workaround. Turning the optimizer > off will make exceptions work again but the bad news is that of course > it looks like there is some major issue in the optimizer because > enabling it seems to

Re: C++ exception handling on PPC with gcc 6.4.0 doesn't work

2024-06-25 Thread Andreas Falkenhahn
I've done some more investigation and actually, generally speaking C++ exceptions do seem to work on PPC but for some reason not always. I experienced some rather strange behaviour, e.g. // this throw() worked correctly throw(0); if (_config->isInited) return {}; // this throw() didn't

Re: C++ exception handling on PPC with gcc 6.4.0 doesn't work

2024-05-27 Thread Ken Cunningham
do exceptions work with the default gcc7 compiler? K

C++ exception handling on PPC with gcc 6.4.0 doesn't work

2024-05-19 Thread Andreas Falkenhahn
I'm using gcc-mp-6 (MacPorts gcc6 6.4.0_0) from 2017 on a PowerPC MacOS system 10.5. For some reason, using C++ exceptions doesn't seem to work with the compiler. Whenever my program tries to throw an exception, it just hangs and I need to use Ctrl-C to kill it. Are C++ exceptions generally