bane@parcvax.Xerox.COM (John R. Bane) (08/02/87)
Well, the program I'm porting from BSD 4.3 C to Lattice 3.04 has flushed three more compiler bugs; this makes four to date. The first one was pretty esoteric, the current three are much less so. I suspect they have a new code pessimizer in this release, because most of the bugs have nothing to do with the new features of 3.04. Bug descriptions follow. I don't think Lattice/Metacomco reads Usenet, so I'm going to mail them this via International Snail. 1. Structures smaller than 4 bytes are passed by value incorrectly - they are passed into and referenced from different ends of the 4-byte slot on the stack it creates to pass the structure. struct foo { char bar, baz; } mumble; ... foo_eater(mumble); /* foo_eater won't get mumble correctly */ 2. When some bit field operations are done, the compiler assumes the register it just used is now 0 and will store its value in pointers to clear them. struct foo {bar : 5, baz : 11; } mumble, *frotz; ... mumble.bar |= 6; frotz = 0; /* frotz will have garbage in it here */ 3. Functions having one pointer argument and one double operand don't work - the pointer argument is not referenced correctly in the function. The order of the two arguments doesn't matter; it still loses. More complicated argument lists seem to work; it's only this case. foo (bar, baz) char *bar; double baz; {... /* bar is referenced incorrectly within foo */ } 4. Automatic pointer variables declared at other than the top level of a function can be assigned to A1, which is NOT preserved over things like floating-point operations. double x,y; ... if (x == y) { char *z = malloc(20); x += 42.0; /* z will be corrupted after this operation... */ } -- Rene P.S. Bane bane.pa@xerox.ARPA ...!parcvax!bane.UUCP