aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-11-17 09:35:12 +0100
committerJakub Jelinek <jakub@redhat.com>2020-11-17 09:35:12 +0100
commit855ce4cda1a374eb1ce4a24fcde65d4c3d111bcd (patch)
tree82abe40de135936fbb8f3c84e79d133626459049
parentd5ac0401eb128bf3dadec943741dfde7c499e49a (diff)
downloadgcc-855ce4cda1a374eb1ce4a24fcde65d4c3d111bcd.zip
gcc-855ce4cda1a374eb1ce4a24fcde65d4c3d111bcd.tar.gz
gcc-855ce4cda1a374eb1ce4a24fcde65d4c3d111bcd.tar.bz2
guality: Workaround for guality/pr59776.c testcase
The test has been added 3 years before noipa attribute has been introduced, but already at that point I wanted to avoid IPA opts getting into way, most of the foo function is optimized away and the debug info just points to the caller\s var. With the recent modref/aliasing changes the caller's store to the variable whose address it is passing to the function is optimized away too. I think we should just use noipa to avoid this, though perhaps longer term we should think about some debug info improvements how to deal with that. The caller had before dse1: # DEBUG BEGIN_STMT x.f = 5.0e+0; x.g = 6.0e+0; # DEBUG BEGIN_STMT foo (&x); # DEBUG BEGIN_STMT x ={v} {CLOBBER}; and the x.f and x.g stores are optimized away. If we had a way to pretend the memory contains those values anyway... Tested on x86_64-linux, fixes the guality regressions +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 introduced in the last 2 days. 2020-11-17 Jakub Jelinek <jakub@redhat.com> * gcc.dg/guality/pr59776.c (foo): Use noipa attribute instead of noinline, noclone.
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr59776.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/guality/pr59776.c b/gcc/testsuite/gcc.dg/guality/pr59776.c
index 6c1c816..7c95a9f 100644
--- a/gcc/testsuite/gcc.dg/guality/pr59776.c
+++ b/gcc/testsuite/gcc.dg/guality/pr59776.c
@@ -6,7 +6,7 @@
struct S { float f, g; };
-__attribute__((noinline, noclone)) void
+__attribute__((noipa)) void
foo (struct S *p)
{
struct S s1, s2; /* { dg-final { gdb-test pr59776.c:17 "s1.f" "5.0" } } */