[gcc(refs/vendors/riscv/heads/gcc-15-with-riscv-opts)] [RISC-V][PR target/119865] Don't free ggc allocated memory
Jeff Law
law@gcc.gnu.org
Fri Jan 30 06:31:34 GMT 2026
https://gcc.gnu.org/g:ebf278ebf5d7de7b144990a8ef1031db846ebbe7
commit ebf278ebf5d7de7b144990a8ef1031db846ebbe7
Author: Jeff Law <jlaw@ventanamicro.com>
Date: Sat Apr 19 12:35:29 2025 -0600
[RISC-V][PR target/119865] Don't free ggc allocated memory
Kaiweng's patch to stop freeing riscv_arch_string was correct, but incomplete
as there's another path that was freeing that node, which is just plain wrong
for a node allocated by the GC system.
This patch removes that call to free() which fixes the test. I've spun it in
my tester and will obviously wait for the pre-commit system to render a verdict
before moving forward.
PR target/119865
gcc/
* config/riscv/riscv.cc (parse_features_for_version): Do not
explicitly free the architecture string.
(cherry picked from commit 1a64b224fa014e772fb30f6bd69ceb24da5827e6)
Diff:
---
gcc/config/riscv/riscv.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index d3520af1cddc..c25723cd90da 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -13154,9 +13154,6 @@ parse_features_for_version (tree decl,
DECL_SOURCE_LOCATION (decl));
gcc_assert (parse_res);
- if (arch_string != default_opts->x_riscv_arch_string)
- free (CONST_CAST (void *, (const void *) arch_string));
-
cl_target_option_restore (&global_options, &global_options_set,
&cur_target);
}
More information about the Gcc-cvs
mailing list