| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-Waliasing" } |
| 3 |
! PR fortran/91296 |
| 4 |
! Code contributed by Chinoune Mehdi <chinoune dot medhi at hotmail dot com> |
| 5 |
module m |
| 6 |
implicit none |
| 7 |
integer, parameter :: sp = selected_real_kind(6) |
| 8 |
|
| 9 |
contains |
| 10 |
pure subroutine s(a,b,c) |
| 11 |
real(sp), intent(in) :: a, b |
| 12 |
real(sp), intent(out) :: c |
| 13 |
c = a + b |
| 14 |
end subroutine s |
| 15 |
end module m |
| 16 |
|
| 17 |
program test |
| 18 |
use m |
| 19 |
implicit none |
| 20 |
real(sp) :: a |
| 21 |
complex(sp) :: c |
| 22 |
|
| 23 |
c = (1._sp,1._sp) |
| 24 |
call s(c%re,c%im,a) ! *** This use to cause an ICE. *** |
| 25 |
print*,a |
| 26 |
|
| 27 |
end program test |