Clyde Meli wrote:
I'm compiling a PASCAL program under Solaris with gpc version 19991030 based on gcc 2.95.2.
gpc --automake sgamain.pas generate.pas: In function `Prescale': generate.pas:33: Internal compiler error in `emit_library_call_value', at gcc-2. 95.2/gcc/calls.c:3198 Please submit a full bug report. See URL:http://www.gnu.org/software/gcc/faq.html#bugreport for instructions. gpc1: gpc exited with status 1 report.pas:9: module/unit `generate' could not be compiled
The code which caused the problem looks like:
Procedure Prescale(umax,uavg,umin:real;VAR a,b:real); { Calculate scaling coefficients for linear scaling } CONST fmultiple = 2.0; { fitness multiple is 2 } VAR delta:real; { divisor } Begin if umin > (fmultiple * uavg - umax) / (fmultiple - 1.0) { Non-Negative Test }
then Begin { Normal Scaling } Delta:=umax-uavg; a:=(fmultiple - 1.0) * uavg / delta; b:=uavg * (umax - real(2) {fmultiple} * uavg) / delta; End else
I fixed the problem termporarily by commenting out (fmultiple - 1.0) as it is equal to 1.0 currently, and by replacing fmultiple in the other assignment (b:=uavg*(umax- etc.) by real(2) instead. It seems writing the constant there triggered a problem with the compiler.
Indeed, this was a GPC bug that has been fixed meanwhile. According to the `Fixed Bugs' section in the To-Do list http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html:
20000503: Sparc: division by reals (fjf237.pas, matt1.pas) or `Round (real_constant)' (chaput1.pas) make the compiler crash <199911040915.KAA11168@@humulus.daimi.au.dk>
Unfortunately, there's been no GPC release since 2000-05-03, so please either wait for the next release, or use the type-casting workaround in the first assignment as well (this should work, I think -- can't verify it, since my development compiler doesn't have this bug anymore):
a:= (Real (fmultiple) - 1.0) * uavg / delta;
Frank
Hi,
What does "expression used as a statement" mean? I could not find a reference to this message in the documentation and reading to code is more work than I am willing to do right now. Besides, someone may already have the answer.
Here are the output from gpc and the source code. Line 1219 is the call to View.
Thanks.
/usr/local/bin/gpc -c --short-enums level4.pas level4.pas: In function `Initnq': level4.pas:1219: parse error before `(' level4.pas:1219: parse error before `(' level4.pas:1219: warning: expression used as a statement - value is ignored make: *** [level4.o] Error 1
FOR i := 1 TO 4 DO FOR j := 1 TO 4 DO IF i = j THEN identity44[i,j] := Real ( 1.0 ) ELSE identity44[i,j] := Real ( 0.0 );
ResetTrans;
View ( 0,virXMax, 0,virYMax, 0,virZMax );
CFont ( StandardSimplex ); CSize ( 0.04, 0.04 );
Hi,
I fixed it. "View" is a reserved word. I renamed the procedure to SetView and all is well.
On Tue, 4 Jul 2000, Claude Marinier wrote:
What does "expression used as a statement" mean? I could not find a reference to this message in the documentation and reading to code is more work than I am willing to do right now. Besides, someone may already have the answer.
Here are the output from gpc and the source code. Line 1219 is the call to View.
View ( 0,virXMax, 0,virYMax, 0,virZMax );
On 4 Jul 2000, at 4:50, Frank Heckenbach wrote:
Indeed, this was a GPC bug that has been fixed meanwhile. According to the `Fixed Bugs' section in the To-Do list http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html:
I'd like to emphasize Frank's point about the usefulness of the "To Do" list. The list is kept up-to-date, and I usually download a copy (of the info version) every week or so. This allows me to determine very quickly if a problem I discover is known or not (or might be related to a similar known problem). It also lets me know what features are expected to work and what features are works-in-progress.
It's a very good resource for keeping current as the compiler develops.
-- Dave
Frank Heckenbach writes:
Unfortunately, there's been no GPC release since 2000-05-03, so please either wait for the next release,
- what happened to the plan making an CVS archive available for public read access?
- on which gcc will the new release/snapshot based on? gcc-2.95.2/3 or the current gcc CVS HEAD branch?