From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id DACA63858D1E for ; Wed, 3 May 2023 00:48:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DACA63858D1E 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-pg1-x529.google.com with SMTP id 41be03b00d2f7-51b4ef5378bso3892168a12.1 for ; Tue, 02 May 2023 17:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683074880; x=1685666880; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LjtW47SIv6G4d/xx+YIZGjJNI6OyhnbVyuNO0kNmR0A=; b=CuveAJ+jrVK6dZfm+f+yr6Gd6v5RvYa/4qDk9GgtCm2vF9mkqUGNUKS8n+lIv7f904 MNjEPlKO35EOD+KTn8HTvHcBlzENEp6G/QXSA6InHir/DY3OATxB8+pO+/hD8qOsEDp1 44GOHfLPyIp2eqRRMPdEyNvUDkS2a7kPlkHDop03tmeZsr8XOykI4Ter8iKI1p8XKNcU TimFeHVwgg3wtmCdpAVUGfo9DGECu+TwOuoShjxuO+MXzKK80Xc/KGNlNoL+TAWSVFZU X579biPMLgMmyVmtTkKcHc6aTAaYDgkdDftwmHVcaGeUDM5Uk/3jw6841Jr2r3fFphW/ j+Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683074880; x=1685666880; h=content-transfer-encoding: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=LjtW47SIv6G4d/xx+YIZGjJNI6OyhnbVyuNO0kNmR0A=; b=KbMoSyJ9WCdx4JOiEKicTxM+GrtQIrfvwtpgLkkW03kqBk3MD2tQQzbJR3LdPHfLMl MZrf4biWG+ep1AkWy3wUKEy7TY83OprecFd9FwWi/YM6IDT0iyUCt+ph587CUO1BlESN Jy1daS8zRC3ePTeZtVTKCJCZLXmGUplkLZYl5KKSH5/Un2raSPF0b4Iafjf6WCr+ILHX vL8/X+6txd1esgBQ079sQrFTyQeel6rBDoNCHXM/YTlwraOw+j8ITTv+Hno2RrZTK485 yNzBttgzdiIpRexFapYrA0mjAm5W2q9oeqc/DvDEpLutGGCLucolYntLJUQSChzuYhVu KEhw== X-Gm-Message-State: AC+VfDyiT3+dTT9MZdv7Zln8EoPrD9clXZu68fAH788wB2YxHBcN2bJ1 wN/oaudTZiV1XpNhOlbsG+FwGqMTqUaW3iOLOCc= X-Google-Smtp-Source: ACHHUZ5VfZYWLx+6l7oOd5DWWDv/Y+tvcEnnzfcIYrHtXiyH6TsHzSkyExhrKiD1XdO1HZ74/8dtWGei4hVdlwE08Ao= X-Received: by 2002:a05:6a20:a68d:b0:f0:929c:e8c5 with SMTP id ba13-20020a056a20a68d00b000f0929ce8c5mr21106539pzb.35.1683074879765; Tue, 02 May 2023 17:47:59 -0700 (PDT) MIME-Version: 1.0 References: <20230502122155.2576725-1-romain.naour@gmail.com> In-Reply-To: From: Andrew Pinski Date: Tue, 2 May 2023 17:47:47 -0700 Message-ID: Subject: Re: [PATCH] RISC-V: fix build issue with gcc 4.9.x To: Kito Cheng Cc: Romain Naour , Jeff Law , gcc-patches@gcc.gnu.org, kito.cheng@sifive.com, juzhe.zhong@rivai.ai Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 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: On Tue, May 2, 2023 at 5:38=E2=80=AFPM Kito Cheng via Gcc-patches wrote: > > > >>> 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 fai= l 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. No libstdc++ was specifically fixed in GCC 6 to do the correct thing, see PR 60401 and PR 14608 (r6-6392-g96e19adabc80146648825). Thanks, Andrew Pinski > > > 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 > >