|
From: | Michael Riedl |
Subject: | Re: Fwd: gm2 frontend in gcc 14 (fedora 40) bug |
Date: | Tue, 30 Apr 2024 22:46:23 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
Gerlad, a definition like CARDINAL i,N; BEGIN N := somevalue; FOR i:=N TO 0 BY -1 DO <loop body> END; is totally OK - that is nothing other than e.g. i:=N+1; WHILE (i > 0) DO DEC(i); <loop body> END; hence I did not see a principle issue in your code ...In most of my code I use CARDINALS if the value should never be negative - only the code I sent you is using INTEGERS because of the Fortran original.
Gruß Michael Am 30.04.24 um 21:48 schrieb Gerald Kasner:
Hi Gaius, more on this...if one changes the type of the loop variables from cardinal to integer, the program runs fine. For me it, seems a conflict of types in a loop variable: In my understanding, I can count down a cardinal variable down to zero by a (noncardinal negative step) down to zero. Am I wrong? Best, Gerald Am 30.04.24 um 21:15 schrieb Gerald Kasner:Hi Gaius, I nailed it down to the back substitution loop over i: (The old fashioned way) The loop does not go down to 1 but exits at (in this case) at i=4. I indicated the section in the attached code. I hope this helps. Best, Gerald Am 29.04.24 um 19:59 schrieb Gaius Mulley:Gerald Kasner <gerald.kasner@ovgu.de> writes:Hi Gaius, a quick test with gm2 (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0) gavewrong results with a simple Gaussian elimination, while older gm2-frontends(gm2 (GCC) 13.2.1 20240316 (Red Hat 13.2.1-7)) give correct results test compiled with: gm2 -O2 -fiso testgauss.mod -lm Result with version 13.2.1 : 125.000000000000369482222595252097 -2880.000000000007275957614183425903 14490.000000000032741809263825416565 -24640.000000000047293724492192268372 13230.000000000023646862246096134186 Result with 14.0.1: 1.000000000000000000000000000000 1.500000000000000000000000000000 1.166666666666666740681534975010 -24640.000000000047293724492192268372 13230.000000000023646862246096134186 With pivoted Gaussian elimination, the first three are NaN's. Any idea's ??? testgauss.mod is attached here. Regards, GeraldHi Gerald, many thanks for the bug report - now under investigation. I tried the usual trick of: $ gm2 -fiso -fm2-whole-program -fsoft-check-all -O0 testgauss.modbut no runtime error was detected - I'm going to try check pointing next(against gm2-13), regards, Gaius
[Prev in Thread] | Current Thread | [Next in Thread] |