* Fortran bug?
@ 1989-11-28 16:10 Thomas Epperly
1989-12-01 7:39 ` Keith Bierman - SPD Advanced Languages
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Thomas Epperly @ 1989-11-28 16:10 UTC (permalink / raw)
The following short fortran program gives a
Fatal error in: /usr/lib/fcom1.31 Segmentation fault
Nice error message! I really don't know fortran, so I am not sure if this
is a bug in the compiler or not. Line seven is the line which causes the
compiler to die(the one with the MOD).
PROGRAM test
IMPLICIT none
INTEGER level, igr
igr = 1
level = 2
igr = MOD(level,INT(10.0))
END
Lastly, I am posting this for one of the users on our system; and I don't know
why he wrote the MOD that way.
Tom Epperly
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Fortran bug?
1989-11-28 16:10 Fortran bug? Thomas Epperly
@ 1989-12-01 7:39 ` Keith Bierman - SPD Advanced Languages
1989-12-05 17:16 ` Michael Carter 1639503
1989-12-05 2:09 ` Carl Burch
1989-12-07 4:11 ` Lilian Leung
2 siblings, 1 reply; 5+ messages in thread
From: Keith Bierman - SPD Advanced Languages @ 1989-12-01 7:39 UTC (permalink / raw)
In article <7120@pt.cs.cmu.edu> epperly@osnome.che.wisc.edu (Tom Epperly) writes:
>The following short fortran program gives a
>Fatal error in: /usr/lib/fcom1.31 Segmentation fault
>Nice error message! I really don't know fortran, so I am not sure if this
>is a bug in the compiler or not. Line seven is the line which causes the
>compiler to die(the one with the MOD).
>
> PROGRAM test
> IMPLICIT none
> INTEGER level, igr
> igr = 1
> level = 2
> igr = MOD(level,INT(10.0))
> END
>
>Lastly, I am posting this for one of the users on our system; and I don't know
>why he wrote the MOD that way.
>
Runs fine on a sun4 with f77v1.3. The code is legal.
I assume this is a contrived example (cut down from something large no
doubt), as there is no file written (screen output) or anything else
to get a handle on ... so the compiler may try to optimize the whole
program away (default on 1.31 is -O1, if memory serves ... so you
might try -O0 for grins).
On a MIPS box with the current MIPS compilers the correct result is
also provided. Either this was a bug in the MIPS 1.31 compiler (which
DEC is still selling) or it was introduced as part of the the "port".
I'm afraid I don't have a DS3100 handy, so I can't provide a better
explaination nor a tested workaround.
Cheers
Keith H. Bierman |*My thoughts are my own. !! kbierman@sun.com
It's Not My Fault | MTS --Only my work belongs to Sun*
I Voted for Bill & | Advanced Languages/Floating Point Group
Opus | "When the going gets Weird .. the Weird turn PRO"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fortran bug?
1989-12-01 7:39 ` Keith Bierman - SPD Advanced Languages
@ 1989-12-05 17:16 ` Michael Carter 1639503
0 siblings, 0 replies; 5+ messages in thread
From: Michael Carter 1639503 @ 1989-12-05 17:16 UTC (permalink / raw)
In article <7120@pt.cs.cmu.edu> epperly@osnome.che.wisc.edu (Tom Epperly) writes:
>The following short fortran program gives a
>Fatal error in: /usr/lib/fcom1.31 Segmentation fault
>Nice error message! I really don't know fortran, so I am not sure if this
>is a bug in the compiler or not. Line seven is the line which causes the
>compiler to die(the one with the MOD).
>
> PROGRAM test
> IMPLICIT none
> INTEGER level, igr
> igr = 1
> level = 2
> igr = MOD(level,INT(10.0))
> END
>
We ran into a similar situation on the 3100. The problem is probably
caused by the use of INT inside the MOD function. According to DEC,
the MIPS Fortran compiler doesn't support (at least on the 3100) type
conversion of a CONSTANT (variables work okay) within a function call,
using the intrinsic conversion functions.
You can use:
igr = MOD (level,10)
or you can use:
itemp=INT(10.0)
igr = MOD(level,itemp)
or you can use:
igr = MOD(level,INTUSE(10.0))
(where INTUSE is a user-defined conversion function (which could just
call the INT function))
or you can use:
temp=10.0
igr = MOD(level,INT(temp))
>Lastly, I am posting this for one of the users on our system; and I don't know
>why he wrote the MOD that way.
I'm not sure why anyone would want to do that either, but we tripped over the
same thing, so your user's programming style isn't entirely unique :-), even
though it may not be good programming practice.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fortran bug?
1989-11-28 16:10 Fortran bug? Thomas Epperly
1989-12-01 7:39 ` Keith Bierman - SPD Advanced Languages
@ 1989-12-05 2:09 ` Carl Burch
1989-12-07 4:11 ` Lilian Leung
2 siblings, 0 replies; 5+ messages in thread
From: Carl Burch @ 1989-12-05 2:09 UTC (permalink / raw)
> The following short fortran program gives a
> Fatal error in: /usr/lib/fcom1.31 Segmentation fault
> Nice error message! I really don't know fortran, so I am not sure if this
> is a bug in the compiler or not.
I don't know about any other company's compiler lab, but around here
we kind of take it for granted that any segmentation violation in system
software is a bug.
- Carl Burch
HP Compiler Lab
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Fortran bug?
1989-11-28 16:10 Fortran bug? Thomas Epperly
1989-12-01 7:39 ` Keith Bierman - SPD Advanced Languages
1989-12-05 2:09 ` Carl Burch
@ 1989-12-07 4:11 ` Lilian Leung
2 siblings, 0 replies; 5+ messages in thread
From: Lilian Leung @ 1989-12-07 4:11 UTC (permalink / raw)
In article <7120@pt.cs.cmu.edu> epperly@osnome.che.wisc.edu (Tom Epperly) writes:
>The following short fortran program gives a
>Fatal error in: /usr/lib/fcom1.31 Segmentation fault
>Nice error message! I really don't know fortran, so I am not sure if this
>is a bug in the compiler or not. Line seven is the line which causes the
>compiler to die(the one with the MOD).
>
> PROGRAM test
> IMPLICIT none
> INTEGER level, igr
> igr = 1
> level = 2
> igr = MOD(level,INT(10.0))
> END
>
>Lastly, I am posting this for one of the users on our system; and I don't know
>why he wrote the MOD that way.
>
>Tom Epperly
The above was a bug in our 1.31 FORTRAN compiler, but has since been
fixed in our 2.0 release.
--
UUCP: {ames,decwrl,prls,pyramid}!mips!lilian (or lilian@mips.com)
DDD: 408-991-7848 Lilian Leung (or 408-720-1700, Ext. 848)
USPS: MIPS Computer Systems, 930 Arques, Sunnyvale, CA 94086-3650
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1989-12-07 4:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1989-11-28 16:10 Fortran bug? Thomas Epperly
1989-12-01 7:39 ` Keith Bierman - SPD Advanced Languages
1989-12-05 17:16 ` Michael Carter 1639503
1989-12-05 2:09 ` Carl Burch
1989-12-07 4:11 ` Lilian Leung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox