From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 80FC13857036 for ; Tue, 5 Jan 2021 17:16:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 80FC13857036 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-VA3hwyynN0OZjyE0Xksnnw-1; Tue, 05 Jan 2021 12:16:21 -0500 X-MC-Unique: VA3hwyynN0OZjyE0Xksnnw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 991D78144E3; Tue, 5 Jan 2021 17:16:20 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-95.phx2.redhat.com [10.3.114.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56FE35D735; Tue, 5 Jan 2021 17:16:20 +0000 (UTC) Subject: Re: add alignment to enable store merging in strict-alignment targets To: Alexandre Oliva , gcc-patches@gcc.gnu.org References: From: Jeff Law Message-ID: <21fc71a7-dc20-ba7a-1214-cedd120a6dd5@redhat.com> Date: Tue, 5 Jan 2021 10:16:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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: , X-List-Received-Date: Tue, 05 Jan 2021 17:16:24 -0000 On 1/5/21 12:46 AM, Alexandre Oliva wrote: > In g++.dg/opt/store-merging-2.C, the natural alignment of types T and > S is a single byte, so we shouldn't expect store merging on > strict-alignment platforms. Indeed, without something like the > adjust-alignment pass to bump up the alignment of the automatic > variable, as in GCC 10, the optimization does not occur. > > This patch adjusts the test so that the required alignment is > expressly stated, and so we don't rely on its accidentally being there > to get the desired optimization. > > Regstrapped on x86_64-linux-gnu, also tested on x-arm-wrs-vxworks7r2. > Ok to install? > > > for gcc/testsuite/ChangeLog > > * g++.dg/opt/store-merging-2.C: Add the required alignment. OK jeff