This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] POWER8 default for PPC64LE
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Peter Bergner <bergner at vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Michael Meissner <meissner at linux dot vnet dot ibm dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Wed, 21 Jan 2015 14:53:23 -0500
- Subject: Re: [RFC] POWER8 default for PPC64LE
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnyk5WC96w5RbOq-D_2Pytur+bhqoHA5ZpRBe5Q5iwyiStg at mail dot gmail dot com> <54B6D35C dot 9010505 at redhat dot com> <1421336431 dot 5593 dot 73 dot camel at otta> <CAGWvny=7kwzDMrq2YoU8snVd6QtDTffRPex4wGhY+ER1=mrwHg at mail dot gmail dot com> <mvm4mrktm2e dot fsf at hawking dot suse dot de>
On Wed, Jan 21, 2015 at 6:22 AM, Andreas Schwab <schwab@suse.de> wrote:
> David Edelsohn <dje.gcc@gmail.com> writes:
>
>> Index: gcc/config/rs6000/rs6000.c
>> ===================================================================
>> --- gcc/config/rs6000/rs6000.c (revision 219747)
>> +++ gcc/config/rs6000/rs6000.c (working copy)
>> @@ -5072,6 +5072,28 @@ rs6000_file_start (void)
>> putc ('\n', file);
>> }
>>
>> +#ifdef USING_ELFOS_H
>> + if (rs6000_default_cpu == 0 || rs6000_default_cpu[0] == '\0'
>> + || !global_options_set.x_rs6000_cpu_index)
>> + {
>> + fputs ("\t.machine ", asm_out_file);
>> + if ((TARGET_DEFAULT & OPTION_MASK_DIRECT_MOVE) != 0)
>> + fputs ("power8\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_POPCNTD) != 0)
>> + fputs ("power7\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_CMPB) != 0)
>> + fputs ("power6\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_POPCNTB) != 0)
>> + fputs ("power5\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_MFCRF) != 0)
>> + fputs ("power4\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_POWERPC64) != 0)
>> + fputs ("ppc64\n", asm_out_file);
>> + else
>> + fputs ("ppc\n", asm_out_file);
>> + }
>> +#endif
>> +
>
> This is wrong, it doesn't account for -m64 on a --with-cpu=default32
> compiler.
--with-cpu=default32 does not define TARGET_CPU_DEFAULT and
rs6000_default_cpu, so rs6000_file_start does not skip the new block
of code.
-m64 implicitly sets -mpowerpc64.
Error: junk at end of line: `1'
often is a problem with MRCRF (POWER4), which should not be enabled by
-m64 and -mpower64.
I tried configuring and building with --with-cpu=default32 on gcc110
running Fedora 18. I did not encounter the failure in stage 1. I
encountered a failure later in stage 2 because some 32 bit libraries
are not installed (which confirms that it's building PPC32).
Looking at the OpenSUSE Factor log in more detail, I see that the
configuration uses
--with-cpu=default32 --with-cpu-64=power4
The second option is the problem. rs6000_start_file() probably should
use rs6000_isa_flags and not TARGET_DEFAULT.
Testing.
- David