re PR fortran/38095 (character ICE)

2008-11-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/38095
        * trans-expr.c (gfc_map_intrinsic_function): Fix pointer access.

2008-11-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/38095
        * gfortran.dg/char_length_13.f90: New test.

From-SVN: r141917
This commit is contained in:
Tobias Burnus 2008-11-16 15:19:38 +01:00
parent 7cf9886851
commit 06919226fd
4 changed files with 51 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2008-11-16 Tobias Burnus <burnus@net-b.de>
PR fortran/38095
* trans-expr.c (gfc_map_intrinsic_function): Fix pointer access.
2008-11-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38119
@ -14,8 +19,8 @@
2008-11-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37926
* trans-expr.c (gfc_add_interface_mapping): Transfer the formal
PR fortran/37926
* trans-expr.c (gfc_add_interface_mapping): Transfer the formal
arglist and the always_explicit attribute if the dummy arg is a
procedure.

View File

@ -1922,8 +1922,9 @@ gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping *mapping)
case GFC_ISYM_LEN:
/* TODO figure out why this condition is necessary. */
if (sym->attr.function
&& arg1->ts.cl->length->expr_type != EXPR_CONSTANT
&& arg1->ts.cl->length->expr_type != EXPR_VARIABLE)
&& (arg1->ts.cl->length == NULL
|| (arg1->ts.cl->length->expr_type != EXPR_CONSTANT
&& arg1->ts.cl->length->expr_type != EXPR_VARIABLE)))
return false;
new_expr = gfc_copy_expr (arg1->ts.cl->length);

View File

@ -1,3 +1,8 @@
2008-11-16 Tobias Burnus <burnus@net-b.de>
PR fortran/38095
* gfortran.dg/char_length_13.f90: New test.
2008-11-16 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr36246.c: Add -fomit-frame-pointer to dg-options.

View File

@ -0,0 +1,36 @@
! { dg-do compile }
!
! PR fortran/38095
!
! Contributed by Vivek Rao
!
! Compiling the program below gave an ICE
!
module bar
implicit none
contains
elemental function trim_append(xx,yy) result(xy)
character (len=*), intent(in) :: xx,yy
character (len=len(xx) + len(yy)) :: xy
xy = trim(xx) // yy
end function trim_append
function same(xx) result(yy)
character (len=*), intent(in) :: xx(:)
character (len=len(xx)) :: yy(size(xx))
yy = [xx]
end function same
subroutine foo(labels)
character (len=*), intent(in) :: labels(:)
print*,"size(labels)=",size(labels)
end subroutine foo
subroutine xmain()
call foo(trim_append(["a"],same(["b"])))
end subroutine xmain
end module bar
program main
use bar
call xmain()
end program main
! { dg-final { cleanup-modules "bar" } }