From patchwork Thu Apr 9 12:15:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1268577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48yg8X2zBjz9sP7 for ; Thu, 9 Apr 2020 22:15:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CEA523887010; Thu, 9 Apr 2020 12:15:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 48D85385BF81 for ; Thu, 9 Apr 2020 12:15:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 48D85385BF81 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=hubicka@kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 04962280436; Thu, 9 Apr 2020 14:15:30 +0200 (CEST) Date: Thu, 9 Apr 2020 14:15:29 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Avoid g++.dg/lto/alias-4_0.C test failure on ARM [PR91322] Message-ID: <20200409121529.GA63149@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-38.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, this patch avoid failure of alias-4_0.C testcase. The testcase is testing that ODR TBAA works but structure used conflicts with builtin va_arg type on ARM which disables TBAA for it. Better fix would be to make va_arg types with mangled names in lto1 frontend but that require some extra work, so it is next stage1 material. I thus comitted the following. Honza 2020-04-09 Jan Hubicka PR tree-optimization/91322 * g++.dg/lto/alias-4_0.C: Avoid conflict with va_list on ARM and add a template testing that. diff --git a/gcc/testsuite/g++.dg/lto/alias-4_0.C b/gcc/testsuite/g++.dg/lto/alias-4_0.C index 410c3140baf..3d386324753 100644 --- a/gcc/testsuite/g++.dg/lto/alias-4_0.C +++ b/gcc/testsuite/g++.dg/lto/alias-4_0.C @@ -1,11 +1,14 @@ /* { dg-lto-do run } */ -/* { dg-lto-options { { -O3 -flto -fno-early-inlining } } } */ +/* { dg-lto-options { { -O3 -flto -fno-early-inlining -fdump-ipa-cgraph} } } */ __attribute__ ((used)) short *ptr_init, **ptr=&ptr_init; __attribute__ ((used)) struct a { int *aptr; + /* On ARM va_list is an anonymous structure containing pointer. + This disable ODR TBAA on it. */ + short b; } a, *aptr=&a; void @@ -29,3 +32,6 @@ main() test (); return 0; } +/* On ARM the testcase used to fial because struct a got in conflict with builtin + va_list type. Check that this does not happen. */ +/* { dg-final { scan-wpa-ipa-dump-not "ODR and non-ODR type conflict" "cgraph" } } */