From patchwork Thu Nov 12 15:07:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andre Vieira (lists)" X-Patchwork-Id: 543382 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A36EF1409C4 for ; Fri, 13 Nov 2015 02:07:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=SxYc5e7N; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=rKvcDRwfBXeTD4ar72t9wESCSiKAbcDp1/pOq8f/SLvFC7Rd2/ RtDbe1H6NqVxztc8E7zxUcWn14YR64itUX4CrH4USJAKNdAeILIrBg+KjRzqJ225 RHR8TGID0bptU2+TCxC3uc+0vtjRgMgMuIdSEYbx9yDw8aoZd40ZQd3Uc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=7SDZKEE3cofqSk/MIIuLbsRpn0w=; b=SxYc5e7N5mlolUWAna8x NNasAonbeSn/BjWXv/jndwKIE2YfHhiuKZ0BsKs4TiLirfIOMumGqn1SgBDqXDjk szpCEpYEoJ1oM/ik7RwIfilv87pLjf9DE3dKzZ9acSpf/utw0+Bowx7mwqgiJsfX Qjb9Zegf+LvhG6rVPScydT8= Received: (qmail 63814 invoked by alias); 12 Nov 2015 15:07:42 -0000 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 Received: (qmail 63802 invoked by uid 89); 12 Nov 2015 15:07:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Nov 2015 15:07:40 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-15-_96RsmnkSWKGLyQCo5mANA-1; Thu, 12 Nov 2015 15:07:35 +0000 Received: from [10.2.206.221] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Nov 2015 15:07:35 +0000 To: GCC Patches From: Andre Vieira Subject: [PATCH][GCC] Make stackalign test LTO proof Message-ID: <5644AB37.3050201@arm.com> Date: Thu, 12 Nov 2015 15:07:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-MC-Unique: _96RsmnkSWKGLyQCo5mANA-1 X-IsSubscribed: yes Hi, This patch changes this testcase to make sure LTO will not optimize away the assignment of the local array to a global variable which was introduced to make sure stack space was made available for the test to work. This is correct because LTO is supposed to optimize this global away as at link time it knows this global will never be read. By adding a read of the global, LTO will no longer optimize it away. Tested by running regressions for this testcase for various ARM targets. Is this OK to commit? Thanks, Andre Vieira gcc/testsuite/ChangeLog: 2015-11-06 Andre Vieira * gcc.dg/torture/stackalign/builtin-return-1.c: Added read to global such that a write is not optimized away by LTO. From 6fbac447475c3b669baee84aa9d6291c3d09f1ab Mon Sep 17 00:00:00 2001 From: Andre Simoes Dias Vieira Date: Fri, 6 Nov 2015 13:13:47 +0000 Subject: [PATCH] keep the stack testsuite fix --- gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c index af017532aeb3878ef7ad717a2743661a87a56b7d..1ccd109256de72419a3c71c2c1be6d07c423c005 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c +++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c @@ -39,5 +39,10 @@ int main(void) if (bar(1) != 2) abort(); + /* Make sure there is a read of the global after the function call to bar + * such that LTO does not optimize away the assignment above. */ + if (g != dummy) + abort(); + return 0; } -- 1.9.1