Emmanuel Chaput wrote:
I have a problem with gpc on a sun sparc. A simple program like
this crashes the compiler (with gpc1 receiving a sig 11) :
program foo;
begin
writeln(round(3.1))
end.
Note that round(x) works fine. A debugger told me that in function
expand_fix from file optabs.c, GET_MODE (from) was used with
from = 0.
I then discovered in file p/rts.c that there were differences between
how trunc and round were implemented. So I tried to change the
"case p_ROUND" in that file. That is I changed
retval = fold(build1(...
into
retval = convert(long_long_integer_type_node, val);
And it seems to work !
Could someone explain this to me ? Did I make something wrong ?
Or is this the good way to correct the bug ?
I think you made Round work like Trunc now!? What does `Round (2.8)'
say? It should, of course, say 3, but after your patch, doesn't it
say 2?
Frank
PS: Are you subscribed to the list now? I'm CCing you a copy, just
in case not...
Frank
--
Frank Heckenbach, frank@g-n-u.de,
http://fjf.gnu.de/
GPC To-Do list, latest features, fixed bugs:
http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html