This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix a test-case for Darwin.
- From: Martin Liška <mliska at suse dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Dominique d'Humières <dominiq at lps dot ens dot fr>
- Date: Wed, 11 Oct 2017 14:23:35 +0200
- Subject: Re: [PATCH] Fix a test-case for Darwin.
- Authentication-results: sourceware.org; auth=none
- References: <567f634e-98b5-a880-0541-381e7b8d38a7@suse.cz> <20171011071310.GG14653@tucnak>
On 10/11/2017 09:13 AM, Jakub Jelinek wrote:
> On Wed, Oct 11, 2017 at 08:15:16AM +0200, Martin Liška wrote:
>> Hello.
>>
>> This should address failing test-case on Darwin.
>
> Guess this should fix it not just on Darwin, but also on any target
> where the assembler doesn't have a call instruction but something different
> (e.g. bl and many others).
Yes, I can see it on ppc64le.
>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> Ready to be installed?
>> Martin
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2017-10-10 Martin Liska <mliska@suse.cz>
>>
>> * c-c++-common/ubsan/ptr-overflow-sanitization-1.c: Scan
>> optimized dump rather than assembly.
>
> Ok, thanks. With a nit:
>
>> diff --git a/gcc/testsuite/c-c++-common/ubsan/ptr-overflow-sanitization-1.c b/gcc/testsuite/c-c++-common/ubsan/ptr-overflow-sanitization-1.c
>> index 42c14523764..b966d52a61d 100644
>> --- a/gcc/testsuite/c-c++-common/ubsan/ptr-overflow-sanitization-1.c
>> +++ b/gcc/testsuite/c-c++-common/ubsan/ptr-overflow-sanitization-1.c
>> @@ -1,5 +1,5 @@
>> /* { dg-require-effective-target lp64 } */
>
> Do you really need the above line? I thought now that the test
> is using __PTRDIFF_MAX__ you shouldn't really need that...
Done that and installed.
Thanks,
Martin
>
>> -/* { dg-options "-O -fsanitize=pointer-overflow" } */
>> +/* { dg-options "-O -fsanitize=pointer-overflow -fdump-tree-optimized" } */
>> /* { dg-skip-if "" { *-*-* } "-flto" } */
>>
>> #define SMAX __PTRDIFF_MAX__
>> @@ -76,5 +76,4 @@ void negative_to_negative (char *ptr)
>> p2 += 5;
>> }
>>
>> -
>> -/* { dg-final { scan-assembler-times "call\\s+__ubsan_handle_pointer_overflow" 17 } } */
>> +/* { dg-final { scan-tree-dump-times "__ubsan_handle_pointer_overflow" 17 "optimized" } } */
>>
>
>
> Jakub
>