On Tue, Jan 20, 2015 at 7:02 PM, Alan Modra <amo...@gmail.com> wrote:
> On Tue, Jan 20, 2015 at 09:26:12AM -0500, David Edelsohn wrote:
>> On Tue, Jan 20, 2015 at 12:41 AM, Alan Modra <amo...@gmail.com> wrote:
>> > On Mon, Jan 19, 2015 at 10:43:29PM -0500, David Edelsohn wrote:
>> >> On Fri, Jan 17, 2014 at 10:58 PM, Alan Modra <amo...@gmail.com> wrote:
>> >> > This patch cures PR59828 by translating all the -mcpu options at once,
>> >> > in order, to their equivalent assembler -m options by using a new spec
>> >> > function.  In the process this removes some duplication.
>> >>
>> >> ASM_CPU_SPEC is too fragile a mechanism.  I would much prefer to
>> >> expand on the ".machine" directive that I added to
>> >> rs6000_file_start().  The initial implementation explicitly avoids
>> >> .machine when -mcpu= or --with-cpu= is present as a conservative
>> >> start.
>> >>
>> >> It seems much better to select a .machine directive based on the
>> >> actual target ISA flag bits enabled than translating CPU command line
>> >> options to ASM options.  Patches to replace ASM_CPU_SPEC with .machine
>> >> and expand functionality for AIX are welcome.
>> >
>> > This might make sense when looking only at gcc, but when considering
>> > the whole toolchain I think you'll run into difficulty.  gas and other
>> > powerpc assemblers have always been invoked with -m options to select
>> > the cpu, so if you do away with ASM_CPU_SPEC and rely on .machine then
>> > you will be exercising the assembler in a new way.  I am sure that
>> > this will not work for all powerpc assemblers currently in use.
>>
>> It is stressing .machine more than that feature has been in the past,
>> but it is functionality that is suppose to work.  .machine already has
>> been stressed more with IFUNC pushing and popping ISAs.
>>
>> Are you concerned about the fundamental functionality of the pseudo-op
>> or a particular GAS release missing support for a particular ISA?  AIX
>> supports .machine, but I think that it expects slightly different
>> processor names.  I am not certain about LLVM-AS, but it normally is
>> not fed external assembly language files.
>
> I'm concerned about initialisation that might happen based on a -m
> option that doesn't happen with .machine.  A quick look over the
> gas source showed we currently have at least one case like this:
> ppc_dwarf2_line_min_insn_length is only set from command line -m
> options.  This means that if you want debug with VLE insns, you cannot
> currently invoke gas without -mvle.  ".machine vle" by itself won't
> work.  I think there may be other similar problems with setting the
> bfd arch/mach pair.

We can leave VLE unaffected and ensure that rs6000_file_start does not
emit a .machine directive for VLE or emits both .machine vle and the
driver retains the -mvle assembler command line option.

This does not need to be one extreme or the other.  We can remove as
much -mcpu=XXX as we can, which should avoid most of the conflicting
and duplicative directives.  In the mean time, GAS can be fixed.

I want to avoid duplicating the -mcpu parsing logic or the Rube
Goldberg mechanism to re-generate the -mXXX assembler directive.

Thanks, David

Reply via email to