From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) by sourceware.org (Postfix) with ESMTPS id 4253C3858D20 for ; Wed, 3 May 2023 00:37:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4253C3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-xa2d.google.com with SMTP id 71dfb90a1353d-4405fb5c314so3015919e0c.2 for ; Tue, 02 May 2023 17:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683074252; x=1685666252; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NKV9wFGTK/nT5aUZpJX9IV4SInro17jyI8raZ0TB3Ho=; b=HOIn2044Q1ppSMRv2Dl+j6FhXqTnyC39fskXiRwF18mNTYnJB0KME54CIGBIQJBEDb z5yW4c99BEgq7oS8pSarNoOYI/KlFuYhcgF5gRNZ2Pcn04ikfUdTD3TDB+JVCagC3Vcr tcr0qNDhjc8t2w5KfBl1vxAzTzqeTuQN/NfxWFOLWDgLsVBvOJKXgV/BvhRpBi/Dox4x g2jddRoqd3Pa/G7nsJ/zwIfha+lS7R16FdpCxF675jyau0ppqe7j7VePwzQRfEX5TMJZ lWlvpc6V0UlwL9e3ENTS7HBKY6wBjS0lkz+zCc9W+K9fBs+wi0MA0NE0wZMD6VOg/QVg ZKGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683074252; x=1685666252; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NKV9wFGTK/nT5aUZpJX9IV4SInro17jyI8raZ0TB3Ho=; b=ae9JyWJeUUaVUqFSSmg5JkLVrG08oTWfkQBPSllapZi8hj+uyqm5M3Ci40M68yJeLD ECoB7QwZXht+aHEsFRqiXaQMxhPTq/aN0if42zPnTWOiOcZs2IVDoLN8+jz4BFSXswQ9 AL0AovcBFSzDfWrm89MX2nndtCpxO535AsSWu1R/yr+VGrItdgtZYbEkNKu9BWSTc7Jc DupcQW8U8XNfMu7cSHe8i+7H0D2Fc0m/O/KBjpsxSAzWPu/dIV0m9SiaTNWOVFZNO4/H BwRxb1F7mJMUfYMm0hOl9ljGuVKKAq46eiqvEQJQWhgC+hEsZI3Dkrc9ZJMFhY+G9Faf Xzyw== X-Gm-Message-State: AC+VfDzPeXwsGBoMYvblAAA1v4689vkKTOffvHz0tZLZqkX15TRfO9fQ dyey+c0FlmAo9+AvH3sgTQGL5lVZZpNoq/vxThg= X-Google-Smtp-Source: ACHHUZ70KlaXek5z4ye2L7SSqa/eeL/xMp1uw+wDi5aAShAD1QSu8yCwanjdC/GdsbUhp2Lw8nDN7tyJ0L+WNsdZTUc= X-Received: by 2002:a05:6102:11a:b0:42c:59ad:1bc2 with SMTP id z26-20020a056102011a00b0042c59ad1bc2mr616337vsq.33.1683074252400; Tue, 02 May 2023 17:37:32 -0700 (PDT) MIME-Version: 1.0 References: <20230502122155.2576725-1-romain.naour@gmail.com> In-Reply-To: From: Kito Cheng Date: Wed, 3 May 2023 08:37:21 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: fix build issue with gcc 4.9.x To: Romain Naour Cc: Jeff Law , gcc-patches@gcc.gnu.org, kito.cheng@sifive.com, juzhe.zhong@rivai.ai Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: > >>> Pushed to trunk, thanks for catching that, that's definitely should > >>> use log2 no matter C++03 or C++11, > >>> but I think GCC allows the usage of C++11 according to > >>> https://gcc.gnu.org/install/prerequisites.html :P > >> Yes, we should be able to use C++11. I'd like to get that to C++17 at > >> some point, but I think the biggest problem is the desire to support > >> bootstrapping on something like centos7/rhel7. > > > > At least we have auto and range based for loop, I am satisfied with > > that enough. > > Indeed, gcc 4.9 already support C++11 but for some reason std::log2 fail with > it. Probably because gcc 4.9 is the last gcc release with C++03 used by default. > I wasn't able to reproduce the build issue (without my patch) with gcc 10 or 11. Anyway I think your fix is reasonable since we include math.h not cmath.h here, so use without std:: is rightway, but don't know why it is build-able with newer GCC, I guess that might be included by some other header indirectly. > I'm fine with new prerequisites for the next gcc release, I checked the release > note about that. I noticed that all toolchains I've built with gcc 13.1 for > other cpu target where successful with the same setup (docker image). > > Thanks! > > Best regards, > Romain > > > > > > >> > >> jeff >