rtl-ssa: Use right obstack for temporary allocation
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 12 Feb 2021 15:54:49 +0000 (15:54 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 12 Feb 2021 15:54:49 +0000 (15:54 +0000)
I noticed while working on PR98863 that we were using the main
obstack to allocate temporary uses.  That was safe, but represents
a kind of local memory leak.

gcc/
* rtl-ssa/accesses.cc (function_info::make_use_available): Use
m_temp_obstack rather than m_obstack to allocate the temporary use.

gcc/rtl-ssa/accesses.cc

index 992a54c29a23d1f2ef80154297defdb1d17c9b07..5023d55852f080bd7a22f02ded173eb3a8566e77 100644 (file)
@@ -1290,7 +1290,7 @@ function_info::make_use_available (use_info *use, bb_info *bb)
          // Create a temporary placeholder phi.  This will become
          // permanent if the change is later committed.
          phi = allocate_temp<phi_info> (phi_insn, resource, 0);
-         auto *input = allocate<use_info> (phi, resource, ultimate_def);
+         auto *input = allocate_temp<use_info> (phi, resource, ultimate_def);
          input->m_is_temp = true;
          phi->m_is_temp = true;
          phi->make_degenerate (input);