This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Fortran patch] Need to pass cc1 spec to f771
- To: egcs-patches at egcs dot cygnus dot com
- Subject: [Fortran patch] Need to pass cc1 spec to f771
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Tue, 29 Jun 1999 13:19:36 +0200 (MET DST)
After successfully bootstrapping a bi-arch (32/64-bit) gcc 2.95 19990623
(prerelease) on Solaris 7/SPARC, I ran the testsuite for both ABIs and
noticed that all g77 tests failed with -m64 (i.e. 64-bit SPARC V9).
Looking into g77.log revealed that f771 complains
f771: -mptr32 not allowed on -m64
This error is from sparc.c (sparc_override_options) if -m64 is passed
without -mptr64. Comparing the invocations of cc1 and f771, I noticed an
important difference:
./xgcc -B./ -m64 -Q -v -S test.i
Reading specs from ./specs
gcc version gcc-2.95 19990623 (prerelease)
./cc1 test.i -mptr64 -mcpu=v9 -mstack-bias -mno-v8plus -m64 -version -o test.s
GNU C version gcc-2.95 19990623 (prerelease) (sparc-sun-solaris2.7) compiled by GNU C version gcc-2.95 19990623 (prerelease).
options passed: -mptr64 -mcpu=v9 -mstack-bias -mno-v8plus -m64
options enabled: -fpeephole -ffunction-cse -fkeep-static-consts
-freg-struct-return -fsched-interblock -fsched-spec -fcommon -fgnu-linker
-fargument-alias -fident -mepilogue -mapp-regs -mptr64 -m64 -mstack-bias
-mcpu=v9
./g77 -B./ -m64 -Q -v -S test.f
g77 version gcc-2.95 19990623 (prerelease) (from FSF-g77 version 0.5.25 19990526 (prerelease))
Reading specs from ./specs
gcc version gcc-2.95 19990623 (prerelease)
./f771 test.f -dumpbase test.f -m64 -version -fversion -o test.s
f771: -mptr32 not allowed on -m64
GNU F77 version gcc-2.95 19990623 (prerelease) (sparc-sun-solaris2.7) compiled by GNU C version gcc-2.95 19990623 (prerelease).
options passed: -m64 -fversion
options enabled: -fmove-all-movables -freduce-all-givs -fpeephole
-ffunction-cse -fkeep-static-consts -freg-struct-return -fsched-interblock
-fsched-spec -fcommon -fgnu-linker -fargument-noalias-global -fident
-mepilogue -mapp-regs -mptr64 -m64
GNU Fortran Front End version 0.5.25 19990526 (prerelease)
i.e. gcc expands -m64 to -mptr64 -mcpu=v9 -mstack-bias -mno-v8plus -m64 for
cc1, but gcc/g77 pass it unchanged to f771. If I call cc1 with just -m64,
I get the same error as from f771. All other language frontends pass %1
(cc1 spec) to their respective backends, while g77 does not. So the
correct fix seems to just add %1 to all f771 invocations in
f/lang-specs.h. The patch below does this. With this change, I rebuilt
gcc/g77 and re-ran the g77 testsuite: most fortrans test pass now for
-m64. The full testresults are at
http://egcs.cygnus.com/ml/egcs-testresults/1999-06/msg00289.html
I haven't yet started to analyze the remaining fortran failures, but many
(most?) seem to occur on 64-bit IRIX 6 too and thus aren't 64-bit SPARC
specific.
Rainer
Mon Jun 28 20:28:06 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* lang-specs.h: Pass cc1 spec to f771.
Index: lang-specs.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/f/lang-specs.h,v
retrieving revision 1.15
diff -u -p -r1.15 lang-specs.h
--- lang-specs.h 1999/05/17 23:35:15 1.15
+++ lang-specs.h 1999/06/29 11:06:11
@@ -45,7 +45,7 @@ the Free Software Foundation, 59 Temple
%{ffast-math:-D__FAST_MATH__}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
- "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} %(f771) \
+ "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} %1 %(f771) \
%{!Q:-quiet} -dumpbase %b.F %{d*} %{m*} %{a*}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
%{v:-version -fversion} %{pg:-p} %{p} %{f*} %{I*}\
@@ -60,7 +60,7 @@ the Free Software Foundation, 59 Temple
{"ratfor %{C} %{v}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{!E:%{!pipe:-o %g.f}}%{E:%W{o*}} %i |\n",
- "%{!E:f771 %{!pipe:%g.f} %(f771) \
+ "%{!E:f771 %{!pipe:%g.f} %1 %(f771) \
%{!Q:-quiet} -dumpbase %b.r %{d*} %{m*} %{a*}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
%{v:-version -fversion} %{pg:-p} %{p} %{f*} %{I*}\
@@ -74,7 +74,7 @@ the Free Software Foundation, 59 Temple
{".for", {"@f77"}},
{".FOR", {"@f77"}},
{"@f77",
- {"%{!M:%{!MM:%{!E:f771 %i %(f771) \
+ {"%{!M:%{!MM:%{!E:f771 %i %1 %(f771) \
%{!Q:-quiet} -dumpbase %b.f %{d*} %{m*} %{a*}\
%{g*} %{O*} %{W*} %{w} %{pedantic*}\
%{v:-version -fversion} %{pg:-p} %{p} %{f*} %{I*}\
@@ -95,7 +95,7 @@ the Free Software Foundation, 59 Temple
%{ffast-math:-D__FAST_MATH__}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z \
/dev/null /dev/null \n\
- f771 -fnull-version %(f771) \
+ f771 -fnull-version %1 %(f771) \
%{!Q:-quiet} -dumpbase g77-version.f %{d*} %{m*} %{a*} \
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
-version -fversion %{f*} %{I*} -o %g.s /dev/null \n\