https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94421
otcmaf <xuemaosheng at huawei dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xuemaosheng at huawei dot com --- Comment #2 from otcmaf <xuemaosheng at huawei dot com> --- In our case, the compile bug is called from function update_dep. Variable was_spec is true, dep_spec_p (dep) is false, current_sched_info->flags & DO_SPECULATION is zero, DEP_STATUS (dep) & SPECULATIVE is zero. So in this case, we should avoid to free the memory of spec_dependency_cache. 1191 if (was_spec && !dep_spec_p (dep)) 1192 /* The old dep was speculative, but now it isn't. */ 1193 change_spec_dep_to_hard (sd_it); 1194 (gdb) p was_spec $11 = true (gdb) p dep_spec_p (dep) $12 = false (gdb) p current_sched_info->flags & DO_SPECULATION $13 = 0 (gdb) p DEP_STATUS (dep) & SPECULATIVE $14 = 0 (gdb) p !dep_spec_p (dep) $15 = true