This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: fortran/25619: temporary array of constant size character type goes wrong
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 3 Apr 2006 18:07:23 -0700
- Subject: Re: PATCH: fortran/25619: temporary array of constant size character type goes wrong
- References: <20060404004914.GA15484@lucon.org> <200604040051.k340pesZ007137@earth.phy.uc.edu>
On Mon, Apr 03, 2006 at 08:51:40PM -0400, Andrew Pinski wrote:
> >
> > When we copy temporary character array, we always deference the
> > result even if it shouldn't be deferenced. This patch checks if
> > the result is a pointer before deferencing it.
> >
> >
> > H.J.
> > --
> > 2006-04-03 H.J. Lu <hongjiu.lu@intel.com>
> >
> > PR fortran/25619
> > * trans-array.c (gfc_conv_expr_descriptor): Only dereference
> > character pointer when copying temporary.
>
> Testcase?
>
I have been using this.
H.J.
---
program main
character (5) :: a = 'hello'
call test ((/a/))
end program main
subroutine test (a)
character (5) :: a
if (a .ne. 'hello') call abort
end subroutine test