title: Huge memory consumption during compilation when passing constexpr by const reference
body: <p>Compilation of the following code with g++ consumes a surprisingly big amount of memory (over 5gb).</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #define N 100000
  
  struct A {
      int tab[N];
      constexpr A(): tab{} {
          for (size_t i = 0; i &lt; N; ++i) tab[i] = i;
      }
  };
  
  struct B {
      int tab[N];
      constexpr B(const A&amp; a): tab{} {
          for (size_t i = 0; i &lt; N; ++i) tab[i] = a.tab[N-1-i] * 2;
      }
  };
  
  constexpr A a;
  constexpr B b(a);
   
  int main(){ std::cout &lt;&lt; b.tab[N-5]; }
  </code></pre>
  <p>It seems that it is caused by passing a <code>const A&amp;</code> in <code>B</code>'s constexpr constructor -- passing by value fixes the problem.
  What is happening there?</p>
  <p>g++ version: <code>(Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0</code>.
  It was the same on some older version too.</p>
  <p>This problem doesn't occur when compiling with clang-10.</p>