Bug 16416 - [3.4/4.0 regression] -m64 doesn't imply -mcpu=v9 anymore
Summary: [3.4/4.0 regression] -m64 doesn't imply -mcpu=v9 anymore
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.2
Assignee: Eric Botcazou
URL:
Keywords:
Depends on: 16109
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-07 22:28 UTC by Eric Botcazou
Modified: 2004-09-13 14:15 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.[789]
Target: sparc-sun-solaris2.[789]
Build: sparc-sun-solaris2.[789]
Known to work:
Known to fail:
Last reconfirmed: 2004-07-07 22:42:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2004-07-07 22:28:39 UTC
On the 3.3 branch:

[eric@localhost obj.sparc]$ gcc/xgcc -Bgcc -S -### t.c -m64
Reading specs from gcc/specs
Configured with: ../configure --host=i586-redhat-linux-gnu
--target=sparc-sun-solaris2.8 --prefix=/usr/local
--enable-checking=misc,tree,rtlflag --enable-languages=c,c++
Thread model: posix
gcc version 3.3.5 20040703 (prerelease)
 "gcc/cc1" "-quiet" "-iprefix"
"/home/eric/cvs/gcc-3_3-branch/obj.sparc/gcc/../lib/gcc-lib/sparc-sun-solaris2.8/3.3.5/"
"-isystem" "gcc/include" "-D__GNUC__=3" "-D__GNUC_MINOR__=3"
"-D__GNUC_PATCHLEVEL__=5" "-Dsparc" "-D__sparc__" "-D__sparc" "-D__arch64__"
"-Acpu=sparc64" "-Amachine=sparcv9" "-D__sparcv9" "t.c" "-mptr64" "-mstack-bias"
"-mno-v8plus" "-mcpu=v9" "-quiet" "-dumpbase" "t.c" "-m64" "-auxbase" "t" "-o" "t.s"


On the 3.4 branch and up:

[eric@localhost obj.sparc]$ gcc/xgcc -Bgcc -S -### t.c -m64
Reading specs from gcc/specs
Configured with: ../configure --host=i586-redhat-linux-gnu
--target=sparc-sun-solaris2.8 --prefix=/usr/local
--enable-checking=misc,tree,rtlflag --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2 20040706 (prerelease)
 "gcc/cc1" "-quiet" "-iprefix"
"/home/eric/cvs/gcc-3_4-branch/obj.sparc/gcc/../lib/gcc/sparc-sun-solaris2.8/3.4.2/"
"-isystem" "gcc/include" "-D__arch64__" "-D__sparcv9" "t.c" "-mptr64"
"-mstack-bias" "-mno-v8plus" "-quiet" "-dumpbase" "t.c" "-m64" "-mcpu=v7"
"-auxbase" "t" "-o" "t.s"

which I find stupid.

This comes from the --with-cpu mechanism at configure time, which defaults to v7
on sparc-*-*, so the driver behaves as if -mcpu=v7 were passed.
Comment 1 Eric Botcazou 2004-07-07 22:42:21 UTC
Investigating.
Comment 2 GCC Commits 2004-07-09 08:31:40 UTC
Subject: Bug 16416

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2004-07-09 08:31:34

Modified files:
	gcc            : ChangeLog 
	gcc/config/sparc: sol2-bi.h 

Log message:
	PR target/16416
	* config/sparc/sol2-bi.h (OPTION_DEFAULT_SPECS): New macro.
	Override default settings to account for -m32 and -m64.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4409&r2=2.4410
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-bi.h.diff?cvsroot=gcc&r1=1.17&r2=1.18

Comment 3 GCC Commits 2004-07-09 08:33:05 UTC
Subject: Bug 16416

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	ebotcazou@gcc.gnu.org	2004-07-09 08:33:01

Modified files:
	gcc            : ChangeLog 
	gcc/config/sparc: sol2-bi.h 

Log message:
	PR target/16416
	* config/sparc/sol2-bi.h (OPTION_DEFAULT_SPECS): New macro.
	Override default settings to account for -m32 and -m64.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.543&r2=2.2326.2.544
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-bi.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.14.4.2&r2=1.14.4.3

Comment 4 Eric Botcazou 2004-07-09 08:35:23 UTC
See http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00897.html