Mixed sparc -m32/-m64 testsuite failures (was Re: [PATCH] Re: Yet another sparc-sun-solaris2.8 bootstrap failure)

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sat Apr 13 06:43:00 GMT 2002


Now that this patch is in:
http://gcc.gnu.org/ml/gcc-patches/2002-04/msg00552.html

and my platform's config.guess output changed from sparc- to sparcv9-,
I'm getting extra C failures when running the testsuite with -m64.

 > FAIL: gcc.dg/20001013-1.c (test for excess errors)
 > FAIL: gcc.dg/20001101-1.c (test for excess errors)
 > FAIL: gcc.dg/20001101-1.c execution test
 > FAIL: gcc.dg/20001102-1.c (test for excess errors)

I also got this failure both before and after the patch, it looks like
it has the same root cause:
 > FAIL: gcc.dg/sparc-ret.c (test for excess errors)
 > FAIL: gcc.dg/sparc-ret.c scan-assembler return[         ]*%i7\+8

The difference appears to be that the sparc-ret.c is activated
with sparc- and the other new ones with sparc*-.  Essentially, the new
failures are exposed by, not caused by, the patch.


Anyway these failures, e.g. in 20001101-1.c, occur because the
dg-options specify -m32 and the RUNTESTFLAGS specify -m64.  I get:

 > <command line>:1:1: warning: "__SIZE_TYPE__" redefined
 > <command line>:1:1: warning: this is the location of the previous definition
 > <command line>:1:1: warning: "__PTRDIFF_TYPE__" redefined
 > <command line>:1:1: warning: this is the location of the previous definition
 > <command line>:1:1: warning: "__WCHAR_TYPE__" redefined
 > <command line>:1:1: warning: this is the location of the previous definition
 > <command line>:1:1: warning: "__WINT_TYPE__" redefined
 > <command line>:1:1: warning: this is the location of the previous definition
 > ld: warning: option -YP appears more than once, first setting taken
 > ld: warning: file /usr/lib/sparcv9/values-Xa.o: linked to /usr/ccs/lib/sparcv9/values-Xa.o: attempted multiple inclusion of file

The way the specs are setup, if both -m32 and -m64 are specified, we
get the *effects of both* at the same time.  I.e. its not taking just
the last one on the command line.  If you pass in -v and look at the
command line output its very clear.

 > % xgcc -O2 -m32 -mcpu=ultrasparc -mvis 20001101-1.c -m64 -v
 > Reading specs from
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/specs
 > Configured with: ../egcc-3.1-CVS20020412/configure --verbose
 > --enable-checking=misc,tree,rtl,gc
 > Thread model: posix
 > gcc version 3.1 20020412 (prerelease)
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/cc1 -lang-c -v -iprefix
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/../lib/gcc-lib/sparcv9-sun-solaris2.7/3.1/
 > -isystem /teal/caip5/ghazi/gcc-testing/branch/build/gcc/include
 > -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -Dsparc -Dsun
 > -Dunix -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__
 > -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME
 > -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__OPTIMIZE__
 > -D__STDC_HOSTED__=1 -D__SIZE_TYPE__=unsigned int
 > -D__PTRDIFF_TYPE__=int -D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long
 > int -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc
 > -D__SIZE_TYPE__=long unsigned int -D__PTRDIFF_TYPE__=long int
 > -D__WCHAR_TYPE__=int -D__WINT_TYPE__=int -D__arch64__ -Acpu=sparc64
 > -Amachine=sparcv9 -D__sparcv9 20001101-1.c -mptr64 -mstack-bias
 > -mno-v8plus -quiet -dumpbase 20001101-1.c -m32 -mcpu=ultrasparc -mvis
 > -m64 -O2 -version -o /var/tmp//cccI6DCc.s
 > 
 > /usr/ccs/bin/as -V -Qy -s -xarch=v9a -o /var/tmp//ccktLWwb.o /var/tmp//ccopbjpd.s
 > /usr/ccs/bin/as: Sun WorkShop 6 99/08/18
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/collect2 -V
 > -Y P,/usr/ccs/lib:/usr/lib -Y P,/usr/lib/sparcv9 -Qy
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/sparcv9/crt1.o
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/sparcv9/crti.o
 > /usr/ccs/lib/sparcv9/values-Xa.o /usr/lib/sparcv9/values-Xa.o
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/sparcv9/crtbegin.o
 > -L/teal/caip5/ghazi/gcc-testing/branch/build/gcc/sparcv9
 > -L/teal/caip5/ghazi/gcc-testing/branch/build/gcc
 > -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9
 > -L/usr/ccs/lib -L/lib/sparcv9 -L/usr/lib/sparcv9 /var/tmp//ccktLWwb.o
 > -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/sparcv9/crtend.o
 > /teal/caip5/ghazi/gcc-testing/branch/build/gcc/sparcv9/crtn.o


I think this is due to the following code in sol2-bi.h:
 > #define CPP_ARCH_SPEC "\
 > %{m32:%(cpp_arch32)} \
 > %{m64:%(cpp_arch64)} \
 > %{!m32:%{!m64:%(cpp_arch_default)}} \
 > "

I'm not a specs expert, so I don't know how or whether it can handle
taking the last appearing of N options and overriding the previous
one(s).  E.g. this is not sufficient:

#define CPP_ARCH_SPEC "\
%{m32:%{!m64:%(cpp_arch32)}} \
%{m64:%{!m32:%(cpp_arch64)}} \
%{!m32:%{!m64:%(cpp_arch_default)}} \
"

because when you say "-m32 -m64" none of these take effect.
What do we do when we have: "%{m32:%{m64:????}}"  ???

Any suggestions?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Global Services



More information about the Gcc-bugs mailing list