simple, unwarranted bus error for gcc

Rick Greer rxga@research.att.com
Sat Apr 1 13:08:00 GMT 2000


The attached simple program fails with gcc 2.95.2 .
This is the only bug I've found with 2.95.2 and I have compiled 
literally thousands of C files with 2.95.2 even under -O with total success: 
so, we are in pretty good shape here -- just this one weirdness.

cyd_/DS.g.gcc/d) uname -a
SunOS cydonia 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-5_10
This is a pure Solaris Maintenance Update 4   for Solaris 7;
    I pulled it down from Sun this week.

Here is how I built gcc:
    /export/home/rxga/gcc/gcc-2.95.2/configure --with-cpu=ultrasparc

################  compiling and running to get unwarranted bus error
/export/home/rxga/gcc/build/bin/sparc-sun-solaris2.7-gcc -mcpu=ultrasparc -m32 -g gccbug.c  -lm -o gccbug
cyd_/DS.g.gcc/d) gccbug
Bus Error(coredump)

Thanks for your help.  I love gcc.

Rick Greer

============== source for gccbug.c =====================================
int
partqty_stats___Insert_Obj(
    char * dom_slot_with_arg_1,
    long dom_slot_with_arg_2,
    char dom_slot_with_arg_3[25+1],
    long rng_slot_with_arg_1 ,
    long rng_slot_with_arg_2 ,
    long rng_slot_with_arg_3 ,
    double rng_slot_with_arg_4
 )
{}
 
static long u__ = 0;
 
main()
{
    partqty_stats___Insert_Obj(
        "eraser",
        156,
        "tan",
        1,
        2787,
        2787,
        u__ * 1.0  /* this fails too:  ((double)u__) * 1.0  */
    );
}
=========================================================================
 



More information about the Gcc-bugs mailing list