g77 bug Alpha/Intel, LEN and // on WRITE statement
David McNamara
dave@psrv.psrv.com
Thu Jun 3 17:23:00 GMT 1999
I tried to Email this from my work place but got an error message that
our server was on some list as not being secure against spammers...
So, I'm sending this from my home Email. Please send any response to
both dave@vcnet.com and dave@psrv.com, thank you.
Dear Sirs:
I believe I have discovered a problem with g77 on both Alpha and Intel
platforms
Alpha -- egcs-2.90.29
Intel -- egcs-2.91.66
The problem involves using the LEN intrinsic for string indexing:
PROGRAM CONFIGURATION
CALL LECTURE_PARAMETRES ('/home/mine/tmp/' )
END
SUBROUTINE LECTURE_PARAMETRES(CHEMIN_COURANT )
CHARACTER CHEMIN_COURANT*(*)
character*(100) heap__
CHARACTER CHEMIN
EQUIVALENCE (CHEMIN,HEAP__)
INTEGER CHEMIN_
CHARACTER A1*500
CHEMIN(1:LEN(CHEMIN_COURANT)) = CHEMIN_COURANT
! doing write(*,*)chemin works ok too
! this does not work
WRITE (*, *) ':'//CHEMIN(1:LEN(CHEMIN_COURANT))//
1 ':'
! this works
A1 = CHEMIN(1:LEN(CHEMIN_COURANT))
j6 = len(chemin_courant)
WRITE (*, *) ':'//A1(1:J6)//':'
END
Output:
:/h@ÃÂûÿÿÃÂî
:/home/mine/tmp/:
When a temp is introduced, the expected results are achieved. Without the
temp,
there is garbage.
Thanks in advance.
Best Regards,
David
--
=================================================================
David McNamara
Sofware Development Manager, Compiler Technology Group
Pacific-Sierra Research Corp.
2901 28th Street
Santa Monica, CA 90405
(310)314-2338, Fax (310)314-2323, Email: dave@psrv.com
WWW: http://www.psrv.com/
=================================================================
More information about the Gcc-bugs
mailing list