https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113799
Bug ID: 113799
Summary: gfc_replace_expr: double free detected ?
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Created attachment 57350
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57350&action=edit
F90 source code
For the attached F90 source code, I get this
test $ ~/gcc/results/bin/gfortran -c ./Evaluate/folding20.f90
free(): double free detected in tcache 2
f951: internal compiler error: Aborted
0xf581f9 crash_signal(int)
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/toplev.cc:317
0x7658aa gfc_replace_expr(gfc_expr*, gfc_expr*)
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/fortran/expr.cc:640
0x7658aa simplify_intrinsic_op(gfc_expr*, int)
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/fortran/expr.cc:1324
0x7658aa gfc_simplify_expr(gfc_expr*, int)
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/fortran/expr.cc:2317
The source code is from the flang testsuite in clang.
The bug has existed since sometime before 20240107.