Patchwork Less restrictive regex in const-uniq-1.c

login
register
mail settings
Submitter David Edelsohn
Date Nov. 6, 2012, 2:54 p.m.
Message ID <CAGWvnynCVZpy_rpHh-mAw87tjqs=BEF5X_nH2_a_zA=3GJkXsw@mail.gmail.com>
Download mbox | patch
Permalink /patch/197491/
State New
Headers show

Comments

David Edelsohn - Nov. 6, 2012, 2:54 p.m.
The regex in const-uniq-1.c assumes ELF label format, which does not
match AIX XCOFF.  The following patch broadens the regex so that it
also correctly matches on AIX.

        * const-uniq-1.c: Expand regex to match AIX XCOFF labels.
Andrew Pinski - Nov. 6, 2012, 4:07 p.m.
On Tue, Nov 6, 2012 at 6:54 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> The regex in const-uniq-1.c assumes ELF label format, which does not
> match AIX XCOFF.  The following patch broadens the regex so that it
> also correctly matches on AIX.
>
>         * const-uniq-1.c: Expand regex to match AIX XCOFF labels.
>
> Index: const-uniq-1.c
> ===================================================================
> --- const-uniq-1.c      (revision 193203)
> +++ const-uniq-1.c      (working copy)
> @@ -20,5 +20,5 @@
>    return a[i+1];
>  }
>
> -/* { dg-final { scan-tree-dump-times "L\\\$?C0" 2 "gimple" } } */
> +/* { dg-final { scan-tree-dump-times "L\\\$?C\\\.*0" 2 "gimple" } } */

I think .* will match too much as it will match newlines too.  I think
[^\n\]* is better.

Thanks,
Andrew Pinski


>  /* { dg-final { cleanup-tree-dump "gimple" } } */
Andrew Pinski - Nov. 6, 2012, 4:39 p.m.
On Tue, Nov 6, 2012 at 8:07 AM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Tue, Nov 6, 2012 at 6:54 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
>> The regex in const-uniq-1.c assumes ELF label format, which does not
>> match AIX XCOFF.  The following patch broadens the regex so that it
>> also correctly matches on AIX.
>>
>>         * const-uniq-1.c: Expand regex to match AIX XCOFF labels.
>>
>> Index: const-uniq-1.c
>> ===================================================================
>> --- const-uniq-1.c      (revision 193203)
>> +++ const-uniq-1.c      (working copy)
>> @@ -20,5 +20,5 @@
>>    return a[i+1];
>>  }
>>
>> -/* { dg-final { scan-tree-dump-times "L\\\$?C0" 2 "gimple" } } */
>> +/* { dg-final { scan-tree-dump-times "L\\\$?C\\\.*0" 2 "gimple" } } */
>
> I think .* will match too much as it will match newlines too.  I think
> [^\n\]* is better.

Just to correct my self, I missed all of the \ before the '.' so this
change is fine with respect of not matching too much.

Thanks,
Andrew pinski


>
> Thanks,
> Andrew Pinski
>
>
>>  /* { dg-final { cleanup-tree-dump "gimple" } } */

Patch

Index: const-uniq-1.c
===================================================================
--- const-uniq-1.c      (revision 193203)
+++ const-uniq-1.c      (working copy)
@@ -20,5 +20,5 @@ 
   return a[i+1];
 }

-/* { dg-final { scan-tree-dump-times "L\\\$?C0" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "L\\\$?C\\\.*0" 2 "gimple" } } */
 /* { dg-final { cleanup-tree-dump "gimple" } } */