This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][testsuite, guality] Add -fno-ipa-icf in gcc.dg/guality


Hi,

Optimization fipa-icf breaks debug info (as is noted in PR63572 - "ICF
breaks user debugging experience"), which make guality tests clztest.c,
ctztest.c and sra-1.c unsupported for option combination "-O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects".  F.i., in clztest.c foo and bar are
merged, and gdb can set a breakpoint on a line in foo, but trying to set a
breakpoint on a line in bar results in a breakpoint in main instead.

This patch works around the problem by adding -fno-ipa-icf (as is already done
in csttest.c and pr43077-1.c) to those testcases:
...
-UNSUPPORTED: gcc.dg/guality/clztest.c ... line . g == f
+PASS:        gcc.dg/guality/clztest.c ... line . g == f
-UNSUPPORTED: gcc.dg/guality/ctztest.c ... line . g == f
+PASS:        gcc.dg/guality/ctztest.c ... line . g == f
-UNSUPPORTED: gcc.dg/guality/sra-1.c ... line .+1 a[0] == 4
+PASS:        gcc.dg/guality/sra-1.c ... line .+1 a[0] == 4
-UNSUPPORTED: gcc.dg/guality/sra-1.c ... line . a[1] == 14
+PASS:        gcc.dg/guality/sra-1.c ... line . a[1] == 14
...

Tested on x86_64.

OK for trunk?

Thanks,
- Tom

[testsuite, guality] Add -fno-ipa-icf in gcc.dg/guality

2018-07-13  Tom de Vries  <tdevries@suse.de>

	* gcc.dg/guality/clztest.c: Add -fno-ipa-icf in dg-options.
	* gcc.dg/guality/ctztest.c: Same.
	* gcc.dg/guality/sra-1.c: Same.

---
 gcc/testsuite/gcc.dg/guality/clztest.c | 2 +-
 gcc/testsuite/gcc.dg/guality/ctztest.c | 2 +-
 gcc/testsuite/gcc.dg/guality/sra-1.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/guality/clztest.c b/gcc/testsuite/gcc.dg/guality/clztest.c
index f89c1c31a15..69527561c22 100644
--- a/gcc/testsuite/gcc.dg/guality/clztest.c
+++ b/gcc/testsuite/gcc.dg/guality/clztest.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
-/* { dg-options "-g" } */
+/* { dg-options "-g -fno-ipa-icf" } */
 
 volatile int vv;
 
diff --git a/gcc/testsuite/gcc.dg/guality/ctztest.c b/gcc/testsuite/gcc.dg/guality/ctztest.c
index 5ce6c674be3..276752ac986 100644
--- a/gcc/testsuite/gcc.dg/guality/ctztest.c
+++ b/gcc/testsuite/gcc.dg/guality/ctztest.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
-/* { dg-options "-g" } */
+/* { dg-options "-g -fno-ipa-icf" } */
 
 volatile int vv;
 
diff --git a/gcc/testsuite/gcc.dg/guality/sra-1.c b/gcc/testsuite/gcc.dg/guality/sra-1.c
index a747bc302aa..8ad57cf3f8e 100644
--- a/gcc/testsuite/gcc.dg/guality/sra-1.c
+++ b/gcc/testsuite/gcc.dg/guality/sra-1.c
@@ -1,6 +1,6 @@
 /* PR debug/43983 */
 /* { dg-do run } */
-/* { dg-options "-g" } */
+/* { dg-options "-g -fno-ipa-icf" } */
 
 struct A { int i; int j; };
 struct B { int : 4; int i : 12; int j : 12; int : 4; };


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]