-mcpu=ultrasparc miscompiles (32 bit)

Keith Refson Keith.Refson@earth.ox.ac.uk
Tue May 2 08:53:00 GMT 2000


I have an extremely-well debugged floating-point program which
coredumps with SIGBUS when compiled with gcc 2.95.2 using the
"-mcpu=ultrasparc" option. The patform is sparc-sun-solaris2.8.

A search of the bugs database and mailing list archive reveals that
there are known problems whcn compiling for 64 bit v9 architecture.
However this definitely does not apply -- the compile is in 32 bit
mode and I am running the 32-bit Solaris 8 kernel.

Unfortunately it's not easy to extract a small test case from a
substantially-sized code.  However it should be *VERY* easy to
regenerate the problem.

1) Fetch ftp://ftp.earth.ox.ac.uk/pub/moldy-2.15b.tar.gz
2) Unpack (N.B.  This does not create a directory, so make one and cd
   to it first).
3) Do the configure with the "CC" environment variable set to "gcc".
4) make moldy
5) run "./moldy control.water"

This should run successfully.  However adding "-mcpu=ultrasparc" to
the compile flags of either "kernel.c" or "force.c" will cause a bus
error (in 2 different locations), which GDB reports as being
immediately on procedure entry.

N.B.  Optimization level of -O1 or greater is necessary as well as
      -mcpu=ultrasparc to generate the SIGBUS.

sincerely

Keith Refson
-- 
Dr Keith Refson,        "Paradigm is a word too often used by those who would
Dept of Earth Sciences      like to have a new idea but cannot think of one." 
Parks Road,                  -- Mervyn King, Deputy Governor, Bank of England
Oxford OX1 3PR, UK        
Keith.Refson@                       Tel: 01865 272026
             earth.ox.ac.uk         Fax: 01865 272072


More information about the Gcc-bugs mailing list