This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68147] Potential incorrect code generation for string self-assignment
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Oct 2015 16:08:54 +0000
- Subject: [Bug fortran/68147] Potential incorrect code generation for string self-assignment
- Auto-submitted: auto-generated
- References: <bug-68147-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68147
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-10-29
CC| |pault at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed from 4.8 up to trunk (6.0). The following code
program test
implicit none
character(len=:),allocatable ::name, tmp
name="./a.out"
print *, name
print *, name(3:)
if (index(name,"/") /= 0) THEN
tmp=name(3:)
! name=name(3:)
name=tmp
print *,name
endif
end program
outputs
./a.out
a.out
a.out
so it seems the assignment "name=name(3:)" is missing a temporary.