<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Different codegen with/without -g"
   href="https://bugs.llvm.org/show_bug.cgi?id=42138">42138</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Different codegen with/without -g
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DebugInfo
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chris.dawson@sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Using the check-cfc tool (
<a href="https://github.com/llvm/llvm-project/tree/master/clang/utils/check_cfc">https://github.com/llvm/llvm-project/tree/master/clang/utils/check_cfc</a> ) to
spot a codegen difference depending on whether -g is specified or not.

$ cat PowerParser.ii.cc

template <typename, typename = int> class e;
class allocator {
public:
  ~allocator();
};
template <typename, typename> class e {
public:
  e(char *, allocator = allocator());
};
template <typename b, typename c, typename d> bool operator==(e<c, d>, b);
class f {
public:
  f(int *, int *, int *, int, int, int, int);
  e<char> g();
  void j();
};
int h, i;
class k {
  void l();
  bool m_fn4();
  int m;
  int n;
  int q;
  int fmap;
};
void k::l() {
  e<char> o = "";
  for (;;) {
    int p = 0;
    for (;;) {
      if (m_fn4())
        break;
      f a(&q, &fmap, &m, n, h, i, 0);
      if (a.g() == "")
        a.j();
    }
  }
}

$ ./llvm-project/clang/utils/check_cfc/clang++ PowerParser.ii.cc -w -c -O1 -o
tmp.ll

Check CFC, checking: dash_g_no_change
PowerParser.ii.cc Code difference detected with -g
--- /tmp/tmpcdg_LH.o

+++ /tmp/tmpfkaPkW.o

@@ -19,6 +19,6 @@

   28:  4c 8d 73 08             lea    0x8(%rbx),%r14
   2c:  4c 8d 7b 0c             lea    0xc(%rbx),%r15
   30:  4c 8d 64 24 08          lea    0x8(%rsp),%r12
-  35:  66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
-  3c:  00 00 00
-  3f:  90                      nop
+  35:  eb 09                   jmp    40 <_ZN1k1lEv+0x40>
+  37:  66 0f 1f 84 00 00 00    nopw   0x0(%rax,%rax,1)
+  3e:  00 00
*** Diff truncated ***</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>