This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gfortran bug


On Fri, Feb 10, 2006 at 09:53:46PM -0500, Jack Howarth wrote:
>     The following code is miscompiled by gfortran from tonight's gcc 4.1
> branch resulting in the a segfault...
> 
> ../../../gcc-4.1-20060210/libgfortran/intrinsics/date_and_time.c:298: failed assertion `__time_len >= TIME_LEN'
> Abort
> 
> The code is...
> 
> C=====================================================================
>       SUBROUTINE VTIME(A,AMAX,ALEN)
> C
> C this routine returns day time
> C
>       IMPLICIT NONE
> C input/output
>       CHARACTER*(*) A
>       INTEGER AMAX, ALEN
> C local
>       CHARACTER  DSTR*8, TSTR*9
                           ^^^^^^

> C begin
>       IF (AMAX.LT.8) THEN
>       WRITE(6,'(A)') ' %VTIME-ERR: string to small'
>       ELSE
>       CALL DATE_AND_TIME(DSTR, TSTR)
                                 ^^^^

TIME (optional) shall be scalar and of type default character, and shall
                be of length at least 10 in order to contain the complete
                value.  It is an INTENT (OUT) argument.  Its leftmost 10
                characters are assigned a value of the form hhmmss.sss,
                where hh is the hour of the day, mm is the minutes of the




-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]