Silverfrost Forums

Welcome to our forums

This is the third compiler bug I have reported this week ...

19 Mar 2010 6:31 #6190

The code below illustrates the third FTN95 v5.50 bug I've reported to ftn95@silverfrost.com this week. To be fair, this one is a variation on the theme of the first one I reported, but I haven't even had either of my first two reports acknowledged yet, and this one is one to beware of, pending an upgrade.

The code below compiles without error, although it does (falsely) offer comment 1036 - The derived-type A has been declared but not used. That's a minor issue.

The major issue is that FTN95 misses the error on the line flagged with the comment '! this minor variant is not' at compile time, and computes without complaining at runtime.

Interestingly, FTN95 does notice an error with the variant statement on the line flagged with the comment ' ! this error is correctly diagnosed'. The error message - error 945: An array cannot be assigned to the scalar WRONG - is not accurate, because what is being assigned to the scalar WRONG is not an array but syntactical nonsense, but at least an error is correctly diagnosed.

Andy

      program wrong_answer

      integer, parameter :: in_a_dim = 3, in_b_dim = 3

      type a
        integer in_a (in_a_dim)
      end type a

      type b
        type (a), pointer :: in_b (:) => null ()
      end type b

      type (b) b_eg

      integer ia, ib, wrong

      allocate (b_eg% in_b (in_b_dim))

      do ia = 1, in_a_dim
        do ib = 1, in_b_dim
            b_eg% in_b (ib)% in_a (ia) = ia - 1 + (ib - 1)* in_a_dim
        end do
      end do   

      wrong = 23
!      wrong = wrong + b_eg% in_b (3)% in_a (3) ! this is the correct statement
!      wrong = b_eg% in_b% in_a (3) ! this error is correctly diagnosed
      wrong = wrong + b_eg% in_b% in_a (3) ! this minor variant is not

      stop
      end program wrong_answer
20 Mar 2010 6:54 #6192

You have lost me here Andy. I recall a false warning that I thought that I had acknowledged and a couple of other problems that turned out to be a errors in your coding. By the way, none of these problems are related to the latest release.

Anyway, I am off for a few days holiday now and will aim to take a look at this latest problem when I return.

20 Mar 2010 9:59 #6193

Paul,

As regards stuff posted here you are right in that you have replied to them. I didn't claim any of them were compiler bugs, though I maintain that the CEILING-related error in my code also highlights a compiler issue (not diagnosing an incorrectly-typed argument).

But I'm not referring to postings on the forum, I'm referring to emails to (like I said) ftn95@silverfrost.com, which seem normally to be picked up by Robert. And I'm not including two more, older than the last week but within the last few weeks, which Robert did reply to - one being code that caused an access violation, fixed in the transition from 5.40 to 5.50, and the other being code that causes an internal compiler error, which was at least promptly acknowledged.

On the whole, I don't report bugs that clearly *are *bugs in the forum, I report them to ftn95@silverfrost.com, as per the General-Announcement:

https://forums.silverfrost.com/Forum/Topic/4

which does not seem to have been superceded. On this occasion, I did so to vent a bit of frustration. I don't expect to report compiler bugs very often, but I do expect them to be at least acknowledged promptly when I do, or when anyone else does. I certainly don't expect to be reporting a second before the first has been acknowledged, and certainly certainly not a third before the first two have been acknowledged. I appreciate Robert may not be around just now; there are out-of-office facilities to cover that eventuality. Bug reports ought to be rare enough, and valuable enough, to merit at least acknowledgement of receipt by return. I made this point before, a few years ago, after a similar lack of response.

Anyway, I'm not pointing a finger at you. Have a good holiday.

Andy

20 Apr 2010 2:34 #6314

You are correct in pointing out this bug in the compiler. The right hand side does give an array result and this cannot be assigned to a scalar.

I will add this to the list of bugs to be fixed.

1 Jun 2010 10:27 #6470

This bug has now been fixed for the next release.

Please login to reply.