[Bug fortran/68147] Potential incorrect code generation for string self-assignment
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Thu Oct 29 16:09:00 GMT 2015
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.
More information about the Gcc-bugs
mailing list