From patchwork Mon Oct 25 18:53:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 46641 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D302B385AC1A for ; Mon, 25 Oct 2021 18:53:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 7632B3857419 for ; Mon, 25 Oct 2021 18:53:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7632B3857419 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: wbrJp6g83cvhDr5AKQlKKIEbt8ceRrKjtNns43zfsHnqh4eACJ3OpoF4nEZcuDyDXBYfK5apeN 3dFlywm7akCYQIrM2PlLiDpGk62LMDAjuEHzo+OzhN7q+YtT8GSSxXZ9VBB7nw/4MzY0ioCsZO v6LsfKq7FDAbYZw+DGV81vJOk97DRUpCEYa3oNOXM/X/uUbQ9WL45yQEXMF+fR7YWhpiHXjxOy NBqzSsU9pX5N14xhRAVaISJkh+CaW6Uuy0qSdY9VfLDgi1C8NVmtK6RAZZzYGqRzAAq1GczUfb N3Zgya4RE0vE7Lil1oqpOxpu X-IronPort-AV: E=Sophos;i="5.87,181,1631606400"; d="diff'?scan'208";a="67460878" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 25 Oct 2021 10:53:32 -0800 IronPort-SDR: LkGBkn8pol/REDW4REq5mvj3Q/20mWlFA/p6mONh6AperSN1flBemhRFl5/eN/X7ASzXZvFrxK 6fzkvsbNEXTN1VgBeDaU0hPKHA/kGfICOvlkt2HJlT2NBwwU28WbRV0YmwVGXP8ubRpYy30pXM 2tM+/x6I0mtVnKoT95cdl7yrIoY2Fdo/xr1sQammELMdh8xvfLv6a9hrilhPO+Rrirys+h3R4U E2mvyz9QUCFnjIwpA4R+hch0zqHgeWWW/AX1ee26qqeeOvxC+YFUWO4SxfIS1xOAl/+tCvgZuT TWo= Message-ID: <6a13dcc8-06c9-2d33-4ed0-4c25593aaa7e@codesourcery.com> Date: Mon, 25 Oct 2021 20:53:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Content-Language: en-US To: gcc-patches From: Tobias Burnus Subject: [committed] libgomp.oacc-c-c++-common/loop-gwv-2.c: Use __builtin_alloca X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" In PR testsuite/102910 there was some discussion about alloca.h and whether that header exists or whether 'alloca' is provided by stdlib.h or ... Well, some grepping showed that libgomp.oacc-c-c++-common/loop-gwv-2.c also used 'alloca'. Solution: Do it like other testcases and use __builtin_alloca. (I think this will fail on nvptx, but otherwise it should now pass on more systems.) I have only tested it on x86-64, where it passed before and after, but I do see in gcc-testresults@ fails (even though I don't know whether those fails are for this issue or others). Committed as Rev. r12-4691. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 commit 72dc270be793f159a3a038bef41542d85550b331 Author: Tobias Burnus Date: Mon Oct 25 20:40:13 2021 +0200 libgomp.oacc-c-c++-common/loop-gwv-2.c: Use __builtin_alloca Some systems do not have but provide alloca differently, e.g. via stdlib.h. Do it like other testcases do and use __builtin_alloca. libgomp/ChangeLog: PR testsuite/102910 * testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c: Use __builtin_alloca instead of #include + alloca. --- libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c index cb3878b8d4e..e73ed6064eb 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -78,9 +77,9 @@ int main () vectorsize = __builtin_goacc_parlevel_size (GOMP_DIM_VECTOR); } - gangdist = (int *) alloca (gangsize * sizeof (int)); - workerdist = (int *) alloca (workersize * sizeof (int)); - vectordist = (int *) alloca (vectorsize * sizeof (int)); + gangdist = (int *) __builtin_alloca (gangsize * sizeof (int)); + workerdist = (int *) __builtin_alloca (workersize * sizeof (int)); + vectordist = (int *) __builtin_alloca (vectorsize * sizeof (int)); memset (gangdist, 0, gangsize * sizeof (int)); memset (workerdist, 0, workersize * sizeof (int)); memset (vectordist, 0, vectorsize * sizeof (int));