gcc/gcc11-pr98638.patch
DistroBaker 04faf4a952 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/gcc.git#b08544362ee92895e04e7363d2c9f5cbd09a820e
2021-01-21 06:53:09 +00:00

30 lines
1.0 KiB
Diff

Since SSA names do leak into global tree data structures like
TYPE_SIZE or in this case GFC_DECL_SAVED_DESCRIPTOR because of
frontend bugs we have to be careful to wipe references to the
CFG when we deconstruct SSA form because we now do ggc_free that.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
2021-01-19 Richard Biener <rguenther@suse.de>
PR middle-end/98638
* tree-ssanames.c (fini_ssanames): Zero SSA_NAME_DEF_STMT.
--- gcc/tree-ssanames.c
+++ gcc/tree-ssanames.c
@@ -102,6 +102,14 @@ init_ssanames (struct function *fn, int size)
void
fini_ssanames (struct function *fn)
{
+ unsigned i;
+ tree name;
+ /* Some SSA names leak into global tree data structures so we can't simply
+ ggc_free them. But make sure to clear references to stmts since we now
+ ggc_free the CFG itself. */
+ FOR_EACH_VEC_SAFE_ELT (SSANAMES (fn), i, name)
+ if (name)
+ SSA_NAME_DEF_STMT (name) = NULL;
vec_free (SSANAMES (fn));
vec_free (FREE_SSANAMES (fn));
vec_free (FREE_SSANAMES_QUEUE (fn));