This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: New approach to --with-cpu, take 4
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: cgd at broadcom dot com
- Cc: gcc-patches at sources dot redhat dot com,John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Thu, 1 Aug 2002 17:45:37 -0400
- Subject: Re: PATCH: New approach to --with-cpu, take 4
- References: <20020801201924.GA24707@nevyn.them.org> <mailpost.1028233166.28594@news-sj1-1> <yov57kjamf3x.fsf@broadcom.com>
On Thu, Aug 01, 2002 at 02:41:22PM -0700, cgd@broadcom.com wrote:
> At Thu, 1 Aug 2002 20:19:26 +0000 (UTC), "Daniel Jacobowitz" wrote:
> > +/* This is not quite correct, because -mips16 will override a default
> > + architecture. This is an unfortunate consequence of -mips16 being
> > + completely orthogonal to the other -mipsN switches, yet sometimes
> > + overriding them on the command line. */
> > +#define TARGET_DEFAULT_ARCH_P() \
> > + (! option_present (*argcp, *argvp, "-march=") \
> > + && (! option_present (*argcp, *argvp, "-mips") \
> > + || option_present (*argcp, *argvp, "-mips16")))
>
> Err, the comment here should be more clear. (it looks like maybe you
> updated the code and not the comment?)
>
> Also, the code isn't right: if you have -mips3 -mips16 on the command
> line, it looks like TARGET_DEFAULT_ARCH_P will be true.
See the earlier discussion with Richard about this. Right now, if you
have -mips3 -mips16 on the command line, you won't get -mips3 code :)
At least that's what I was told.
The comment could use some thinking though.
> (This "adding an option if no override is specified" thing seems
> ... iffy to me. it seems like the right thing to do would be have a
> common place in the confugury for *_DEFAULT macros to be set, then do
> the right thing w/ them in the MD code. also, right now, you're
We've tried that. In fact, we've tried it for years and years, and the
right thing has almost never been done in the MD code. That's why I
want to do it this way; this way the default architecture isn't
"special" in any way.
> leaving all of the code in the MD bits which deal with the current
> default mechanism, too. That seems undesirable.)
Yeah. That I was going to clean up in a separate pass.
> (personally i dunno that i like the ability to set these via
> --with-xxx, but if others like it, "whatever." 8-)
I use it constantly; it's a real timesaver.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer