- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
I have internal compiler error with the following code, trying to convert from int to quadruple precision inside a loop with at least -O2 . Compiler version 14. It works with double precision.
Thanks
program foo implicit none integer,parameter :: q = selected_real_kind(2*precision(1d0)) real(q) :: k integer :: i do i=1,100 k=real(i,q) print *,factorial1(k) end do contains function factorial1(n) result(res) real(q) :: n real(q) :: res integer :: i res=1._q do i=int(n),1,-1 res=res*i end do end function factorial1 end program foo
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just for information there is no problem with that version.
program foo implicit none integer,parameter :: q = selected_real_kind(2*precision(1d0)) real(q) :: k integer :: i do i=1,100 print *,factorial1(i) end do contains function factorial1(nn) result(res) real(q) :: n real(q) :: res integer :: i,nn res=1._q do i=nn,1,-1 n=real(i,q) res=res*n end do end function factorial1 end program foo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have opened a bug report DPD200254996 and will keep you updated on it.
Thanks,
Xiaoping
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page