Article View: gnu.gcc.help
Article #50673Advice on exposing GCC bug?
From: Pat Mackinlay
Date: Fri, 03 Sep 1993 16:02
Date: Fri, 03 Sep 1993 16:02
72 lines
3238 bytes
3238 bytes
Hi all. I think I've managed to stumble across a bug in GCC 2.4.5 that
is present on at least two of the builds I've tried the code on. My problem
is that the bug is only present when compiling the relevant file in it's
entirety, and seems to disappear when the code is altered.
The relevant code is from the VOGL library - a free SGI GL-like graphics
library. I've had a couple of other people look it over, and none of us
have been able to see any problems with it. Another datapoint is that
the code compiles flawlessly with the MIPS compiler supplied with IRIX
4.0.5.
So, basically, I'm after a bit of advice on what I should do next. The
code is a bit large to post (about 1000 lines), and I'd like to be certain
that I've located a "real" bug before I go bothering the people who do
work on the compiler.
What should I do? Post it anyhow? Anyone else want to take a look at it?
For information's sake, the first thing the compiler stumbles over looks
like this:
/*
* crv
*
* draws a curve
*
*/
void
crv(geom)
Coord geom[4][3];
{
Matrix tmp;
int i, j;
if (!vdevice.initialised)
verror("crv: vogl not initialised");
/*
* Fill in the w column for rcurve
*/
for (i = 0; i < 4; i++)
{
tmp[i][3] = 1.0;
for (j = 0; j < 3; j++)
tmp[i][j] = geom[i][j];
}
rcrv(tmp);
}
where Matrix is defined as an array of 4x4 floats and Coord is defined
as a float. All other functions and non-local variables are defined
appropriately. The compiler falls over on the two "tmp" array index
operations with the following error:
pat@wesson$ gcc -Wall -c curves.c -o curves.o
curves.c: In function `crv':
curves.c:144: subscripted value is neither array nor pointer
curves.c:146: subscripted value is neither array nor pointer
I can provide more information to anyone who is game to investigate a
bit further, including the full source to the library. The two platforms
used were Linux with GCC 2.4.5 and IRIX 4.0.5f with GCC 2.4.0 and 2.4.5.
PS: There was actually a second seemingly unrelated error generated in
the same file, but that may perhaps have been caused by the earlier
problem. In any case, the code causing the problem in the second instance
also looks "good", and the generated error like a GCC bug.
--
Pat -- "There's only one thing left to do Mama, I got to ding a ding dang
my dang a long ling long" (Jesus Built My Hotrod -- Ministry)
GCS d* -p+ c++ l++ m--- s+/- !g w- t- r
Technical Details
Message-ID:
<rlogin.747072121@marsh>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!munnari.oz.au!uniwa!info.curtin.edu.au!mackinlaShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,f7719f45abd69093,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-09-05 20:21:51 PST Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!munnari.oz.au!uniwa!info.curtin.edu.au!mackinla From: mackinla@cs.curtin.edu.au (Pat Mackinlay) Newsgroups: gnu.gcc.help Subject: Advice on exposing GCC bug? Date: 3 Sep 93 16:02:01 GMT Organization: Curtin University of Technology Lines: 72 Message-ID: <rlogin.747072121@marsh> NNTP-Posting-Host: lillee.cs.curtin.edu.au Summary: I think I've found a GCC bug, but can't narrow it down... Keywords: advice, gcc, bug