tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Regression of GCC >= 4.8.5 for 32-bit powerpc



> On Dec 11, 2016, at 12:26 PM, Rin Okuyama <rokuyama%rk.phys.keio.ac.jp@localhost> wrote:
> 
> Hi, thank you for your prompt response!
> 
> On 2016/12/11 14:34, Matt Thomas wrote:
>>> On Dec 10, 2016, at 9:44 AM, Rin Okuyama <rokuyama%rk.phys.keio.ac.jp@localhost> wrote:
>>> 
>>> GCC >= 4.8.5 passes ".machine ppc" pseudo-op to assembler for 32-bit
>>> powerpc:
>>> 
>>> @@ -5199,10 +5204,8 @@
>>> 	fputs ("power5\n", asm_out_file);
>>>      else if ((rs6000_isa_flags & OPTION_MASK_MFCRF) != 0)
>>> 	fputs ("power4\n", asm_out_file);
>>> -      else if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) != 0)
>>> -	fputs ("ppc64\n", asm_out_file);
>>>      else
>>> -	fputs ("ppc\n", asm_out_file);
>>> +	fputs ("ppc64\n", asm_out_file);
>>>    }
>>> #endif
>>> ====
>>> Could I commit this patch? Any comments or suggestions?
>> 
>> Is that fragment needed?  It doesn't seem to matter if you emit -mcpu=
>> so why change it?
> 
> Yes, it is needed. ".machine ppc" pseudo-op  overrides CPU type
> specified by -mcpu=XXX option. As a result, even if we emit
> -mcpu=XXX, gas assembles mnemonics into instructions for generic
> powerpc.
> 
> Actually, Makefile for IBM 405 specifies -mcpu=405:
> 
> src/sys/arch/evbppc/conf/Makefile.obs405.inc
>     3  CFLAGS+=-mcpu=405
>     4  AFLAGS+=-mcpu=405
> 
> But it is neglected by assembler for the above reason. To avoid
> this, we need to stop GCC emitting ".machine ppc" pseudo-op.

I think the right fix is to make that last

	else
	  fputs ("ppc\n", asm_out_file);

into

	else if (!global_options_set.x_rs6000_cpu_index)
	  fputs ("ppc\n", asm_out_file);

I think that's that is needed.


Home | Main Index | Thread Index | Old Index