From 225398279594ff4c5a6a8a14df0375d53d8dadf9 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 13 Jul 2018 11:21:04 +0000 Subject: [PATCH] [testsuite, guality] Add -fno-ipa-icf in gcc.dg/guality 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. 2018-07-13 Tom de Vries * 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. From-SVN: r262631 --- gcc/testsuite/ChangeLog | 6 ++++++ 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 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49ca6c527dd..0dcc3b46858 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-07-13 Tom de Vries + + * 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. + 2018-07-13 Tom de Vries * gcc.dg/vla-1.c: Update. 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; }; -- 2.30.2