This is the mail archive of the gcc-patches@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]

Re: [PATCH][AArch64] Fix default CPU configurations


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


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