Thread View: comp.bugs.sys5
1 messages
1 total messages
Started by Doug Gwyn
Thu, 28 Jul 1988 19:35
incomplete DMD optimizer bug fix
Author: Doug Gwyn
Date: Thu, 28 Jul 1988 19:35
Date: Thu, 28 Jul 1988 19:35
32 lines
1822 bytes
1822 bytes
I have discovered that the changes to the DMD 2.0 (WE32xxx) C optimizer
that I previously posted were incomplete. In particular, an in-line
function expansion occurring as an argument in another function call
(other than the first argument) would pick up its arguments from the
wrong place. (This is a rather rare situation.)
Some 3B C optimizers might also have this problem.
The reason I missed this earlier is that the way the code dealt with
the ops[MAXOPS] member of a NODE was extremely gross: data of the
wrong type was being forced into this array member as a temporary
variable, rather than just having such a special member of the NODE;
in the func.c source this member was #defined as "opm", but in local.c
it was called ops[MAXOPS] (that's the one I missed when I expanded
the array by 1 to fix a problem in func.c).
Here is the bug fix, which should only be installed if you picked up
my previous changes (which changed the length of ops[] from MAXOPS+1
to MAXOPS+2). In $DMD/sgs/usr/src/cmd/sgs/optim/m32/local.c:
/* @(#) local.c: 1.5 6/26/84 */
...
prinst(p) register NODE *p; { /* print instruction */
...
#ifdef IMPIL
if (p->op == CALL ) {
printf("@ %d %s %s\n",
numauto + ( int ) p->ops[MAXOPS+1], p->op1 + 1, p->op2 ); /* DAG -- was MAXOPS */
p->ops[MAXOPS+1] = NULL; /* DAG -- was MAXOPS */
}
#endif /* IMPIL */
...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads