This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add -m{arch,tune}=local for x86/x86-64
Hi,
On Tue, 14 Mar 2006, Andrew Pinski wrote:
> On Mar 14, 2006, at 8:51 PM, Michael Matz wrote:
>
> > The patch is currently in testing. And comments? Okay for trunk?
>
> How does this handle crosses from the looks of it, it will cause a link
> failure when crossing from a non x86 target.
I convinced myself somehow that gcc.c will not include the target but the
host header, which would avoid this problem. On reflection that's not
true. Hmm. Any advice? I could simply #ifdef CROSS_COMPILE the define
and the function definition.
> Also it will cause
> driver-i386.c to be compiled for crosses from x86 to anything else.
Yes, though that's not a problem (when I was still convinced of the above
wrong thing, I argued that a user who would use -march=local on a i386
machine in a cross compiler would get what he deserves, as giving this
flag doesn't make sense in a cross environment). I could have excluded
the file for cross compiles, but the other files mentioned in config.host
are also not special cased, so it's at least consistent. I realize that
those other files (e.g. host-linux.o) actually have a use also in a cross
compiler, unlike my new function. But suppose someone would go add a new
hook (e.g. cache size thingies to optimize bitmap functions or the like),
and implement it for only i386. The natural place now would be
driver-i386.c (or a file included in cc1), and then it actually should be
included also in cross compilers. I think the above mentioned #ifdefing
around the function might be better.
Ciao,
Michael.