I've been testing the sgicc compiler from the pro64-0.01.0-13.ia64.rpm
file obtained from http://oss.sgi.com/projects/Pro64/ on the
HP IA-64 emulator running on a Red Hat Linux 6.2 installation
on an dual-CPU Intel Pentium III 600MHz system.
With the struct.c test file from the lcc compiler suite (available
in a new autoconfigurized release at
ftp://ftp.math.utah.edu/pub/lcc/lcc-4.1.beta.8.tar.gz
http://www.math.utah.edu/pub/lcc/lcc-4.1.beta.8.tar.gz
), I get this compiler assertion failure:
% sgicc -O2 struct.c
### Assertion failure at line 328 of ../../be/cg/cgexp.cxx:
### Compiler Error in file struct.c during Code_Expansion phase:
### Expand_OP: unexpected opcode OPC_MLOAD
sgicc INTERNAL ERROR: /usr/lib/gcc-lib/ia64-sgi-linux/sgicc-1.0/be returned
non-zero status 1
The code is short enough that I'm including it here:
% cat struct.c
#line 1 "struct.c"
typedef struct point { int x,y; } point;
typedef struct rect { point pt1, pt2; } rect;
point addpoint(point p1, point p2) {
p1.x += p2.x;
p1.y += p2.y;
return p1;
}
rect canonrect(rect r) {
rect temp;
temp.pt1.x =((r.pt1.x) < (r.pt2.x) ? (r.pt1.x) : (r.pt2.x));
temp.pt1.y =((r.pt1.y) < (r.pt2.y) ? (r.pt1.y) : (r.pt2.y));
temp.pt2.x =((r.pt1.x) > (r.pt2.x) ? (r.pt1.x) : (r.pt2.x));
temp.pt2.y =((r.pt1.y) > (r.pt2.y) ? (r.pt1.y) : (r.pt2.y));
return temp;
}
point makepoint(int x, int y) {
point p;
p.x = x;
p.y = y;
return p;
}
rect makerect(point p1, point p2) {
rect r;
r.pt1 = p1;
r.pt2 = p2;
return canonrect(r);
}
int ptinrect(point p, rect r) {
return p.x >= r.pt1.x && p.x < r.pt2.x
&& p.y >= r.pt1.y && p.y < r.pt2.y;
}
struct odd {char a[3]; } y = {'a', 'b', 0};
odd(struct odd y) {
struct odd x = y;
printf("%s\n", x.a);
}
main() {
int i;
point x, origin = { 0, 0 }, maxpt = { 320, 320 };
point pts[] = { -1, -1, 1, 1, 20, 300, 500, 400 };
rect screen = makerect(addpoint(maxpt, makepoint(-10, -10)),
addpoint(origin, makepoint(10, 10)));
for (i = 0; i < sizeof pts/sizeof pts[0]; i++) {
printf("(%d,%d) is ", pts[i].x,
(x = makepoint(pts[i].x, pts[i].y)).y);
if (ptinrect(x, screen) == 0)
printf("not ");
printf("within [%d,%d; %d,%d]\n", screen.pt1.x, screen.pt1.y,
screen.pt2.x, screen.pt2.y);
}
odd(y);
exit(0);
}
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- Center for Scientific Computing FAX: +1 801 585 1640, +1 801 581 4148 -
- University of Utah Internet e-mail: beebe@xxxxxxxxxxxxx -
- Department of Mathematics, 322 INSCC beebe@xxxxxxx beebe@xxxxxxxxxxxx -
- 155 S 1400 E RM 233 beebe@xxxxxxxx -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe -
-------------------------------------------------------------------------------
|