From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain 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: , X-List-Received-Date: Fri, 08 Jul 2022 12:30:44 -0000 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 -- 2.36.1