View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1892
|
Posted: Tue Aug 25, 2020 3:12 am Post subject: Optimiser bug |
|
|
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:
Code: | 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:
Code: | 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. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Tue Aug 25, 2020 10:23 am Post subject: |
|
|
mecej4
Thank you for the feedback. I can confirm that this program gives inconsistent results unless optimisation number 40 is inhibited. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1892
|
Posted: Tue Aug 25, 2020 12:40 pm Post subject: |
|
|
Paul,
Thanks. Using /Inhibit_opt 40 also enables /opt /64 to be used with the larger application from which I obtained the reproducer. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Tue Aug 25, 2020 4:41 pm Post subject: |
|
|
Just out of interest, what are the optimisations? Is there a list anywhere?
E |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Tue Aug 25, 2020 5:21 pm Post subject: |
|
|
There is a list but only for internal use. It is not comprehensive nor self explanatory. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Tue Aug 25, 2020 6:11 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Tue Aug 25, 2020 11:02 pm Post subject: |
|
|
Quote: | There is a list but only for internal use. It is not comprehensive nor self explanatory. |
shouldn't it be ?
isn't this a good example of where user input could be useful for the programmer - i.e. your good self Paul ? _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Thu Aug 27, 2020 3:00 am Post subject: |
|
|
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. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Thu Aug 27, 2020 10:22 am Post subject: |
|
|
John
Thank you for the positive and encouraging feedback. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1892
|
Posted: Thu Aug 27, 2020 4:05 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Thu Sep 10, 2020 7:50 am Post subject: |
|
|
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. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Sep 11, 2020 6:25 pm Post subject: |
|
|
... which would seel=m to be an even beter reason for having some clearer documentation about what each optimisation does ? _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2828 Location: South Pole, Antarctica
|
Posted: Sat Sep 12, 2020 1:47 am Post subject: Re: |
|
|
JohnCampbell wrote: | 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 |
|
Back to top |
|
|
|