From patchwork Fri Jul 8 12:30:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 1654112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=PJpFrJ7t; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=jSC6OuUE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LfXgh6x2qz9ryY for ; Fri, 8 Jul 2022 22:30:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB756384F01E for ; Fri, 8 Jul 2022 12:30:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 3CFDA3858284 for ; Fri, 8 Jul 2022 12:30:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3CFDA3858284 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0E30C1FFD4 for ; Fri, 8 Jul 2022 12:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1657283441; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=lieWoMyLsGX6ibwaJsJYWrzk4BpJflJR8lFgh74dp8I=; b=PJpFrJ7tcvWDJpL2bm0k+kHUtLrvEohqF7fQFD4qqN6QkPwZYs+oXnM9sssNSIcPMUkhfs dXoXh2h+PMpSzncs3qjQC9kjlp0t4+oq5RMGvHy7oJA1wf880dhRo/bKOu8jS/cGkvyUdo jHA7ghbt6S2lBZcAnYfIkInmgG81ZNU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1657283441; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=lieWoMyLsGX6ibwaJsJYWrzk4BpJflJR8lFgh74dp8I=; b=jSC6OuUEfs8Lrhc/OLrirDtAr+3jAme3GJyrR7ivY5pWzWr2gTfYzjlD1iEOl7ks9TNqEA J45BqZ9qqX8jiDBA== Received: from suse.cz (virgil.suse.cz [10.100.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E71E52C141 for ; Fri, 8 Jul 2022 12:30:40 +0000 (UTC) From: Martin Jambor To: GCC Patches Cc: Subject: [PATCH] testsuite: Fix tree-ssa/alias-access-path-13.c on 32bit platforms (PR 106216) User-Agent: Notmuch/0.35 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Fri, 08 Jul 2022 14:30:40 +0200 Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, for gcc.dg/tree-ssa/alias-access-path-13.c to work, SRA must think of accesses to foo.inn.val and to foo itself as different ones, i.e. they need to have different offset and size, which on 32bit platforms they do not. Fixed by replacing a dummy long int field of the union with a struct of two integers. Tested by: make -k check-gcc RUNTESTFLAGS="tree-ssa.exp=alias-access-path-13.c" and make -k check-gcc RUNTESTFLAGS="--target_board=unix'{-m32}' tree-ssa.exp=alias-access-path-13.c" on an x86_64-linux, also with patched SRA to verify it still tests the original intent. I hope the fix is obvious enough (and it is only a testsuite change) that I can commit it myself. Thanks, Martin gcc/testsuite/ChangeLog: 2022-07-08 Martin Jambor PR testsuite/106216 * gcc.dg/tree-ssa/alias-access-path-13.c (union foo): Replace a long int field with a struct that is larger than an int also on 32bit platforms. --- gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c index e502a97bc75..87a94f5bf31 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c @@ -6,10 +6,15 @@ struct inn int val; }; +struct biggerstruct +{ + int a, b; +}; + union foo { struct inn inn; - long int baz; + struct biggerstruct baz; } *fooptr; struct bar