4.2 fortran can't handle large, negative floating constants (fix)
lee at unmvax.UUCP
lee at unmvax.UUCP
Fri Jun 22 09:41:16 AEST 1984
Subject: 4.2 fortran can't handle large, negative floating constants
Index: /usr/lib/f77pass1 4.2BSD Fix
Description:
If one uses large, negative floating (not double!) constants
the error message "data value too large" appears and the
compilation bombs, even though the constant may be easily
handled by the VAX floating instructions.
Repeat-By:
Cut this out and compile it with f77 (doesn't matter whether
the optimizer is on or off, for once).
--------------------------------------------------------
program test
real x
data x/-1.7e+38/
write (6,*) x
stop
end
----------------------------------------------------------
Fix:
The constants given were REAL weird for dminreal. I could
not figure out why it was this way. At first I thought about
just swapping the long words and then thought, "oh well" and
changed it to be the same unsigned number as dmaxreal. Can't
see anything this would break but I do not profess to know
this compiler inside-out. Here is a diff of
/usr/src/usr.bin/f77/src/f77pass1/conv.c
RCS file: RCS/conv.c,v
retrieving revision 1.1
diff -c -r1.1 conv.c
*** /tmp/,RCSt1022729 Thu Jun 21 17:35:16 1984
--- conv.c Thu Jun 21 17:20:17 1984
***************
*** 21,27
LOCAL long dminint[] = { 0x0000d000, 0xffff00ff };
LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
! LOCAL long dminreal[] = { 0x0000f800, 0xffffffff };
--- 21,27 -----
LOCAL long dminint[] = { 0x0000d000, 0xffff00ff };
LOCAL long dmaxreal[] = { 0xffff7fff, 0xffff7fff };
! LOCAL long dminreal[] = { 0xffffffff, 0xffff7fff };
--
--Lee (Ward)
{ucbvax,convex,gatech,pur-ee}!unmvax!lee
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list