testsuite: Add -fno-tree-loop-distribute-patterns.
In gcc.dg/Wuse-after-free-2.c we try to detect a use-after-free. 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 for this test. gcc/testsuite/ChangeLog: * gcc.dg/Wuse-after-free-2.c: Add -fno-tree-loop-distribute-patterns in order to avoid rawmemchr.
This commit is contained in:
parent
e3174d6183
commit
321d1dcf61
|
@ -1,6 +1,6 @@
|
|||
/* PR middle-end/104232 - spurious -Wuse-after-free after conditional free
|
||||
{ dg-do compile }
|
||||
{ dg-options "-O2 -Wall" } */
|
||||
{ dg-options "-O2 -Wall -fno-tree-loop-distribute-patterns" } */
|
||||
|
||||
void free (void*);
|
||||
|
||||
|
@ -107,6 +107,8 @@ int warn_cond_loop (char *p)
|
|||
{
|
||||
char *q = p;
|
||||
|
||||
/* -fno-tree-loop-distribute-patterns ensures this does not get converted
|
||||
into rawmemchr (making q and p unrelated). */
|
||||
while (*q)
|
||||
++q;
|
||||
|
||||
|
|
Loading…
Reference in New Issue