From patchwork Wed Sep 7 07:47:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terry Guo X-Patchwork-Id: 113716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 53EF4B6F7B for ; Wed, 7 Sep 2011 17:48:16 +1000 (EST) Received: (qmail 25773 invoked by alias); 7 Sep 2011 07:48:12 -0000 Received: (qmail 25760 invoked by uid 22791); 7 Sep 2011 07:48:11 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, MSGID_MULTIPLE_AT, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (217.140.96.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Sep 2011 07:47:46 +0000 Received: from geoffrey.Emea.Arm.com (geoffrey.emea.arm.com [10.1.255.46]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id p877lH11026680; Wed, 7 Sep 2011 08:47:17 +0100 (BST) Received: from cam-owa1.Emea.Arm.com ([10.1.255.62]) by geoffrey.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Sep 2011 08:47:36 +0100 Received: from Terrysh02 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 7 Sep 2011 08:47:21 +0100 From: "Terry Guo" To: Cc: , Subject: [Patch, testsuite] Skip case ipa-sra-2.c for strict_align target. Date: Wed, 7 Sep 2011 15:47:13 +0800 Message-ID: <002701cc6d32$5d6e64d0$184b2e70$@guo@arm.com> MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello, The SRA optimization requires the reference to struct/union member must be aligned to their natural boundary e.g. (int *) must be aligned to 4 byte boundary. This is done in function tree_non_mode_aligned_mem_p. For target like x86 that define "STRICT_ALIGNMENT" to 0, the function return false. Afterward, the SRA is conducted. For target like ARM or MIPS that define "STRICT_ALIGNMENT" to 1, the alignment status is checked by "align = get_object_alignment (exp)". The function get_object_alignment rely on SSA and tend to over-conservative. So for most cases, the SRA is stopped here. This patch intends to skip this case for target that set STRICT_ALIGNMENT to 1 otherwise the case will fail due to the SRA isn't performed actually. OK to commit to trunk? BR, Terry 2011-09-07 Terry Guo * gcc.dg/ipa/ipa-sra-2.c: Only run on targets that are non_strict_align. diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c index 3437a81..c6b4d63 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */ +/* { dg-require-effective-target non_strict_align } */ struct bovid {