From patchwork Tue Feb 6 15:21:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 197504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1613510dyb; Tue, 6 Feb 2024 07:22:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFF38W+KNoiLDftBVpF+UO4hf7nL8g4Qn16lwViSvevEyBjLgE4AKnGxtdvhonqTQbyqH7f X-Received: by 2002:a05:620a:305:b0:785:653d:814b with SMTP id s5-20020a05620a030500b00785653d814bmr2582354qkm.67.1707232925589; Tue, 06 Feb 2024 07:22:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707232925; cv=pass; d=google.com; s=arc-20160816; b=BJ3SP6hZWHpKQO3xx8/f1UIdUvEn/H9qG88GUnqXT8A5kVydPhizqNIM4h/uV226/C FQtj1kWRi4t5OqCrtD0INqhck30QAY/Mwov6lVL6TTDEnGL0b8fi9Xj76ZsPbSq3afFE 3DIs6hDE8cFho85URD5UvcS2p733oi2yZ/O5t3wdNW1I5flX3567LeJDPP/vk2x8o9TB jDD5dRJ9Qm2iVtXDnn+QNa0pXBUZgS+6PgTw7imLSLldoUIyceuS+tteBbfB2S1VZn8C 9ooNy3EXrNIbt4GZWgkpBfkQcUEOjBnqdkRDEUwJp4QBugYR82WgkWTJDELCBMjNRY+l YzOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=5UNudku61Z2TJ8dG7U/PwRMYWMOxd2ehz2XmhkuAprs=; fh=grRieJ22ZOI2H3z0ED+Lv6tFrdL3BmQYJpD7cYs+flQ=; b=czjpOzsdODwJECoLlPTOxDgCC6z0H01HYN78Qv/+eIMYx7MwYHya24Cb4Dg2pcausI lWFU39lSQ+eU4YaObBk6TlO9ECMZ/eA3YiXSDoant/fF4Aom8YOUyFCKZAgDik3E1Tn0 KOBjXpouTUALQoNjFTR+sR4oQmEcukbbU8MVOf4AE4Ge6HqWFiNEX9TvjDd8cdd9VZ6a PDICsRytj1e8Gic0/CeSz8rxNbIJM4LvAa6iJiEfU6LZ1EgSX/e6QrM7j9F6AvGRFtBq XgwCMcFmt5KTCSuAXvMEMhfz3CNojDf35Sa0dkOT1KBOk/lZUzMdVmaE+tKkr/c4Gl6R 3jEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Uk5tWUNR; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCVW9zewgbymVN56lcJX6yiW5R/C/h0AvibSE1K+5EN3sUozKMCM8XIBPGJlXxg8tgv1QepFVh+1/NajfGNbvcGXqdNlvw== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u6-20020a05620a084600b00784d531c91esi2410019qku.651.2024.02.06.07.22.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:22:05 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Uk5tWUNR; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DF9F3858D38 for ; Tue, 6 Feb 2024 15:22:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 643573858D33 for ; Tue, 6 Feb 2024 15:21:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 643573858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 643573858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707232885; cv=none; b=MxAOd8NmaPnVfsuNDZBXnIV7a7ZMACcBL5j8axcMXrh2OGbhA2p/VwedfHNptkiQf//ZM7DpoYq+DmgQgj54djwtJWMHV5VQcWDAEk499vDr3urVk0yUu4t7vZ4KqfGtCDRHn6np8jL0No5hTOQCAtqapiCWIipB7yth6+fSIzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707232885; c=relaxed/simple; bh=k1H8DImQbJaxvETPCygREOTBtwKP+I9PomZRdL/Ao7Y=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=MRCjO9Gd+1n4pD6hy2pRlFbgdj+zQkR/PHE33ZV49hV0zj+LIq9eTVUyvZatmVknNq/GcZcN7Kj+ORkw3Hq5VrRb3Bz8GZF6RATEBiD6nHUs4F81Fyp7k4KXrjdbMWFiJTs87RHKpy+dpHiCdM8Iqd+C7MQZDupjDnnudnSioQk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707232883; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=5UNudku61Z2TJ8dG7U/PwRMYWMOxd2ehz2XmhkuAprs=; b=Uk5tWUNRp35WcdhVKn9ZuY6vNr/99NzeH98J7zIlo1IwsFf5LXhYZ15rerjWIqcPGny4f3 khVJWeuavByzMWBl7mCpiY5Ft34ADPTgIBfGJpwks0+7c4qr0zRSMTSPm1UsUBVsQjjxFf pwzEecJ2lx/A3EFjKvxyk5W/vnnpzNM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-PfqPfI1nOYSOhuAYXYbWAw-1; Tue, 06 Feb 2024 10:21:19 -0500 X-MC-Unique: PfqPfI1nOYSOhuAYXYbWAw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5109584AF80; Tue, 6 Feb 2024 15:21:19 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BF43492BF0; Tue, 6 Feb 2024 15:21:18 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 416FLFSR3307788 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 6 Feb 2024 16:21:15 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 416FLEGj3307787; Tue, 6 Feb 2024 16:21:14 +0100 Date: Tue, 6 Feb 2024 16:21:14 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: Richard.Sandiford@arm.com Subject: [committed] aarch64: Fix build against libc++ in c++11 mode [PR113763] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790163472109328970 X-GMAIL-MSGID: 1790163472109328970 Hi! std::pair ctor used in tiles constexpr variable is only constexpr in C++14 and later, it works with libstdc++ because it is marked constexpr there even in C++11 mode. The following patch fixes it by using an unnamed local class instead of std::pair, and additionally changes the first element from unsigned int to unsigned char because 0xff has to fit into unsigned char on all hosts. Bootstrapped/regtested on aarch64-linux, preapproved by Richard in the PR, committed to trunk. 2024-02-06 Jakub Jelinek PR target/113763 * config/aarch64/aarch64.cc (aarch64_output_sme_zero_za): Change tiles element from std::pair to an unnamed struct. Adjust uses of tile range variable. Jakub --- gcc/config/aarch64/aarch64.cc.jj 2024-02-06 08:43:14.899888072 +0100 +++ gcc/config/aarch64/aarch64.cc 2024-02-06 11:41:47.855049148 +0100 @@ -13130,7 +13130,7 @@ aarch64_output_sme_zero_za (rtx mask) if (mask_val == 0xff) return "zero\t{ za }"; - static constexpr std::pair tiles[] = { + static constexpr struct { unsigned char mask; char letter; } tiles[] = { { 0xff, 'b' }, { 0x55, 'h' }, { 0x11, 's' }, @@ -13144,14 +13144,14 @@ aarch64_output_sme_zero_za (rtx mask) const char *prefix = "{ "; for (auto &tile : tiles) { - auto tile_mask = tile.first; + unsigned int tile_mask = tile.mask; unsigned int tile_index = 0; while (tile_mask < 0x100) { if ((mask_val & tile_mask) == tile_mask) { i += snprintf (buffer + i, sizeof (buffer) - i, "%sza%d.%c", - prefix, tile_index, tile.second); + prefix, tile_index, tile.letter); prefix = ", "; mask_val &= ~tile_mask; }