This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

TARGET_CPU_DEFAULT broken in ppc


[including list]

[background: what i want to do is add configury magic so when i
configure for, say powerpc-elfaltivec, i get a gcc that automatically
has "-maltivec".]

> 	Can you use -mabi=altivec as the string?  It seems that what the
> processing at the bottom of config.gcc might allow.
> 
> David

hi david.

i can't see how TARGET_CPU_DEFAULT can work at all on the ppc.

the rest of the ports have stuff like:

	target_cpu_default="TARGET_BLAH | TARGET_FOO"

the ppc backend uses TARGET_CPU_DEFAULT as a string, not as a set of
flags.  it uses it as a string to pass override_options:

#define OVERRIDE_OPTIONS rs6000_override_options (TARGET_CPU_DEFAULT)

but if you set it to any string, ala:

	target_cpu_default="-mfoobar"

the config .h files have this definition:

	#define TARGET_CPU_DEFAULT (-mfoobar)

which obviously won't work when passed to override_options.

otoh, if i enclose -mfoobar in quotes like this:

	target_cpu_default="'-mfoobar'"

then compiling sysv4.h gets all confused:

  rs6000_file_start (FILE, TARGET_CPU_DEFAULT);

    /source/uber/devo/gcc/toplev.c:4488: character constant too long
    /source/uber/devo/gcc/toplev.c:4488: warning: passing arg 2 of `rs6000_file_start' makes pointer from integer without a cast
    /source/uber/devo/gcc/toplev.c: In function `process_options':
    /source/uber/devo/gcc/toplev.c:4775: character constant too long
    /source/uber/devo/gcc/toplev.c:4775: warning: passing arg 1 of `rs6000_override_options' makes pointer from integer without a cast
    make: *** [toplev.o] Error 1

and i see no reference at all in config.gcc to set TARGET_CPU_DEFAULT to
*any* value.  so all the ppc backend is doing is taking the default
action in rs6000.h:

    /* Default string to use for cpu if not specified.  */
    #ifndef TARGET_CPU_DEFAULT
    #define TARGET_CPU_DEFAULT ((char *)0)
    #endif

afaict, rs6000_override_options never gets passed any value in
default_cpu, so most of it's fancy code is useless.  rs6000_file_start
also never gets anything but NULL.

am i missing something or is TARGET_CPU_DEFAULT broken and unused in
ppc?

-- 
Aldy Hernandez			E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]