[Bug fortran/78258] ICE in compare_values_warnv, at tree-vrp.c:1218
gerhard.steinmetz.fortran@t-online.de
gcc-bugzilla@gcc.gnu.org
Tue Nov 8 18:31:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78258
--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
For completeness, two correct and working variants :
$ cat y1.f90
program p
implicit none
call sub (1, 'abcd')
call sub (2, x4=4, x3='1234567')
contains
subroutine sub (x1, x2, x3, x4)
integer, intent(in) :: x1
character(4), optional :: x2
character(7), optional :: x3
integer, optional :: x4
if ( x1 == 1 ) then
if ( x2 /= 'abcd' ) call abort
else
if ( x3 /= '1234567' ) call abort
if ( x4 /= 4 ) call abort
end if
end
end
$ cat y2.f90
program p
implicit none
call sub (1, 'abcd')
call sub (2, x4=4, x3='1234567')
contains
subroutine sub (x1, x2, x3, x4)
integer, intent(in) :: x1
character(4), optional :: x2
character(*), optional :: x3
integer, optional :: x4
if ( x1 == 1 ) then
if ( x2 /= 'abcd' ) call abort
else
if ( x3 /= '1234567' ) call abort
if ( x4 /= 4 ) call abort
end if
end
end
More information about the Gcc-bugs
mailing list