On Mon, Apr 4, 2022 at 1:52 PM Robin Dapp via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi, > > in gcc.dg/Wuse-after-free-2.c we try to detect a use-after-free. On > s390 the test's while loop is converted into a rawmemchr builtin making > it impossible to determine that the pointers *p and *q are related. > > Therefore, disable the tree loop distribute patterns pass on s390 for > this test. > > OK for trunk? > > Regards > Robin > > gcc/testsuite/ChangeLog: > > * gcc.dg/Wuse-after-free-2.c: > Add -fno-tree-loop-distribute-patterns for s390*. > > > --- > diff --git a/gcc/testsuite/gcc.dg/Wuse-after-free-2.c > b/gcc/testsuite/gcc.dg/Wuse-after-free-2.c > index 9f7ed4529f0..3a8f690e9f8 100644 > --- a/gcc/testsuite/gcc.dg/Wuse-after-free-2.c > +++ b/gcc/testsuite/gcc.dg/Wuse-after-free-2.c > @@ -1,6 +1,8 @@ > /* PR middle-end/104232 - spurious -Wuse-after-free after conditional free > { dg-do compile } > - { dg-options "-O2 -Wall" } */ > + { dg-options "-O2 -Wall" } > + { dg-additional-options "-fno-tree-loop-distribute-patterns" { > target { s390*-*-* } } }
Please add the option unconditional and add a comment wrt rawmemchr OK with that change. > + */ > > void free (void*); > > -- > 2.35.1 >