This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] Fix default CPU configurations
- From: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Wed, 12 Mar 2014 09:42:55 +0000
- Subject: Re: [PATCH][AArch64] Fix default CPU configurations
- Authentication-results: sourceware.org; auth=none
- References: <530C6B89 dot 10409 at arm dot com> <CAFqB+PwTyGis3BbXY8ExjHyBet=83dqo7T10a3C+4PEPSP4Ckg at mail dot gmail dot com> <531EF825 dot 9040602 at arm dot com>
On 11 March 2014 11:48, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>> - if test x$target_cpu_cname = x
>> + if test x"$target_cpu_cname" != x
>>
>> I think the addition of quoting here is orthogonal to the issue you
>> are fixing. There are several other references to target_cpu_cname in
>> config.gcc none of which are quoted, so I guess either they should all
>> be quoted, or not, and if they are it is a separate patch.
>
>
> Perhaps I should have commented on this.
> This change is not orthogonal.
> When I initially wrote it as " if test x$target_cpu_cname != x" the script
> complained of an error and happily ignored that line, giving the wrong value
> to target_cpu_default2 on the line below!
>
> "config.gcc: line 4065: test: too many arguments"
>
> If I quote it, it works fine. I suspect it's because of spaces introduced
> into target_cpu_cname earlier, since target_cpu_cname has the format
> "TARGET_CPU_$base_id | $ext_mask" from earlier, but I'm not sure.
For the benefit of the list, Kyrill and I just discussed the need for
quoting on target_cpu_cname. In the aarch64 path the value constructed
in target_cpu_cname is a '|' expression ripped from the table in
aarch64-option-extensions.def hence the quoting on the argument to the
test invocation is required to prevent the shell interpreting the '|'.
The following use of the variable on the RHS of an assignment does
not require additional quoting.
I'm happy that the patch makes sense and should be committed.
/Marcus