This is the mail archive of the gcc-bugs@gcc.gnu.org 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



Hi, 

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 
intel/linux.

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;

	printf("nerrs=%g\n",tmp);

	return(0);
    }
    --------------------------- bug.c ------------------------------------

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

    % gcc bug.c
    % ./a.out
    nerrs=-4.5036e+15

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 pb3400.jpl.nasa.gov 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.

Thanks!  

Todd Chauvin


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