This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bugreport: Linuxppc/egcs-8/24/98


Has anyone been able to run the egcs testsuite on linuxppc (release
4) (powermac)?  (I haven't been able to get any version of dejagnu working
well enough to run the tests.)  For those who haven't seen linuxppc, it's
a mix of a kernel that calls itself 2.1.24 and a glibc1 that reports
itself (rpm -q) as glibc-0.961212-1l.  This particular system is mostly 
unmodified from the recent release 4 cd.  

So, keeping the above in mind, I'd like to report what I think
is a bug in the powerpc port of egcs.  I tested with the version of
egcs shipped with linuxppc (gcc version egcs-2.90.25 980302 
(egcs-1.0.2 prerelease)) as well as the snapshot from 8/24/98 and
observed the same behavior.  This code works as expected with egcs on 

Consider the following trivial program:

    --------------------------- bug.c ------------------------------------
    #include <stdio.h>

    #define BLOCKSIZE (65540)

    int main(int argc, char **argv)
	int ibits[BLOCKSIZE];
	unsigned int nerrs=0;
	double   tmp = nerrs;


    --------------------------- bug.c ------------------------------------

I would expect to see "nerrs=0" as output.  Instead, I get:

    % gcc bug.c
    % ./a.out

Under gdb4.16.97, nerrs is correct but tmp has the suspicious value
    (gdb) p/x nerrs
    $3 = 0x0
    (gdb) p/x tmp
    $3 = 0xfff0000000000000

% gcc -v
Reading specs from /usr/local/EGCS/lib/gcc-lib/powerpc-unknown-linux-gnulibc1/egcs-2.91.55/specs
gcc version egcs-2.91.55 19980824 (gcc2 ss-980609 experimental)

% uname -a
Linux 2.1.24 #129 Thu Jul 9 13:35:11 EST 1998 ppc unknown

The problem goes away on this do-nothing program if compiled with the optimizer.
However, in the sources from which i culled this example, the behavior is 
present with and without optimization.

Note that BLOCKSIZE is large in bug.c.  The bug goes away if BLOCKSIZE
is made much smaller.


Todd Chauvin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]