[PATCH] gcc: trans-mem.c (gate_tm_init): Return false if cfun->cfg is NULL

Seija K. doremylover123@gmail.com
Mon Jun 14 14:16:02 GMT 2021


This is a patch to fix BUG 87162 by returning false if cfg is null.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162

diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 1d4eb80620295..326e1c412465b 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -2099,6 +2099,9 @@ gate_tm_init (void)
   if (!flag_tm)
     return false;

+  if (!cfun->cfg)
+    return false;
+
   calculate_dominance_info (CDI_DOMINATORS);
   bitmap_obstack_initialize (&tm_obstack);


More information about the Gcc-patches mailing list