This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR34537 - ICE or wrong code for TRANSFER of constant string to character
- From: Tobias Burnus <burnus at net-b dot de>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Fri, 11 Jan 2008 15:37:03 +0100
- Subject: Re: [Patch, fortran] PR34537 - ICE or wrong code for TRANSFER of constant string to character
- References: <339c37f20801110457u54f60c35x32bc062ba1d076ec@mail.gmail.com> <478779B4.7090706@net-b.de>
Tobias Burnus wrote:
> (CCed gcc-patches; for patch, see fortran@)
>
> Paul Richard Thomas wrote:
>
>> Regetested on Cygwin_NT (will do the lot on x86_ia64 tonight) - OK for trunk?
>>
>>
> OK. Thanks for the patch.
>
I forgot the following. Please change the test case as follows as it has
out-of-bound problems:
allocate(ptr(8))
ptr = transfer('Sample#0'//achar(0),ptr) ! Causes ICE
is bad, because you transfer 9 bytes to a (pointer to a) 8-byte array.
Please change the test to:
allocate(ptr(9))
ptr = transfer('Sample#0'//achar(0),ptr) ! Causes ICE
if (any (ptr .ne. ['S','a','m','p','l','e','#','0', achar(0)])) call abort
(Note also the added "achar(0)" in the if clause.)
I filled -bounds-check errors for those as gfortran - contrary to NAG
f95 - does not detect them: PR 34740, 34741).
Tobias