From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74178 invoked by alias); 6 Aug 2019 15:43:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 74123 invoked by uid 89); 6 Aug 2019 15:43:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=HX-detected-operating-system:timestamps X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Aug 2019 15:43:34 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hv1cZ-0007LX-HT for gcc-patches@gcc.gnu.org; Tue, 06 Aug 2019 11:43:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:45224 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hv1cZ-0007KB-6p for gcc-patches@gcc.gnu.org; Tue, 06 Aug 2019 11:43:31 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B08E4B60F for ; Tue, 6 Aug 2019 15:43:26 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Tue, 6 Aug 2019 17:43:26 +0200 Resent-Message-ID: <07e51dad-1d0a-3080-8e2f-11f4e22e80ce@suse.cz> Message-Id: <91e6b40a92a78aba00fe73f307882430ed474032.1565105737.git.mliska@suse.cz> In-Reply-To: References: From: Martin Liska Date: Tue, 06 Aug 2019 15:43:00 -0000 Subject: [PATCH 9/9] Remove alias set comparison. To: gcc-patches@gcc.gnu.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.22.0" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00380.txt.bz2 This is a multi-part message in MIME format. --------------2.22.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: quoted-printable Content-length: 841 gcc/ChangeLog: 2019-07-24 Martin Liska * ipa-icf-gimple.c (func_checker::compatible_types_p): Do not compare alias sets. It's handled by operand_equal_p. gcc/testsuite/ChangeLog: 2019-07-24 Martin Liska * c-c++-common/Wstringop-truncation-4.c: Disable IPA ICF. * gcc.dg/tree-ssa/pr64910-2.c: Likewise. * gcc.dg/tree-ssa/pr79352.c: Likewise. * gcc.dg/ipa/ipa-icf-40.c: New test. --- gcc/ipa-icf-gimple.c | 12 ------- .../c-c++-common/Wstringop-truncation-4.c | 2 +- gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c | 32 +++++++++++++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr64910-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr79352.c | 2 +- 5 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c --------------2.22.0 Content-Type: text/x-patch; name="0009-Remove-alias-set-comparison.patch" Content-Disposition: attachment; filename="0009-Remove-alias-set-comparison.patch" Content-Transfer-Encoding: quoted-printable Content-length: 3704 diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index 375aadad412..751d5859706 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "data-streamer.h" #include "gimple-pretty-print.h" -#include "alias.h" #include "fold-const.h" #include "gimple-iterator.h" #include "ipa-utils.h" @@ -209,17 +208,6 @@ func_checker::compatible_types_p (tree t1, tree t2) if (!types_compatible_p (t1, t2)) return return_false_with_msg ("types are not compatible"); =20 - /* We do a lot of unnecesary matching of types that are not being - accessed and thus do not need to be compatible. In longer term we sh= ould - remove these checks on all types which are not accessed as memory - locations. - - For time being just avoid calling get_alias_set on types that are not - having alias sets defined at all. */ - if (type_with_alias_set_p (t1) && type_with_alias_set_p (t2) - && get_alias_set (t1) !=3D get_alias_set (t2)) - return return_false_with_msg ("alias sets are different"); - return true; } =20 diff --git a/gcc/testsuite/c-c++-common/Wstringop-truncation-4.c b/gcc/test= suite/c-c++-common/Wstringop-truncation-4.c index c76f2823daf..15209536add 100644 --- a/gcc/testsuite/c-c++-common/Wstringop-truncation-4.c +++ b/gcc/testsuite/c-c++-common/Wstringop-truncation-4.c @@ -3,7 +3,7 @@ Verify that -Wstringop-truncation is issued for uses of arrays and pointers to qualified forms of characters of all three types. { dg-do compile } - { dg-options "-O2 -Wall -Wstringop-truncation" } */ + { dg-options "-O2 -Wall -Wstringop-truncation -fno-ipa-icf" } */ =20 #if __cplusplus extern "C" diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c b/gcc/testsuite/gcc.dg/i= pa/ipa-icf-40.c new file mode 100644 index 00000000000..8d512cbc7d3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-icf" } */ + +struct A { int i; char a1[10]; }; +struct B { int i; char a3[30]; }; +struct C { int i; char ax[]; }; + +static int +__attribute__((noinline)) +test_array_1 (int i, struct A *a) +{ + return __builtin_printf ("%-s\n", a->a1); +} + +static int +__attribute__((noinline)) +test_array_3 (int i, struct B *b) +{ + return __builtin_printf ("%-s\n", b->a3); +} + +struct A a =3D { 0, "foo" }; +struct B b =3D { 0, "bar" }; + +int main() +{ + test_array_1 (0, &a); + test_array_3 (0, &b); + return 0; +} + +/* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr64910-2.c b/gcc/testsuite/gcc.= dg/tree-ssa/pr64910-2.c index 2e3d6790776..812bfa48825 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr64910-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr64910-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-reassoc1" } */ +/* { dg-options "-O2 -fdump-tree-reassoc1 -fno-ipa-icf" } */ =20 /* We want to make sure that we reassociate in a way that has the constant last. With the constant last, it's more likely to result diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr79352.c b/gcc/testsuite/gcc.dg= /tree-ssa/pr79352.c index 485e2d64cb3..36e195c3a06 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr79352.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr79352.c @@ -1,7 +1,7 @@ /* PR tree-optimization/79352 - -fprintf-return-value doesn't handle flexible-like array members properly { dg-do compile } - { dg-options "-O2 -fdump-tree-optimized" } */ + { dg-options "-O2 -fdump-tree-optimized -fno-ipa-icf" } */ =20 struct A { int i; char a1[1]; }; struct B { int i; char a3[3]; }; --------------2.22.0--