public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: fix build issue with gcc 4.9.x
@ 2023-07-14 2:31 Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2023-07-14 2:31 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0fa11fad2cc147c0c3e4b43309ec656b2a5d6809
commit 0fa11fad2cc147c0c3e4b43309ec656b2a5d6809
Author: Romain Naour <romain.naour@gmail.com>
Date: Tue May 2 14:21:55 2023 +0200
RISC-V: fix build issue with gcc 4.9.x
GCC should still build with GCC 4.8.3 or newer [1]
using C++03 by default. But a recent change in
RISC-V port introduced a C++11 feature "std::log2" [2].
Use log2 from the C header, without the namespace [3].
[1] https://gcc.gnu.org/install/prerequisites.html
[2] https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=7caa1ae5e451e780fbc4746a54e3f19d4f4304dc
[3] https://stackoverflow.com/questions/26733413/error-log2-is-not-a-member-of-std
Fixes:
https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/4202276589
gcc/ChangeLog:
* config/riscv/genrvv-type-indexer.cc: Use log2 from the C header, without
the namespace.
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Diff:
---
gcc/config/riscv/genrvv-type-indexer.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/riscv/genrvv-type-indexer.cc b/gcc/config/riscv/genrvv-type-indexer.cc
index e677b55290c..eebe382d1c3 100644
--- a/gcc/config/riscv/genrvv-type-indexer.cc
+++ b/gcc/config/riscv/genrvv-type-indexer.cc
@@ -115,9 +115,9 @@ same_ratio_eew_type (unsigned sew, int lmul_log2, unsigned eew, bool unsigned_p,
if (sew == eew)
elmul_log2 = lmul_log2;
else if (sew > eew)
- elmul_log2 = lmul_log2 - std::log2 (sew / eew);
+ elmul_log2 = lmul_log2 - log2 (sew / eew);
else /* sew < eew */
- elmul_log2 = lmul_log2 + std::log2 (eew / sew);
+ elmul_log2 = lmul_log2 + log2 (eew / sew);
if (float_p)
return floattype (eew, elmul_log2);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: fix build issue with gcc 4.9.x
@ 2023-05-25 23:15 Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2023-05-25 23:15 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:01f170237275af78085653dba10a4939fd4bbe93
commit 01f170237275af78085653dba10a4939fd4bbe93
Author: Romain Naour <romain.naour@gmail.com>
Date: Tue May 2 14:21:55 2023 +0200
RISC-V: fix build issue with gcc 4.9.x
GCC should still build with GCC 4.8.3 or newer [1]
using C++03 by default. But a recent change in
RISC-V port introduced a C++11 feature "std::log2" [2].
Use log2 from the C header, without the namespace [3].
[1] https://gcc.gnu.org/install/prerequisites.html
[2] https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=7caa1ae5e451e780fbc4746a54e3f19d4f4304dc
[3] https://stackoverflow.com/questions/26733413/error-log2-is-not-a-member-of-std
Fixes:
https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/4202276589
gcc/ChangeLog:
* config/riscv/genrvv-type-indexer.cc: Use log2 from the C header, without
the namespace.
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Diff:
---
gcc/config/riscv/genrvv-type-indexer.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/riscv/genrvv-type-indexer.cc b/gcc/config/riscv/genrvv-type-indexer.cc
index e677b55290c..eebe382d1c3 100644
--- a/gcc/config/riscv/genrvv-type-indexer.cc
+++ b/gcc/config/riscv/genrvv-type-indexer.cc
@@ -115,9 +115,9 @@ same_ratio_eew_type (unsigned sew, int lmul_log2, unsigned eew, bool unsigned_p,
if (sew == eew)
elmul_log2 = lmul_log2;
else if (sew > eew)
- elmul_log2 = lmul_log2 - std::log2 (sew / eew);
+ elmul_log2 = lmul_log2 - log2 (sew / eew);
else /* sew < eew */
- elmul_log2 = lmul_log2 + std::log2 (eew / sew);
+ elmul_log2 = lmul_log2 + log2 (eew / sew);
if (float_p)
return floattype (eew, elmul_log2);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-14 2:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 2:31 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: fix build issue with gcc 4.9.x Jeff Law
-- strict thread matches above, loose matches on Subject: below --
2023-05-25 23:15 Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).