public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Fix geniterators.sh to use standard BRE syntax in sed
@ 2015-03-23 17:06 Szabolcs Nagy
  2015-05-01 12:51 ` Marcus Shawcroft
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2015-03-23 17:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: Marcus Shawcroft, Ramana Radhakrishnan

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

GCC can be compiled for aarch64 target with busybox sed except for
the geniterators.sh script which uses nonstandard basic regex.

I explicitly set LC_ALL=C too because the regex depends on collation
order.

I tested that the script gives the same result on iterators.md.

Ok?

gcc/Changelog:

2015-03-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config/aarch64/geniterators.sh: Use standard BRE in sed.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: geniter.diff --]
[-- Type: text/x-patch; name=geniter.diff, Size: 1145 bytes --]

diff --git a/gcc/config/aarch64/geniterators.sh b/gcc/config/aarch64/geniterators.sh
index de9dfd2..f908e89 100644
--- a/gcc/config/aarch64/geniterators.sh
+++ b/gcc/config/aarch64/geniterators.sh
@@ -32,14 +32,15 @@ echo "#define GCC_AARCH64_ITERATORS_H"
 # which does not have a matching brace because it contains characters we
 # don't want to or can't handle (e.g P, PTR iterators change depending on
 # Pmode and ptr_mode).
+export LC_ALL=C
 cat $1 | tr "\n" " " \
        | sed 's/(define_mode_iterator \([A-Za-z0-9_]*\) \([]\[A-Z0-9 \t]*\)/\n#define BUILTIN_\1(T, N, MAP) \\ \2\n/g' \
        | grep '#define [A-Z0-9_(), \\]* \[[A-Z0-9[:space:]]*]' \
        | sed 's/\t//g' \
-       | sed 's/  \+/ /g' \
-       | sed 's/ \[\([A-Z0-9 ]*\)]/\n\L\1/' \
+       | sed 's/  */ /g' \
+       | sed 's/ \[\([A-Z0-9 ]*\)]/\n\1/' \
        | awk ' BEGIN { FS = " " ; OFS = ", "} \
 	       /#/ { print } \
-               ! /#/ { $1 = $1 ; printf "  VAR%d (T, N, MAP, %s)\n", NF, $0 }'
+               ! /#/ { $1 = $1 ; printf "  VAR%d (T, N, MAP, %s)\n", NF, tolower($0) }'
 
 echo "#endif /* GCC_AARCH64_ITERATORS_H  */"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][AArch64] Fix geniterators.sh to use standard BRE syntax in sed
  2015-03-23 17:06 [PATCH][AArch64] Fix geniterators.sh to use standard BRE syntax in sed Szabolcs Nagy
@ 2015-05-01 12:51 ` Marcus Shawcroft
  2015-05-06 13:23   ` Kyrill Tkachov
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Shawcroft @ 2015-05-01 12:51 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: gcc-patches

On 23 March 2015 at 17:06, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> GCC can be compiled for aarch64 target with busybox sed except for
> the geniterators.sh script which uses nonstandard basic regex.
>
> I explicitly set LC_ALL=C too because the regex depends on collation
> order.
>
> I tested that the script gives the same result on iterators.md.
>
> Ok?
>
> gcc/Changelog:
>
> 2015-03-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>
>         * config/aarch64/geniterators.sh: Use standard BRE in sed.

OK /Marcus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][AArch64] Fix geniterators.sh to use standard BRE syntax in sed
  2015-05-01 12:51 ` Marcus Shawcroft
@ 2015-05-06 13:23   ` Kyrill Tkachov
  0 siblings, 0 replies; 3+ messages in thread
From: Kyrill Tkachov @ 2015-05-06 13:23 UTC (permalink / raw)
  To: Marcus Shawcroft, Szabolcs Nagy; +Cc: gcc-patches


On 01/05/15 13:51, Marcus Shawcroft wrote:
> On 23 March 2015 at 17:06, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>> GCC can be compiled for aarch64 target with busybox sed except for
>> the geniterators.sh script which uses nonstandard basic regex.
>>
>> I explicitly set LC_ALL=C too because the regex depends on collation
>> order.
>>
>> I tested that the script gives the same result on iterators.md.
>>
>> Ok?
>>
>> gcc/Changelog:
>>
>> 2015-03-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>
>>          * config/aarch64/geniterators.sh: Use standard BRE in sed.
> OK /Marcus

I've committed this with r222852.

Kyrill


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-06 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23 17:06 [PATCH][AArch64] Fix geniterators.sh to use standard BRE syntax in sed Szabolcs Nagy
2015-05-01 12:51 ` Marcus Shawcroft
2015-05-06 13:23   ` Kyrill Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).