diff mbox series

testsuite: Add -fno-tree-loop-distribute-patterns for s390.

Message ID f600c14c-7187-ad2d-e17e-2ec4e75372b5@linux.ibm.com
State New
Headers show
Series testsuite: Add -fno-tree-loop-distribute-patterns for s390. | expand

Commit Message

Robin Dapp April 4, 2022, 11:51 a.m. UTC
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*.


---

Comments

Richard Biener April 4, 2022, 1:21 p.m. UTC | #1
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
>
Andreas Krebbel April 5, 2022, 5:25 a.m. UTC | #2
On 4/4/22 13:51, Robin Dapp 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*.

Ok. Thanks!

Andreas
diff mbox series

Patch

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*-*-* } } }
+   */

 void free (void*);