Silverfrost Forums

Welcome to our forums

Optimiser bug

25 Aug 2020 2:12 #26260

The 8.64 compiler, when applied with /64 /opt to the test source (about 200 lines) at https://www.dropbox.com/s/u6fy00ypu3i8b65/ptbug.f90?dl=0 , prints out an incorrect result:

 Last day, indices where pop is .true. and R values /= 0
  (  1,  4)      (120,  4)      (  7, 12)      (104, 29)      (  8, 67)      ( 21,142)
  R(  1,  4) =  1,  R(120,  4) =  1,
 count(pop) =  4, sum(R) =  0  , (should be 6 and 2)
**** STOP: Please check for consistency

The line preceding the one with 'STOP' should display:

 count(pop) =  6, sum(R) =  2  , (should be 6 and 2)

The program runs fine with /checkmate, /check and /debug. It runs fine even with /opt when a 32-bit program is built.

Since the program performs a random-walk, the output will probably not match the output when another compiler is used, since the sequence of random numbers from that compiler's runtime will be different.

25 Aug 2020 9:23 #26261

mecej4

Thank you for the feedback. I can confirm that this program gives inconsistent results unless optimisation number 40 is inhibited.

25 Aug 2020 11:40 #26262

Paul,

Thanks. Using /Inhibit_opt 40 also enables /opt /64 to be used with the larger application from which I obtained the reproducer.

25 Aug 2020 3:41 #26264

Just out of interest, what are the optimisations? Is there a list anywhere?

E

25 Aug 2020 4:21 #26265

There is a list but only for internal use. It is not comprehensive nor self explanatory.

25 Aug 2020 5:11 #26266

Hi Paul,

Yes, I already knew that. It was as gentle a push as I could make in the circumstances. I've stated my belief in the past that for many people, and for many purposes, FTN95 is adequately fast, and particularly so when there is a human interface to manage. I've certainly had peculiar things come up when I've used /opt, so much so that I never use it.

But I'd like to.

Eddie

27 Aug 2020 2:00 #26278

I would just like to say thank you to mecej4 and Paul,

Mecej4, thanks very much for finding and reporting all these /64 optimising bugs, and Paul, thanks very much for your attention and prompt response to fixing these bugs as they are identified.

This is making FTN95 a better product.

I find it the best compiler for software development.

27 Aug 2020 9:22 #26280

John

Thank you for the positive and encouraging feedback.

27 Aug 2020 3:05 #26282

John C.,

I appreciate your kind remarks.

Hats off to Paul, Robert and others at Silverfrost for their superb and prompt response to a large number of bug reports.

10 Sep 2020 6:50 #26335

This failure has now been fixed for the next release of FTN95.

The failure related to the use of an ALLOCATABLE array which resulted in the optimiser extracting code from a DO loop that was not loop invariant.

I should also mention that inhibiting optimisation 40 was not a good fix as it takes out a whole raft of optimisations. The specific case was in fact optimisation 30.

12 Sep 2020 12:47 #26343

Quoted from JohnCampbell I find it the best compiler for software development.

In one country and one of its largest research institutions many years ago even existed small but devoted club of fans of Salford, now Silverfrost, compilers. Every time we crossed somewhere the first question always was 'Any new version of FTN77?'. For us everyone who was not using FTN77 after we recommended it was like a non-recoverable dumbo or retard 😃. Time now shows they indeed were dumboretards

Please login to reply.