From patchwork Tue Oct 23 13:30:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preudhomme X-Patchwork-Id: 149449 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp703639ljp; Tue, 23 Oct 2018 06:31:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV62ZKdfi3MsKgsy0HqYn0jLRdqKimvvqmMSOWDkS0Ka2Mk5yrlzwuq98BvHJjRpIrTV5Eds2 X-Received: by 2002:a63:ac02:: with SMTP id v2-v6mr46885112pge.414.1540301466900; Tue, 23 Oct 2018 06:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540301466; cv=none; d=google.com; s=arc-20160816; b=r8eWdEubjIhJEXyuycEq4PKOQF1eLreHTEFTnDNXK56cT56OuQABKo5y0nFtgMnf9f /BraPN+oZD72YM/jyuFpFClO4UKFDP1CPH6G6d55UXcLX3VPtdNbPXX6FG2jOCY85QZB hmZvS7KSYa9PmWwyjuJS25/gZxpBrq0YH+V3qY0tlj8po2KjzOQNOJ5pmM5U3nCIYU5J xYrJtzTZVXe2rk3YWg4znfWYgZLv7BxEOF4Dk0vgPrU1lG3Kj176+W1/ywa891Pi/qfR dptH/VngH9cWmaxYuf/Qds6smeOAdVsh4KGMmVrxNo3/HExqjQwsgIa3hanZllHxVxZ/ hoQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=9qcy8OfMoLzQyu8YIHyX8XoJ/j1dhzZ7lP+Yf/cFZME=; b=xBnhczB2WHwOUBhE7LpWZCiorIC3tA7+ZCON9gis+AGMXmYoQ5V1ffXmBtRTFhXv4g 717fnmkhv4P+DPP97rIMzD7hu5NqpuMTbASeVQhOeFrmdazPxfoeM2wGBde+zheerAS9 7hlTVkhjtGEQuUHqkUE+JxXSjXJ8UScJrT11W68Eavg+ECZQCWZYTz2EvOf7zPqYQxhp woLztVviablI+BOADoScj1I3ddkfQr/oXvc+5dTJ/KClSM672PeMKYFhn4KL05tslYSh o54OE8Faa+MF6a50WGvlXZpO1RmrrRkFaBXVuy7/SI6bYqXUBEP/AR6NLkMwZ/K3Pfe2 L34g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=LjpcUGyB; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="ECFQsO6/"; spf=pass (google.com: domain of gcc-patches-return-488130-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-488130-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w90-v6si1313786pfk.208.2018.10.23.06.31.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 06:31:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-488130-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=LjpcUGyB; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="ECFQsO6/"; spf=pass (google.com: domain of gcc-patches-return-488130-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-488130-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=BR+gXNDKk3XUiZnpRFpxpRlvh6N2+0CCSZc2uhCKeFb3E6 idWS7tc/wsqWNQ6wsILvl3G7KXgnVh3JuupSbBhtpfG7MqkaW1LZc0YLVS0dDeRb WREIuZdAG28J+jUjB22fW+lSVZV8Liq6jjKQUIOutIqSTB/r6nK4hHio7mGuM= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=ApJ7sd5MxdbOmpISzMLL6Kd9D6o=; b=LjpcUGyBr7bSuV6dSs/W 2lex2AOPB7CUbhloDwAW8ZRHLc3JrNGz0dzdTTvui43TtDNbtLwYhAu+OjV2dGps R0NRnQNaB7ZnEowobd560aP2X4BsEGUFQJ28KF484niHS7uSY1ytb+XVaVUNzaTZ Zmpp4KOq4uet1zSkhtzlFZk= Received: (qmail 88740 invoked by alias); 23 Oct 2018 13:30:52 -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 88623 invoked by uid 89); 23 Oct 2018 13:30:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= X-HELO: mail-it1-f174.google.com Received: from mail-it1-f174.google.com (HELO mail-it1-f174.google.com) (209.85.166.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Oct 2018 13:30:22 +0000 Received: by mail-it1-f174.google.com with SMTP id 134-v6so1881321itz.2 for ; Tue, 23 Oct 2018 06:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=PHvuNqObV7CucmvsevtXBMa3k5ZssSjbgPip4vky5us=; b=ECFQsO6/K0ViPLp6sRILC8bf0hm6hiq/UqmZKcQMPnL6r83rlYNRKgcYfdUvGdtGLA E6ceY7SoHYSTnHKsYb89sn/Q1B7w4f1zLPBliIyyFuoF7rEqhONkFfPv7/l9MpD+Br7I 0Q/2Ww5d0SFnOe3WjFtt1YXLMFGuMHZVPrMYs= MIME-Version: 1.0 From: Thomas Preudhomme Date: Tue, 23 Oct 2018 14:30:01 +0100 Message-ID: Subject: [PATCH, testsuite] Fix sibcall-9 and sibcall-10 with -fPIC To: Rainer Orth , Mike Stump , Jakub Jelinek , gcc-patches@gcc.gnu.org X-IsSubscribed: yes Hi, gcc.dg/sibcall-9.c and gcc.dg/sibcall-10.c give execution failure on ARM when compiled with -fPIC due to the PIC access to volatile variable v creating an extra spill which causes the frame size of the two recursive functions to be different. Making the variable static solve the issue because the variable can be access in a PC-relative way and avoid the spill, while still testing sibling call as originally intended. ChangeLog entry is as follows: *** gcc/testsuite/ChangeLog *** * gcc.dg/sibcall-9.c: Make v static. * gcc.dg/sibcall-10.c: Likewise. Tested both testcase with and without -fPIC and it now passes in both case when targeting arm-none-eabi. It also passes in both cases on x86_64-linux-gnu. Is this ok for trunk? Best regards, Thomas >From 27286120fe2d6a088d14d7e4f4b5b6fa6cc2bc41 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Tue, 23 Oct 2018 14:01:31 +0100 Subject: [PATCH] [PATCH, testsuite] Fix sibcall-9 and sibcall-10 with -fPIC Hi, gcc.dg/sibcall-9.c and gcc.dg/sibcall-10.c give execution failure on ARM when compiled with -fPIC due to the PIC access to volatile variable v creating an extra spill which causes the frame size of the two recursive functions to be different. Making the variable static solve the issue because the variable can be access in a PC-relative way and avoid the spill, while still testing sibling call as originally intended. ChangeLog entry is as follows: *** gcc/testsuite/ChangeLog *** * gcc.dg/sibcall-9.c: Make v static. * gcc.dg/sibcall-10.c: Likewise. Tested both testcase with and without -fPIC and it now passes in both case when targeting arm-none-eabi. It also passes in both cases on x86_64-linux-gnu. Is this ok for trunk? Best regards, Thomas --- gcc/testsuite/gcc.dg/sibcall-10.c | 2 +- gcc/testsuite/gcc.dg/sibcall-9.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/sibcall-10.c b/gcc/testsuite/gcc.dg/sibcall-10.c index 54cc604aecf..4acca50e3e4 100644 --- a/gcc/testsuite/gcc.dg/sibcall-10.c +++ b/gcc/testsuite/gcc.dg/sibcall-10.c @@ -31,7 +31,7 @@ extern void exit (int); static ATTR void recurser_void1 (void); static ATTR void recurser_void2 (void); extern void track (void); -volatile int v; +static volatile int v; int n = 0; int main () diff --git a/gcc/testsuite/gcc.dg/sibcall-9.c b/gcc/testsuite/gcc.dg/sibcall-9.c index fc3bd9dcf16..32b2e1d5d61 100644 --- a/gcc/testsuite/gcc.dg/sibcall-9.c +++ b/gcc/testsuite/gcc.dg/sibcall-9.c @@ -31,7 +31,7 @@ extern void exit (int); static ATTR void recurser_void1 (int); static ATTR void recurser_void2 (int); extern void track (int); -volatile int v; +static volatile int v; int main () { -- 2.19.1