[committed] testsuite: Use noipa attribute instead of noinline, noclone

Jakub Jelinek jakub@redhat.com
Wed Jun 16 11:22:37 GMT 2021


Hi!

I've noticed this test now on various arches sometimes FAILs, sometimes
PASSes (the line 12 test in particular).

The problem is that a = 0; initialization in the caller no longer happens
before the f(&a) call as what the argument points to is only used in
debug info.

Making the function noipa forces the caller to initialize it and still
tests what the test wants to test, namely that we don't consider *p as
valid location for the c variable at line 18 (after it has been overwritten
with *p = 1;).

Tested on x86_64-linux, committed to trunk as obvious.

Wonder if we shouldn't somehow mark PARM_DECLs that point to (directly or
indirectly) into memory that IPA optimizations (modref?)
chose it is unnecessary to initialize to tell var-tracking that it is unsafe
to use MEMs based on those parameters in debug insns...

2021-06-16  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/guality/pr49888.c (f): Use noipa attribute instead of
	noinline, noclone.

--- gcc/testsuite/gcc.dg/guality/pr49888.c.jj	2020-01-14 20:02:47.308601970 +0100
+++ gcc/testsuite/gcc.dg/guality/pr49888.c	2021-06-16 12:58:54.636184065 +0200
@@ -4,7 +4,7 @@
 
 static int v __attribute__((used));
 
-static void __attribute__((noinline, noclone))
+static void __attribute__((noipa))
 f (int *p)
 {
   int c = *p;


	Jakub



More information about the Gcc-patches mailing list