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).

> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> 
> Ready to be installed?
> Martin
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-10-10  Martin Liska  <mli...@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...

> -/* { 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

Reply via email to